Showing results for 
Search instead for 
Did you mean: 

Unconditionally executing cleanup steps in failing tests

0 Kudos

Unconditionally executing cleanup steps in failing tests

Test cases have Teardown scripts that are unconditionally executed, even if the test fails and stops executing part way.  This is useful to ensure that tests free up any resources they allocated earlier in the test before it failed.


However, this encourages all teardown activities to be coded in Groovy, which obscures the symmetry between resource setup in SoapUI test steps and resource teardown in Groovy.  It makes it harder to automatically check (via scripts) for symmetry between resource setup and cleanup.


Desired feature: identify some "cleanup" sequence of steps in each test that would execute unconditionally even if the test stops mid-way because of a failure.  This would be akin to the "catch" in Java try-catch-finally.  The analogy could be taken further in that if a step failure or other error occurred during the cleanup steps, the Teardown script would itself execute unconditionally just as it does today.


Benefit: hoist and simplify resource cleanup actions out of the Teardown groovy script into the test case itself as real test steps that can be seen in the IDE.  Makes it easier for automation developers to code cleanup steps and verify they are present (opposed to Teardown scripts which tend to hide and be forgotten).  Also makes setup/cleanup actions more amenable to analysis by scripts for the purpose of enforcing verification rules and generating metrics.



Welcome to the ReadyAPI Feature Requests board!

Here you can review submitted feature requests and vote up the ones you like! If you can't find the feature you want - go ahead and suggest your own idea. Ideas with the highest rating can be implemented in the product.

Check out the Create a Feature Request guide for more information.
New Here?
Join us and watch the welcome video: