I want to get a recommendation from the community on the best practices for handling the next use case with playwright/typescript.
I have a lot of tests that run in parallel mode. To simplify the explanation – A, B, C, D, E tests and 2 workers.
In the global setup, we do login and share it across all the tests.
One of the test check the logout process, let’s say it is test B.
Test are executed in the next order:
Worker 1 – A, B, C
Worker 2 – D, E
All tests in worker 2 are passing successfully, but for tests from worker 1: A – pass, B – pass (logout happened), C – fails because of not logged-in user.
How to handle logout tests in parallel execution without affecting other tests? What are the best practices for handling logout in parallel test execution with shared sessions?
I tried to use separate context but it did not help or I did it in a wrorng way.