Restart browser for each feature instead of for each Scenario #2277
-
Hi there, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @ahmed-al-sadoon! Cucumber.js hooks work in the scope of an entire test suite ( 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 PlaywrightSerenity/JS actors integrate with Playwright using the ability to There are two ways to inject Playwright API into this ability that work slightly differently:
Note that both the above setups keep the actual Reusing the same
|
Beta Was this translation helpful? Give feedback.
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…