Lesson 10 - Applying what we've learned - Write another DELETE check and/or add SetUp to another check

Title: Write another DELETE check and/or add SetUp to another check

Time: 15-45 minutes

Purpose: To practice writing DELETE checks; and/or practice adding SetUp features to checks

Introduction: At the end of Lesson 10 I challenged you to either add another DELETE check, and/or add the SetUp feature to another check that was already written.

Activity:

  • Choose one or both activities below to do:
    • Write another DELETE check
      • Idea: a scenario that doesn’t send the token for authentication
    • Add the SetUp feature to another check
      • Idea: the PUT check is a good candidate for this
      • Note that you need to create a new class for that check to use SetUp properly
  • Write/modify your check(s), and verify they pass
  • Be sure to run your checks multiple times!
  • Share on this thread:
    • What scenario(s) did you try?
    • Are you stuck anywhere?

I am wondering 2 things:

  1. Should an undeleted item stay in the database forever? We have a setup where we create an item, and in the test we delete the item. What if the delete request is broken? Obviously, the test should fail. Suppose it take a while before the delete functionality is fixed, and we run our automated delete check many times. Should we implement a teardown to delete the item, or can the item stay in the database forever?
    (I personally think this is not much an issue, it’s a small piece of data and we are basically guaranteed all have a unique name. Happy to hear a different opinion)
  2. I wanted to make a check for deleting an item that does not exist, and assert if it returns a NotFound response. This check does not need a setup. Would you put this check in the same fixture as the other delete checks (because similar tests belong together) or in a different fixture without a setup? For now, I decided to have it in the same fixture.
1 Like