Skip to content

Restart browser for each feature instead of for each Scenario #2277

Closed Answered by jan-molak
ahmed-al-sadoon asked this question in How to... ?
Discussion options

You must be logged in to vote

Hi @ahmed-al-sadoon!

Cucumber.js hooks work in the scope of an entire test suite (BeforeAll/AfterAll), scenario (Before/After), or a step (BeforeStep/AfterStep). Cucumber doesn't support hooks that would be executed before/after a feature because of the reasons described in cucumber/cucumber-js#914 (comment)

Also, it's usually better to keep your test scenarios isolated, so that the state from one scenario doesn't leak to another.

Having said that, if you've considered the above and concluded that you still want to do it, here's how.

Integrating with Playwright

Serenity/JS actors integrate with Playwright using the ability to BrowseTheWebWithPlaywright.

There are two ways to inject Playwr…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ahmed-al-sadoon
Comment options

Answer selected by jan-molak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants