Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Playwright already runs test files in parallel. To test several browsers or devices at once, define named projects. To run tests within a file concurrently, enable fullyParallel or set test.describe.configure({ mode: 'parallel' }). To use several CI machines, split the suite with --shard=x/y. The right worker count depends on CPU, memory, browser capacity, CI-minute cost, and whether tests touch shared data.

Understand Playwright’s parallelism model

There are three separate levers, and confusing them is the most common cause of slow or flaky parallel runs:

  • Workers: independent OS processes that execute tests. Each worker starts its own browser. The workers setting caps how many can run concurrently on one machine.
  • Projects: named browser, device, or environment configurations. Playwright runs every configured project by default; --project limits a run to selected projects.
  • Shards: partitions of the suite sent to separate machines or CI jobs. A command such as --shard=1/4 runs the first of four partitions.

By default, test files run in parallel, while tests inside one file run in order in the same worker. Turn on test-level parallelism only when the tests are independent and their fixtures and data can safely overlap.

Configure browser and device projects

A project is a complete test configuration: browser engine, device profile, base URL, permissions, headers, or any other use option. Projects are useful for a browser matrix because the same test files can execute against Chromium, Firefox, and WebKit without duplicating the tests.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
  fullyParallel: true,
  workers: process.env.CI ? 2 : undefined,
  projects: [
    { name: 'setup', testMatch: '**/*.setup.ts' },
    { name: 'chromium', use: { ...devices['Desktop Chrome'] }, dependencies: ['setup'] },
    { name: 'firefox', use: { ...devices['Desktop Firefox'] }, dependencies: ['setup'] },
    { name: 'webkit', use: { ...devices['Desktop Safari'] }, dependencies: ['setup'] },
  ],
});

Save this as playwright.config.ts. The setup project is not a browser target in this example; it is a dependency project. Playwright completes it before the three browser projects begin. After setup passes, the dependent projects can run in parallel, and a configured teardown runs after them.

Run every project

npx playwright test

This uses all projects in the configuration. Independent projects compete for the configured worker limit.

Run one project

npx playwright test --project=firefox

Use this for a focused browser run, debugging, or a job dedicated to one environment.

Skip dependencies deliberately

npx playwright test --no-deps --project=chromium

--no-deps prevents dependency projects from running. Use it only when the required state already exists; otherwise the browser tests may fail because setup-created accounts, storage state, or other prerequisites are missing.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Control concurrency within one machine

Set the worker ceiling

npx playwright test --workers=4

The CLI value overrides the configured maximum for that invocation. In a config file, workers: 1 serializes execution. A higher value is not automatically faster: every worker is a separate process with its own browser, so CPU pressure, memory use, browser startup, database capacity, and CI pricing can become the bottleneck.

Enable all-test parallelism

npx playwright test --fully-parallel

Or set fullyParallel: true in the configuration. This allows individual tests, rather than only files, to be scheduled concurrently. It gives the scheduler finer-grained work and is especially useful when files contain uneven numbers of tests.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Parallelize only a group

import { test } from '@playwright/test';

test.describe.configure({ mode: 'parallel' });

test('account can be created', async ({ page }) => {
  // test body
});

test('account can be deleted', async ({ page }) => {
  // test body
});

Use test.describe.configure({ mode: 'parallel' }) at file or describe-group scope when the rest of the suite must retain ordered execution. Tests in the parallel group must not depend on mutations made by another test in that group.

Keep ordered tests together

Leave a file in the default mode when its tests intentionally build on one another, use a shared account, or rely on ordering. Parallel workers cannot communicate directly, and a browser context being isolated does not isolate records in your backend, files on disk, or an external service.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Make setup and teardown parallel-safe

Dependency projects are the reliable way to prepare shared prerequisites. Put authentication or data seeding in a setup project, list it in dependencies, and let browser projects start only after setup succeeds.

  • Generate a unique account, tenant, order ID, or filename from the worker or test identity.
  • Give each test its own backend records instead of reusing one mutable fixture.
  • Use named locks when an external system truly permits only one operation at a time.
  • Lower the worker count for the project that must access a constrained shared resource.
  • Keep teardown aware of all dependents; it should remove data only after those projects finish.

Do not assume that separate browser contexts solve server-side races. Two workers can still update the same database row, overwrite the same uploaded file, or consume the same single-use account.

Scale out with CI sharding

Workers increase concurrency on one machine. Sharding divides the suite across machines, so each CI job can have its own worker pool.

npx playwright test --shard=1/4

