-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
[BUG] Existing browser is closing when test is failed and new browser is opening for new test. Consumes time for executing before all code #34143
Comments
The problem you’re encountering happens because Playwright’s default test runner automatically closes resources when a test fails or completes. To work around this, you can use a try-catch block for assertions. This approach ensures that the same browser and page remain open throughout all tests, even if one test fail.
|
Playwright shuts down the worker process after test failure. Closing as a duplicate of #32803 that asks for a way to disable this. |
Here page and browser is working for other tests but test is passed even assertion is failed. Its misleading test results Adding try-catch for one test case is acceptable but what if we have 1000 tests among 100 test files. Its tough for adding into multiple files and tests. We have any option to execute same fixtures for new tests also? Or can we create custom test runner to remain same page and browser throughout all tests in spec? Please look into this issue |
@dgozman I am facing above issue. Please provide solution on this |
We need same page instance for all tests in spec even any case is failed also
test 2 passed with same page
test 3 failed and browser is closed
test 4 execution with new browser
In simple way,
The text was updated successfully, but these errors were encountered: