Skip to content

Restart browser only for a specific test file? #3638

Closed Answered by adudyak
socketopp asked this question in Q&A
Discussion options

You must be logged in to vote

first_test.js Browser will be restarted before each scenario:

Feature("restarted")

Before(({ I }) =>{
I.restartBrowser(contextOptions);
});

Scenario("1");
Scenario("2");

second_test.js Browser won't be restarted while running these scenarios:

Feature("not restarted");

Scenario("1");
Scenario("2");

If you want to not restart browser between first_test.js and second_test.js, then set restart: false in settings.
https://codecept.io/helpers/Playwright/#restartbrowser

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@socketopp
Comment options

@adudyak
Comment options

Answer selected by kobenguyent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants