-
Notifications
You must be signed in to change notification settings - Fork 113
Description
Reqnroll Version
2.4.1
Which test runner are you using?
NUnit
Test Runner Version Number
2.4.1
.NET Implementation
.NET 8.0
Test Execution Method
Command line – PLEASE SPECIFY THE FULL COMMAND LINE
Content of reqnroll.json configuration file
No response
Issue Description
We are using Reqnnroll with NUnit and Selenium for our BDD test automation.
Our framework uses a custom SoftAssert class to collect multiple assertion failures during a scenario and throws an exception in the [AfterScenario] hook (teardown).
Problem:
• When a soft assertion failure occurs, the exception is thrown in [AfterScenario].
• The failure is correctly logged in our log files (e.g., logs.txt), and screenshots are taken.
• However, the test runner (CMD output) reports the scenario as "Passed" instead of "Failed".
• This leads to false positives: failed tests are not visible in the test results, only in logs.
Expected Behavior:
• If an exception is thrown in [AfterScenario], the scenario should be marked as failed in the test runner output (CMD, test explorer, CI pipeline, etc.), just as it is when an exception is thrown during a step.
Steps to Reproduce
- Use Reqnnroll with NUnit and Selenium.
- Implement a SoftAssert class that collects failures and throws in [AfterScenario].
- Run a scenario with a failing soft assertion.
- Observe that the failure is logged and screenshot is taken, but the scenario is reported as "Passed" in CMD/test results.
Link to Repro Project
No response