SmartBear / soapui

SoapUI is a free and open source cross-platform functional testing solution for APIs and web services.
http://www.soapui.org
Other
1.58k stars 611 forks source link

[BUG] Assertions are being ran twice when test step is open #808

Open BachmannKarlHendrik opened 6 months ago

BachmannKarlHendrik commented 6 months ago

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