[Feature] Have critical section support for tests so projects don't run them in parallel
See original GitHub issuecan I limit workers to 1 on a single test file? - so as to not run the test suite sequentially
I have my default projects set to 3 browsers to support multi-browser tests on a single run. I have a test case that has access to a resource that cannot be shared across the 3 browsers simultaneously. In order to avoid this race condition, I had to run this test on a single worker - so all three browsers don’t run in parallel.
I tried making the test file serial by test.describe.configure({ mode: 'serial' });
and test.describe.serial(title, callback)
but none of them had any effect on running the test serially across the 3 browsers. I assume the playwright doesn’t support serializing the test on a project level.
`projects: [ { name: ‘chromium’, use: { …devices[‘Desktop Chrome’], }, },
{
name: 'firefox',
use: {
...devices['Desktop Firefox'],
},
},
{
name: 'webkit',
use: {
...devices['Desktop Safari'],
},
},`
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:5 (3 by maintainers)
Please, see link below, maybe it could help.
https://playwright.dev/docs/test-parallel#disable-parallelism
May be solved by https://github.com/microsoft/playwright/issues/14895#issuecomment-1219986634