erki
12 years agoOccasional Contributor
looping while teststep passes - fails testcase
I have a scenario where i am polling the database while something i expect happens (because it takes some time for stuff to happen in db).
I am using groovy for looping, something similar to:
I would expect that if the last step succeeded (doesn't care how many tries it takes) the whole case would pass, but i am getting:
TestCase failed [Failing due to failed test step], time taken = 22146
And RunTestCaseLog is showing:
Step 14 [Check Email] FAILED: took 10757 ms
-> check_email - FAILED - 224
-> - [Script Assertion] assert count > 1.toInteger()
| | |
0 | 1
false
-> isOk? - OK - 5001
-> check_email - FAILED - 265
-> isOk? - OK - 5000
-> check_email - OK - 229
-> isOk? - OK - 0
TestCase failed [Failing due to failed test step], time taken = 22146
How can i make the testcase pass.
I am using groovy for looping, something similar to:
def lastResult = testRunner.getResults().last().getStatus().toString()
if( lastResult == 'FAILED' )
{
sleep 5000
testRunner.gotoStepByName('check_email')
}
else
{
log.info 'All cool with emails'
}
I would expect that if the last step succeeded (doesn't care how many tries it takes) the whole case would pass, but i am getting:
TestCase failed [Failing due to failed test step], time taken = 22146
And RunTestCaseLog is showing:
Step 14 [Check Email] FAILED: took 10757 ms
-> check_email - FAILED - 224
-> - [Script Assertion] assert count > 1.toInteger()
| | |
0 | 1
false
-> isOk? - OK - 5001
-> check_email - FAILED - 265
-> isOk? - OK - 5000
-> check_email - OK - 229
-> isOk? - OK - 0
TestCase failed [Failing due to failed test step], time taken = 22146
How can i make the testcase pass.