Running a specified action/test after a test case
I would like to know if there is a way to do an action after a test case is done.
Here's my scenario: I would like to create a lot of tests for HTTP POST, which updates records. After a test case is done, I would like to revert back the values of my record using another API call, and use it for another test, or use it for the same test.
I believe I can create a Test Suite, and create 2 test cases there, one is the actual test, and another to revert, but if I have like 50 test cases, then I'll need 50 test suites?
Please advise.
Thanks!
Comments
-
If you don't want to create 50 copies of a "revert" test then consider creating it once as a global tool and then referencing it 50 times. You can reference a global tool as a test or as an output tool. If you chose to add it as a output tool then you can add it in bulk by selecting all the tests you wish to chain it to before opening the Add Output dialog.
0 -
I don't get how can I reference global tool as a test? is there a guide I can follow?
0 -
Here are some resources from the docs which may help you:
Use Existing Tools for Repeated Tool Configurations or Tests
- High level summary about best practicesGlobal Tools
- Explains how to create a global tool. After you created one, you can reference it on the "Existing Tools" tab whenever you add a new test or tool output.Adding Multiple Outputs
- Explains how to add output tools in bulk, including references to global tools.0