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

StepEventBus.getEventBus().clearStepFailures() no longer works correctly #3460

Open
nbarrett opened this issue May 3, 2024 · 2 comments
Open

Comments

@nbarrett
Copy link
Contributor

nbarrett commented May 3, 2024

What happened?

What did you expect to happen?

I would expect that calling StepEventBus.getEventBus().clearStepFailures() would not cause the test to fail but it still does.

Serenity BDD version

4.1.6 (latest)

JDK version

8->21

Execution environment

mac/linux

How to reproduce the bug.

How can we make it happen?

Work on this myself and propose a PR (with Serenity BDD team guidance)

@wakaleo
Copy link
Member

wakaleo commented May 3, 2024

This won't work as expected with the new Cucumber 7 event model, as events are now cumulated and assembled at the end of the test

@nbarrett
Copy link
Contributor Author

nbarrett commented May 3, 2024

Actually having thought about it, the example project I supplied for 4.1.6 was slightly incorrect as the behaviour I wanted to test is whether an exception thrown within another performable can be caught and reset by a parent. When I revised my project as can be seen here, it actually works - in that subsequent steps can be continued without an overall test suite failure outcome:

image

  • Calling StepEventBus.getEventBus().clearStepFailures() is not needed as we've caught the exception thrown by the performable in the catch block - something that was not possible in previous versions of Serenity discussed here so this is a big improvement! 👍 👍
  • We are unable to clear reporting which remains amber (not a problem in my case) regardless of whether we clearStepFailures or not.

As a further check I rolled the Serenity example project back to 3.6.22 which is the version we are still on within our client project. This does reproduce the original problem that I raised which is that it's not possible to catch or reset the step failures and the first failing test case causes a test suite failure outcome:

image

So it looks like the solution is to upgrade to Serenity version 4.1.6 on our project. However, there are other report aggregation performance problems we're wrestling with at the moment with that, that might well be the subject of a further PR soon 🤞 - stay tuned!)

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