Run the same command in four jobs, changing the shard number to 1/4, 2/4, 3/4, and 4/4. Each job needs the project dependencies and test environment it uses. Sharding is an execution strategy, not a data-isolation strategy: every job still needs unique or coordinated backend data.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

How the work is divided

  • With fullyParallel: true, Playwright can balance at test level, giving the scheduler smaller units of work.
  • Without full parallelism, sharding is file-level. A few unusually large files can therefore make one shard much slower than the others.

Use shards when one machine cannot provide enough CPU, memory, or browser capacity, or when CI time is more valuable than the cost of additional machines. The official documentation provides examples such as four shards, but no universal speedup percentage; actual gains depend on suite shape and infrastructure.

A generic CI matrix pattern

# Each CI job sets SHARD_INDEX to a different value from 1 through SHARD_TOTAL.
npx playwright test --shard="$SHARD_INDEX/$SHARD_TOTAL"

Collect the reports from all jobs as one build artifact in your CI system. The exact matrix syntax differs by provider, so keep the Playwright command and shard values in the provider’s job definition.

Choose a worker count without creating flakiness

Start with a conservative value that leaves headroom for the operating system and browser processes, then increase it while watching run time and failure rate. There is no generally correct number. A useful decision sequence is:

  1. Measure capacity: note available CPU cores, memory, browser concurrency limits, database connections, and CI-minute limits.
  2. Check isolation: confirm that tests use unique records, files, credentials, and external-service identifiers.
  3. Run a baseline: compare the default worker setting with a small explicit value such as --workers=2.
  4. Increase gradually: test a higher value only if the machine remains below its resource limits and failures do not rise.
  5. Separate constrained projects: keep a low worker count for a shared-resource project instead of slowing every project.

In the sample configuration, process.env.CI ? 2 : undefined deliberately uses two workers in CI while leaving the local setting to Playwright’s normal behavior. Treat that number as a starting policy, not a benchmark or recommendation for every repository.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Common parallel-run failures and fixes

Tests pass alone but fail in parallel

Cause: tests share an account, backend row, file, or external resource. Fix: create unique data per test or worker, add a named lock around the non-shareable operation, or reduce workers for that project.

Only one browser project runs

Cause: the command includes --project. Fix: remove the selector to run all configured projects, or pass the project name you intended.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Browser tests start before authentication or seed data exists

Cause: setup is not declared as a dependency, or dependencies were skipped with --no-deps. Fix: add dependencies: ['setup'] to each dependent project and run without --no-deps when setup is required.

One CI shard takes much longer than the others

Cause: file-level sharding placed large files together. Fix: enable fullyParallel so balancing can occur at test level, or reorganize unusually large files.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More workers make the suite slower

Cause: CPU, memory, browser, database, or network contention. Fix: lower workers, move to more capable CI machines, or shard across machines rather than oversubscribing one host.

Parallel mode exposes order-dependent assertions

Cause: a test assumes another test has already changed state. Fix: make the prerequisite an explicit fixture or setup dependency, or keep the dependent tests in ordered mode.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your goal is simply to obtain clean website screenshots from a parallel test or content pipeline, ScreenshotNeo provides a single HTTP request instead of requiring you to manage browser workers. Its API can return PNG, JPEG, WebP, or PDF; the examples below use WebP.

See the ScreenshotNeo API documentation for request options and authentication.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
  • Cookie and consent banners, newsletter popups, and chat widgets are removed before the shot.
  • Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed; response headers identify the page verdict and billing status.
  • An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.
  • The Free plan includes 1,000 screenshots each month with no card; paid plans start at $5 for 3,000 shots.

Create a free ScreenshotNeo account to try the 1,000 monthly screenshots without adding a card.

FAQ

Can projects use different worker limits?

The worker limit is a run-level control. If one project needs stricter serialization because of a shared resource, isolate that workload in its own command or CI job and set a lower worker value there.

Should every project depend on the same setup project?

Only projects that require the setup state should list it in dependencies. Independent projects can start without that gate.

Is sharding a replacement for workers?

No. Shards distribute work across machines; workers distribute work within each machine. They can be combined when both the suite and the infrastructure justify the extra concurrency.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Can projects use different worker limits?

The worker limit is a run-level control. Put a resource-constrained project in its own command or CI job and give that run a lower worker value.

Should every project depend on the same setup project?

Only projects that need the setup state should list it in dependencies; independent projects can run without that gate.

Is sharding a replacement for workers?

No. Shards distribute work across machines, while workers distribute work within each machine; they can be combined.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.