Playwright · Reliable end-to-end tests

How does parallelization work in Playwright?

Hardparallelismworkerstest runnerUpdated Oct 2026
Quiz this track

Short answer

Playwright runs test files in parallel across worker processes. Each worker has its own browser, and each test gets its own context. Use fullyParallel to parallelize tests within a file too.

Parallelism is based on worker processes. By default, test files are distributed across workers and can run at the same time, while tests inside a file run in order. Each worker launches its own browser and reuses it for its assigned tests.

The scheduling model

  • Test files are the default parallel unit
  • fullyParallel: true also runs individual tests in a file in parallel
  • workers caps how many processes run at once
  • Worker-scoped fixtures are shared within a worker, not across workers
  • Each test still gets a fresh context, regardless of worker reuse
ts
import { defineConfig } from "@playwright/test";

export default defineConfig({
  fullyParallel: true,
  workers: process.env.CI ? 4 : undefined,
});
CI usually gets a fixed worker count, while local runs can use the default heuristic.
bash
npx playwright test --workers=4
npx playwright test --fully-parallel
npx playwright test tests/checkout.spec.ts --workers=1
The CLI can override workers and parallelism per run.

Parallelism multiplies shared-state bugs. If two workers use the same login or the same seeded record, they will collide more often than in a serial run. Fix the data strategy before increasing workers, or the suite will look flaky only on fast machines.

More workers is not always faster. Browser startup, server capacity and database contention can make a high worker count slower. Measure the suite instead of assuming the maximum is best.

Follow-ups you should expect

Interviewers use these to check whether the first answer was understanding or memorisation.

  1. 1What is the default parallel unit?
  2. 2What does fullyParallel change?
  3. 3Why can more workers make a suite slower?
  4. 4How does worker scope interact with parallelism?

Say it in the interview

By default Playwright parallelizes at the test-file level across worker processes, and each worker has its own browser. Setting fullyParallel also parallelizes tests within a file, and the workers option caps concurrency. Every test still gets a fresh context. I fix shared test data before raising worker counts, because parallelism exposes collisions that serial runs hide, and more workers can actually be slower under server or database contention.

Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.

Related questions

Reading is step one

Now say it out loud.

Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live Playwright mock interview and get scored feedback on depth, clarity and confidence.