It would be beneficial to be able to abort an entire test execution gracefully through groovy.
In my case I have an async operation that I kick off, delay a small period, check the status then iterate around that for a defined number of retries before deeming it a pass/fail.
In certain cases it does not make sense for me to continue the test suite/entire test run in certain circumstances and I'd like to be able to issue an abort through groovy in this situation.
Hopefully feature request gains traction with community.
Thanks in advance.
I can definitely see the use in this, that if a certain condition is met to be able to automatically stop the tests. This could be a really useful feature available to trigger via groovy.
If its groovy does it need to be a feature request or can we just come up with a solution.
There is no solution currently available even with groovy, @sanj. There's no way to tap into the API of ReadyAPI itself to stop executions. In the original thread, this was confirmed with ReadyAPI engineers. 🙂
@msiadak Thanks for the confirmation 🙂
Since that is indeed the case then agreed
Have you tried the following code:
testRunner.cancel( "I'm getting tired" )if you want to fail it usetestRunner.fail( "It didn't work" )
Hi @GillerM I'm afraid that only cancels or fails the current test case in operation and resumes with the next testcase. My desire is to abort the entire execution of ALL testcases which this does not work.
It would be nice to have this feature. But, I wonder if you could use a variable flag to tell other tests to fail. A groovy script could be used to check the flag and act on it.Side note - The java library TestNG has Assert.fail() which allows you to do this. Unfortunately, you'll have to write all tests in programming language.https://sqa.stackexchange.com/questions/2044/testng-mark-a-test-as-failed-if-a-particular-path-is-us...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.