Skip to content
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

When a cucumber scenario fails in a @Before method then serenity reporter should report it as failed instead of ignored #2935

Closed
wieben opened this issue Sep 29, 2022 · 2 comments

Comments

@wieben
Copy link

wieben commented Sep 29, 2022

When a cucumber scenario fails in a @Before method then serenity reporter should report it as failed instead of ignored.
@wakaleo fixed this issue back in 2018 and it somehow reappeared so I found his fix from back then which need a small change.
I think that in the method

io.cucumber.core.plugin.SerenityReporter#handleTestCaseFinished

the line

if (Status.FAILED.equals(event.getResult()) && noAnnotatedResultIdDefinedFor(event)) {

should be changed to

if (Status.FAILED.equals(event.getResult().getStatus()) && noAnnotatedResultIdDefinedFor(event)) {

so that if a cucumber before step fails then serenity reporter also reports the scenario as failing instead of ignored.
And probably a test case created so that the intended behavior of serenity reporter reporting on failing @Before methods is verified.
I realize this submitted issue could be a pull request, if my suggested fix gets in, then my next contribution might be an actual pull request... ;)

@wakaleo
Copy link
Member

wakaleo commented Sep 29, 2022

Well spotted. You will also needto cater for Status.ERROR and Status.COMPROMISED. I look forward to your PR!

@wakaleo
Copy link
Member

wakaleo commented Nov 3, 2022

Fixed in 3.3.10

@wakaleo wakaleo closed this as completed Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants