-
Book Overview & Buying
-
Table Of Contents
Hands-On Automated Testing with Playwright
By :
Playwright is able to speed up your tests by running them in parallel. But to really get the most out of it, it helps to understand how it all works. Let's break down how Playwright handles parallelism.
Playwright’s Test Runner is built from the ground up to make running tests in parallel easy. When you run npx playwright test, the runner automatically starts up a pool of workers, each one running in its own Node.js process. Playwright figures out how many workers to use by looking at your machine’s CPU count. By default, it uses one less than the total number of logical cores, but it always uses at least one.Each worker picks up one complete test file at a time and runs it in isolation. It launches its own browser contexts to make sure nothing gets shared so that things like cookies or local storage stay completely separate.At runtime, Playwright distributes entire test files...