split all the tests between different machines using sharding;
each shard can have multiple workers (according to # of CPUs or explicit configuration).
Playwright shards, workers and parallel execution
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.
Example of underutilizing workers in Playwright
Enabling fullyParallel: true (see configuration details) 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.
Enabling fullyParallel mode uses all available Playwright workers
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.