Playwright Fully Parallel Mode
Details guide about Playwright Fully Parallel mode
Last updated
Details guide about Playwright Fully Parallel mode
Last updated
Playwright has multiple levels of concurrency:
split all the tests between different machines using ;
each shard can have (according to # of CPUs or explicit configuration).
Playwright Workers run the tests in parallel, allowing for a speedup in execution and full utilization of machine's resources.
By default, Playwright runs the tests of the same spec file in the same worker — one after another. Even if you have a powerful machine capable of supporting multiple workers, it can be under-utilized.
For example, if your machine has 4 workers and sharding assigns one spec file, only one worker will be utilized at a time and the tests will be executed one after another, not in parallel.
Note that the tests are required to be isolated and not shared in any state. Playwright will run the tests on different workers or even on different machines (a.k.a shards).
Version 1.0.0+ of the reporter is compatible with fully parallel mode and will collect the results of concurrent parallel executions from distributed shards and workers. Moreover, the reporter will display the results of each step, which is crucial for debugging failed CI executions.
Enabling fullyParallel: true
() allows running tests from the same spec file in parallel on different workers. This way, all available workers can be utilized, and the tests will be executed faster.
To enable running individual tests from the , set fullyParallel: true
in your configuration file.