Running parallel Playwright Tests within a single spec file

Playwright by default runs all tests within a single spec file in order using the same worker, and runs tests in different spec files in parallel.

You can now use the test.describe.parallel block to specify that all tests contained in the block are independent and can be run in parallel. This can mean faster test runs.

There’s also test.describe.serial to specify the tests contained should be run one after another, and the subsequent tests won’t be run if an earlier test fails.

There’s also test.step which can be used to break tests down further into a series of steps.

I’ve updated my example TypeScript tests to use the parallel format.

One reply on “Running parallel Playwright Tests within a single spec file”

Leave a Reply

Your email address will not be published.