In playwright, a maximum number of parallel workers can be controlled via the command line or the conf file. You can limit the number of workers that are used.
npx playwright test --workers 3
- Using this will limit workers upto only three and not more than that.
Workers: process.env.CI ? 2 : undefined,
- In the conf file, limit the number of workers on CI and use default locally.
- We can see her the workers are limited to 3.
We can also disable any parallelism by allowing a single worker at any time.
This can be done by setting workers: 1 or pass --workers=1.
npx playwright test --workers=1