When tests are being ran through TestCase editor, and the particular test step is currently open, then that particular test step's assertions will be ran twice. If the particular test step is closed, the assertions in that test step will run only once. This bug makes tests where assertions are applied only on certain conditions (eg on a second run only), the test results will become ambiguous.
Steps to reproduce
1) Create a groovy test step:
testRunner.testCase.setPropertyValue("runCount","0")
2) Create a Http request test step (for example GET http://github.com). Add script assertion:
int currentRun = Integer.parseInt(messageExchange.modelItem.testStep.testCase.getPropertyValue("runCount")); messageExchange.modelItem.testStep.testCase.setPropertyValue("runCount", (currentRun + 1).toString());
That basically counts, how many times the assertion is run.
3) Close all windows (in SoapUI) and open TestCase Editor. Run the tests from there.
4) Check under TestCase Custom properties, there will be written "runCount = 1".
5) Now open Http request test step, and rerun the tests from TestCase Editor.
6) Check under TestCase Custom properties, there will be written "runCount = 2", even though the value was reset by the groovy script beforehand and thus should still be 1.
Expected outcome
Whether or not the test step is open, the assertions will still be run once.
Environment
Windows 11 SoapUI 5.7.2
Description
When tests are being ran through TestCase editor, and the particular test step is currently open, then that particular test step's assertions will be ran twice. If the particular test step is closed, the assertions in that test step will run only once. This bug makes tests where assertions are applied only on certain conditions (eg on a second run only), the test results will become ambiguous.
Steps to reproduce
1) Create a groovy test step:
testRunner.testCase.setPropertyValue("runCount","0")
2) Create a Http request test step (for example GET http://github.com). Add script assertion:
int currentRun = Integer.parseInt(messageExchange.modelItem.testStep.testCase.getPropertyValue("runCount")); messageExchange.modelItem.testStep.testCase.setPropertyValue("runCount", (currentRun + 1).toString());
That basically counts, how many times the assertion is run.3) Close all windows (in SoapUI) and open TestCase Editor. Run the tests from there.
4) Check under TestCase Custom properties, there will be written "runCount = 1".
5) Now open Http request test step, and rerun the tests from TestCase Editor.
6) Check under TestCase Custom properties, there will be written "runCount = 2", even though the value was reset by the groovy script beforehand and thus should still be 1.
Expected outcome
Whether or not the test step is open, the assertions will still be run once.
Project for reproducing the issue
The issue can be reproduced with this project: ProjectForReproducingIssue.zip