-
-
Notifications
You must be signed in to change notification settings - Fork 513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JUnit5: StepListener get wrongly SUCCESS when an Exception is thrown in test #3443
Comments
Can you propose a PR? |
I would need to check but I believe if a test fails, the test finished listener is not meant to be triggered. |
(Also 4.0.12 is an old version, have you tried with the latest versions) |
|
Can you propose a PR? |
will take some time, my dev environment is outdated |
i have troubles to reproduce it with current version 4.1.6 |
found: |
duplicate of #3299 |
What happened?
net.serenitybdd.junit5.SerenityTestExecutionListener#testFinished
missed to callupdateResultsUsingTestExecutionResult()
withTestExecutionResult.Status.FAILED
becauseresult.isLessSevereThan(TestResult.FAILURE)
has to be negated or flipped.What did you expect to happen?
get the correct FAILED result in
net.thucydides.model.steps.StepListener#testFinished(net.thucydides.model.domain.TestOutcome)
if an exception is thrown inside a test, but outside a stepSerenity BDD version
4.0.12
JDK version
17
Execution environment
caused by net.serenity-bdd:serenity-junit5:4.0.12
How to reproduce the bug.
throw new RuntimeException("Test-Error");
void testFinished(TestOutcome result)
net.thucydides.core.steps.Listeners#getLoggingListener()
(eg withStepEventBus.getEventBus().registerListener(getLoggingListener())
)test failed, but the Listener got an result SUCCESS
this can be seen
testFinished(TestOutcome result)
withresult.getResult() == TestResult.SUCCESS
SerenityTestExecutionListener#testFinished
missed to callupdateResultsUsingTestExecutionResult()
Test Passed
please note that the method
void testFailed(TestOutcome testOutcome, Throwable cause)
is correctly calledHow can we make it happen?
Add it to the Serenity BDD backlog and wait for a volunteer to pick it up
The text was updated successfully, but these errors were encountered: