kenm's avatar
kenm
Contributor
7 years ago
Status:
New Idea

The capability to abort entire test execution through groovy

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.

Ken.

  • groovyguy's avatar
    groovyguy
    Community Hero

    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. 

  • sanj's avatar
    sanj
    Super Contributor

    If its groovy does it need to be a feature request or can we just come up with a solution.

     

  • groovyguy's avatar
    groovyguy
    Community Hero

    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. :) 

  • sanj's avatar
    sanj
    Super Contributor

    groovyguy 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 use
    testRunner.fail( "It didn't work" )

  • kenm's avatar
    kenm
    Contributor

    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.