---
title: "Best Test Orchestration Platforms for Playwright CI"
description: "Best test orchestration platforms, judged on what a Playwright CI team decides: queue or static split, own runners, failed-only reruns, one merged run."
canonical: "https://currents.dev/posts/best-test-orchestration-platforms-for-playwright-ci"
updated: "2026-12-02"
---

# Best Test Orchestration Platforms for Playwright CI

Published 2026-12-02 by Walter Galvão.

Canonical URL: https://currents.dev/posts/best-test-orchestration-platforms-for-playwright-ci

Best test orchestration platforms, judged on what a Playwright CI team decides: queue or static split, own runners, failed-only reruns, one merged run.

---


> **TL;DR**
>
> This article compares test orchestration platforms for Playwright in CI: Currents, Knapsack Pro, Buildkite Test Engine, CircleCI, Testkube, Harness, Azure Pipelines, TestMu AI HyperExecute, BrowserStack and Sauce Labs. It judges each one on how it splits work across machines, where tests run, how it handles reruns and dead machines, and whether results merge into one run. It also covers when Playwright's built-in sharding is enough on its own.
>
> If your Playwright team runs on its own CI runners, start with Currents: its orchestrator keeps a live queue of pending tests and assigns them to machines as they become available, and the tests run on your existing environment. If you already build on CircleCI, Azure Pipelines or Harness, use that CI's splitting before you add another tool. For a suite of small, even files, Playwright's own `--shard` with merged reports is enough.
>
> 1. If your Playwright team runs on its own CI runners, start with Currents.
> 2. If you already build on CircleCI, Azure Pipelines or Harness, use that CI's splitting before you add another tool.
> 3. If you want timing-based splits and a dashboard that also accepts results from non-Buildkite CI systems, pick Buildkite Test Engine.
> 4. If you want a file queue that wraps the runner you have, pick Knapsack Pro.
> 5. If test runs must live on your own infrastructure and start from any CI, pick Testkube.

Your Playwright suite runs on four CI machines, and the build still waits on one of them. To shard the suite, you pass `--shard=x/y` on the command line: with four shards, each one runs one fourth of the tests. By default, though, Playwright shards whole test files. When some files hold many more tests than others, some shards may end up running far more tests than the rest, while others may run fewer or even none.

You pay for that split twice. Playwright's merge-reports job runs after all shards have completed, so the combined report waits for the slowest shard. Then one test fails, or a runner dies halfway through, and rerunning the job repeats far more work than the broken tests need.

Fixing the split is the job of an orchestration platform: it decides which machine runs which test, and what happens when something breaks. The products sold for that job don't do the same thing. A CI server, a browser cloud and a test-selection tool solve different problems, and ranking them side by side tells a Playwright team little.

We ranked the tools on five decisions your team already faces. For a team on its own runners, a live queue beats a split fixed before the run. For a suite of small, even files, Playwright's own `--shard` with merged reports is enough.

## How we picked

A tool made the list only if it runs Playwright Test itself, through a Playwright reporter, a CLI that wraps the runner, a JUnit upload or a vendor YAML file. Every claim about a tool comes from that vendor's own docs or site. We ran no benchmarks across products and quote no prices, since prices change faster than posts get updated.

We judged only what decides how one Playwright suite spreads across machines. We leave test data and environment setup out of the comparison.

### Playwright's baseline

Playwright already does part of an orchestrator's job, so every tool here has to beat it. `--shard=x/y` splits the suite into shards before the run. Playwright can shard only tests that can run in parallel, which by default means whole test files. In test-level granularity mode, each shard balances the number of individual tests it runs instead, and the docs call that the preferred mode for even load.

Each shard writes its own report. Put the blob reports in one directory (their names carry the shard number, so they don't clash) and merge them into one combined report. Retries are off by default. With them on, a test that fails first and passes on a retry is labeled flaky, and `--last-failed` [reruns only the tests that failed](/posts/playwright-re-run-only-failed-tests).

The baseline's limit is the split itself. Even in test-level granularity mode, each shard attempts to balance the number of individual tests it runs, not how long they take. That is the [load balancing problem behind uneven shards](/posts/optimizing-test-runtime-playwright-sharding-vs-workers#the-load-balancing-problem).

### The five checks

Every entry answers the same five questions:

- Does the tool hand tests to machines from a live queue during the run, or split them before the run starts? If before, does it use timing history or test count? A queue absorbs a slow test when it happens; a split made in advance is only as good as the data behind it.
- Does it split by whole spec file or by individual test? Test-level splits balance counts better, and the cost shows up when tests share expensive setup.
- Do tests run on your own GitHub Actions, GitLab or Jenkins runners, or on the vendor's cloud? GitHub Actions, for example, can create multiple job runs from a single job definition with a matrix strategy, so the question is whether a tool balances work on those jobs or moves the tests somewhere else.
- Can it rerun only the failed tests, and can it move work off a machine that dies mid-run?
- Do the results from every machine end up in one run or report?

The order of the list is a ranking against those checks, for a team that runs Playwright on its own CI. Tools that balance work on the runners you already have come first. Platforms you build or host your runs on follow, and execution clouds that move the tests to the vendor's machines come last.

The granularity trade-off is the one that bites quietly. One team with a two-minute setup step in every describe group asked for sharding that keeps each group on one shard ([#22891](https://github.com/microsoft/playwright/issues/22891)). A maintainer replied that with the file's describe mode set to parallel and each group's set to default, top-level describe groups could be assigned to different shards while the tests inside each group run as usual, on a single shard. The issue was closed as completed. If your suite looks like that, weigh setup cost before you switch on test-level splits.

## Currents

![Currents homepage](/img/posts/best-test-orchestration-platforms-for-playwright-ci/tools/currents-homepage.jpg)

[Currents](https://currents.dev/) hands Playwright tests to your CI machines from a live queue while the run is going. Currents is our product. Instead of fixing each machine's share before the run, [Currents Test Orchestration](https://docs.currents.dev/guides/test-orchestration) keeps a queue of pending tests and assigns them to machines as each one becomes available. A machine that finishes early takes the next pending test.

### On your own runners

Tests run in your existing CI environment. `pwc-p` is the command-line executable that implements Currents Orchestration for Playwright, and the orchestrator client communicates with Currents for task assignments and to report results.

### Whole files, fully parallel

Currents orchestration balances whole test files, not individual tests. With test-level parallelism on, the docs' advice for Fully Parallel Mode is a batch size of 1 and more Playwright workers, so machines balance correctly while a single file's tests still run in parallel across workers.

### Reruns and dying machines

To rerun only the failures of an orchestrated run, `pwc-p discover` with `--last-failed` builds the filtered test list, and `pwc-p run` takes that list through `--pwc-discovery-file`:

```bash
# Build the list of tests that failed in the last attempt
npx pwc-p discover --pwc-discovery-file discovery.json --last-failed
# Orchestrate only that list across the machines
npx pwc-p run --pwc-discovery-file discovery.json
```

[Spot instances](/posts/currents-and-fundguard) are where the queue earns its keep. With the reset-signal option, `pwc-p run` listens for SIGUSR1 or SIGUSR2. When one arrives, `pwc-p run` asks Currents to reassign the affected tests to healthy machines, and the run continues without anyone stepping in. Only tests orchestrated with `pwc-p` can be reassigned this way.

### Balanced Sharding

Balanced Sharding is the middle ground for teams that want to keep their `--shard` jobs. Each shard asks Currents for the recent durations of your spec files and splits the tests so the shards finish at about the same time. A rerun attempt keeps the split of the attempt before it, so a failed test runs again on its own shard.

<AntiPattern title="Shards without a shared build ID" id="anti-pattern-shards-without-a-shared-build-id">

Teams switch on Balanced Sharding and let each shard job start on its own, with nothing tying the jobs together. Without the same CI build ID on every shard, each shard generates its own ID and becomes a separate run, and the one combined run you wanted never appears.

<AntiPattern.Fix>

Make every shard of a build carry the same CI build ID: either the one Currents detects from your CI or an explicit one you set. Check it once by opening a sharded build and confirming it shows up as a single run.

</AntiPattern.Fix>

</AntiPattern>

### Who it fits

Currents fits Playwright teams on their own GitHub Actions, GitLab or Jenkins runners who want a live queue without moving tests to a vendor cloud. A suite dominated by one huge spec file gets less from it, because the file is the unit it balances. Tests stay on your existing CI, and orchestrated runs can rerun only the failed tests. Orchestration can reassign the tests of a machine about to be terminated, and shards that use the same CI build ID report to one combined run. Currents meets all five checks in one tool, on your own CI.

## Knapsack Pro

![Knapsack Pro homepage](/img/posts/best-test-orchestration-platforms-for-playwright-ci/tools/knapsack-pro-homepage.jpg)

[Knapsack Pro](https://knapsackpro.com/) builds a queue of test files sorted by execution time, and each parallel CI node takes work from that queue in batches. Its client is a library you install in the project. The client wraps the test runner you already have and works with your existing CI infrastructure.

![Knapsack Pro dashboard graph of CI node run times for a build](/img/posts/best-test-orchestration-platforms-for-playwright-ci/tools/knapsack-pro-product.jpg)

*Knapsack Pro dashboard graph of CI node run times for a build. Image: [Knapsack Pro](https://docs.knapsackpro.com/overview/).*

For Playwright, the client is the `@knapsack-pro/playwright` package, which uses the Playwright version already installed in your project, so keep `playwright` in your `package.json`. Runs must use Knapsack Pro's batch reporter, `@knapsack-pro/playwright/reporters/batch`, which you can add in `playwright.config.ts`.

Recovery works per node. When you retry one node or all of them, Knapsack Pro runs only the tests that failed last time on that node.

Knapsack Pro fits teams that want a queue on the CI they already run, without changing how tests are written. If one long spec file dominates your suite, look elsewhere: the queue's unit is the test file, so that file still sets the build time.

## Buildkite Test Engine

![Buildkite Test Engine homepage](/img/posts/best-test-orchestration-platforms-for-playwright-ci/tools/buildkite-test-engine-homepage.jpg)

[Buildkite Test Engine](https://buildkite.com/) collects test results from the jobs your pipelines run and gives you tools to track, analyze and act on them. Its client, `bktec`, splits tests using historical timing data and rebalances them automatically.

![Buildkite Test Engine's test splitting setup page](/img/posts/best-test-orchestration-platforms-for-playwright-ci/tools/buildkite-test-engine-product.jpg)

*Buildkite Test Engine's test splitting setup page. Image: [Buildkite Test Engine](https://buildkite.com/docs/pipelines/speed-up-builds-with-bktec).*

Playwright results reach the Test Engine dashboard through a reporter. Add `buildkite-test-collector/playwright/reporter` to Playwright's reporters:

```ts
import { defineConfig } from '@playwright/test';

export default defineConfig({
  reporter: [
    ['line'],
    ['buildkite-test-collector/playwright/reporter'],
  ],
});
```

The `line` reporter keeps readable output in the CI log next to the collector.

The Test Engine Client lists playwright among the test runners it supports. By default, `bktec` v3 splits tests by selector, a unit of work the test runner can execute. The Test Engine Client reads the test result after each test run for retries and verification. Test Engine also accepts results from CI systems other than Buildkite, so the dashboard can sit next to an existing CI setup.

Buildkite Test Engine fits teams that want timing-based splits and one dashboard for test results, even alongside another CI. Its splits come from timing history; Test Engine also lists Test Scheduler, in private preview, so parallel jobs can pick up more work as they finish.

## CircleCI

![CircleCI homepage](/img/posts/best-test-orchestration-platforms-for-playwright-ci/tools/circleci-homepage.jpg)

[CircleCI](https://circleci.com/) hands test atoms to parallel nodes from a shared queue while the job runs, so all nodes finish at about the same time. A test atom is the smallest unit the runner can run on its own, typically a whole test file.

![CircleCI's test summary view of stored test results](/img/posts/best-test-orchestration-platforms-for-playwright-ci/tools/circleci-product.jpg)

*CircleCI's test summary view of stored test results. Image: [CircleCI](https://circleci.com/docs/guides/test/collect-test-data/).*

CircleCI reads the JUnit XML that Playwright writes and uses it to show results and power its testing features. Its test-splitting page describes Playwright as a framework that runs sharded tests out of the box. When you rerun a workflow from failed, `circleci testsuite run` reruns only the failed atoms instead of the whole suite. Parallelism also works on CircleCI's Self-Hosted Runners, given at least two runners in the job's resource class; parallel tasks beyond the active runners queue until one is free.

<AntiPattern title="Reruns on old Playwright" id="anti-pattern-reruns-on-old-playwright">

Teams turn on CircleCI's rerun failed tests while the project still pins a Playwright version older than 1.34.2. Earlier versions may write JUnit XML in a format the feature can't use, so the rerun has nothing reliable to work from.

<AntiPattern.Fix>

Upgrade to Playwright 1.34.2 or later before you rely on rerun failed tests.

</AntiPattern.Fix>

</AntiPattern>

### Who it fits

CircleCI fits teams already building on CircleCI. CircleCI describes Smarter Testing, which includes dynamic test splitting, as its way to run tests on CircleCI Cloud.

## Testkube

![Testkube homepage](/img/posts/best-test-orchestration-platforms-for-playwright-ci/tools/testkube-homepage.jpg)

[Testkube](https://testkube.io/) keeps test runs inside your existing infrastructure, and any CI/CD tool can trigger them. It is a platform for creating, orchestrating, running and analyzing tests, built on an open source core. The Control Plane runs in the cloud or fully on-prem, and the Runners are open source and can run standalone.

For Playwright, Testkube's sharded example spreads tests across a configurable number of nodes and combines each node's report into one report saved as an artifact. Its best-practices page recommends the blob reporter (`--reporter=blob`) for sharded runs and Playwright's `merge-reports` command to combine them.

Testkube creates a separate node for each shard. With dynamic sharding, only a set number of those nodes run at once, which the docs say keeps long-running tests from blocking short ones.

Testkube fits teams that want test runs to live on their own infrastructure, triggered from whichever CI they use. Teams that only want faster jobs on their existing runners take on more platform than they need.

## Harness

![Harness homepage](/img/posts/best-test-orchestration-platforms-for-playwright-ci/tools/harness-homepage.jpg)

[Harness](https://harness.io/) runs existing tests as CI pipeline steps, and for Playwright its AI Test Automation goes further: it runs your existing suite, with its `playwright.config`, spec files and `package.json` scripts, without rewrites or migration.

Point AI Test Automation at the repository, and the suite runs on Harness's managed cloud workers with the config you already have. It splits the suite across 4 shards by default and spreads tests evenly across them, with nothing to configure. Results land in one place, with AI-assisted triage for each failed test.

In Harness CI, you choose a test splitting strategy, such as by number of tests or test timing. Its `split_tests` tool outputs a list of test files based on the splitting strategy you choose. With a timing strategy, the first parallel run divides tests by file size, and later runs split them by timing data from earlier runs.

Harness fits teams already running CI on Harness. Pick something else if tests must stay on your own runners: AI Test Automation runs the suite on Harness's managed cloud workers.

## Azure Pipelines

![Azure Pipelines homepage](/img/posts/best-test-orchestration-platforms-for-playwright-ci/tools/azure-pipelines-homepage.jpg)

[Azure Pipelines](https://microsoft.com/) runs parallel jobs, and its documented approach to parallel testing treats your test files as an array: each job runs the files at its own index positions until every file has run. With six files and two jobs, the first job runs files 0, 2 and 4.

![Playwright screenshot and trace file attached to a test case result in Azure Pipelines](/img/posts/best-test-orchestration-platforms-for-playwright-ci/tools/azure-pipelines-product.jpg)

*Playwright screenshot and trace file attached to a test case result in Azure Pipelines. Image: [Azure Pipelines](https://devblogs.microsoft.com/devops/junit-attachments-support-for-publish-test-results/).*

Playwright's results reach Azure Pipelines as a JUnit file, published with the `PublishTestResults@2` task. With the Playwright version Microsoft's announcement names, screenshots, recordings and trace files can be attached automatically to the test results in Azure Pipelines. Jobs can also run on self-hosted agents that you set up and manage.

The merge setting is the one to get right. With `mergeTestResults` set to true, the task reports the results from all the files against a single test run. If the value is false, the task creates a separate test run for each test result file. Results will always be merged into a single run if there are more than 100 result files, even if this option is set to false. If your sharded test jobs each write a JUnit file under its own name and publish it as an artifact, one final job collects them all and publishes them as one run:

```yaml
jobs:
  - job: publish_results
    dependsOn: test
    condition: succeededOrFailed()
    pool:
      vmImage: ubuntu-latest
    steps:
      - download: current
        patterns: '**/*.xml'
      - task: PublishTestResults@2
        inputs:
          testResultsFormat: JUnit
          testResultsFiles: '$(Pipeline.Workspace)/**/*.xml'
          mergeTestResults: true
          testRunTitle: Playwright
```

The job depends on the sharded test job and runs even when tests fail, so a red build still gets its merged run.

Azure Pipelines fits teams whose builds already run on it. Suites with uneven files should look elsewhere: the documented slicing hands out whole files by index position, so a heavy file lands wherever its index puts it.

## TestMu AI HyperExecute

![TestMu AI HyperExecute homepage](/img/posts/best-test-orchestration-platforms-for-playwright-ci/tools/testmu-ai-hyperexecute-homepage.jpg)

[TestMu AI HyperExecute](https://testmuai.com/) runs existing Playwright suites, and Selenium, Cypress and Appium suites too, on just-in-time VMs from a single YAML file. It is TestMu AI's orchestration and execution cloud.

Its docs include a guide to configuring Playwright runs on the platform. In a GitHub Actions workflow, one step runs the TestMu AI HyperExecute CLI binary with your TestMu AI username, access key and the path of the YAML file, and the CI job starts the run on TestMu AI HyperExecute.

Dynamic allocation hands tests to VMs as each one frees up. The `testDiscovery` option identifies the test files or methods to run.

TestMu AI HyperExecute fits teams that run several frameworks and would rather not keep CI machines for tests. TestMu AI HyperExecute splits the suite across fresh VMs from one YAML value.

## BrowserStack

![BrowserStack homepage](/img/posts/best-test-orchestration-platforms-for-playwright-ci/tools/browserstack-homepage.jpg)

[BrowserStack](https://browserstack.com/) runs Playwright tests on its own infrastructure, in parallel across OS and browser combinations, and shows the results on the Automate dashboard.

![BrowserStack's build optimization widget for Smart Test Selection](/img/posts/best-test-orchestration-platforms-for-playwright-ci/tools/browserstack-product.jpg)

*BrowserStack's build optimization widget for Smart Test Selection. Image: [BrowserStack](https://www.browserstack.com/docs/automate/playwright/smart-test-selection).*

Smart Test Selection works for both CI/CD and local runs through the BrowserStack SDK. Smart Test Selection uses AI to identify and run tests impacted by recent code changes.

Test Reporting & Analytics can merge reports into a single report through environment variables. BrowserStack's Selenium docs describe an Automate test orchestration strategy that reruns only the tests that failed in the previous build.

A change-based subset skips tests by design. Keep a full run on a schedule next to it, so a test the selection skipped still runs somewhere.

BrowserStack fits teams whose main need is OS and browser coverage and who want Smart Test Selection to cut each run down to the tests a change affects, in CI and in local runs.

## Sauce Labs

![Sauce Labs homepage](/img/posts/best-test-orchestration-platforms-for-playwright-ci/tools/sauce-labs-homepage.jpg)

[Sauce Labs](https://saucelabs.com/) runs Playwright tests remotely on Sauce Labs Cloud through the `saucectl` CLI. In saucectl's architecture, the device cloud allocates a device for your request, retrieves the payload from app storage, and runs the tests.

The main route is the `saucectl` CLI. Teams that would rather stay inside Playwright can use the Playwright Sauce Labs Reporter instead.

In Sauce Labs' Playwright configuration, the `shard` option splits a suite by spec file or by concurrency. The concurrency setting caps how many suites run at once, and suites beyond the cap queue and run in order as others complete. Sauce Labs' smart retry has a setting that, when set to true, retries only the tests that failed during the previous attempt.

That queue works on suites, not tests. Keep suites small enough that no single one holds a slot long after the others finish.

Sauce Labs fits teams that want their suite sharded by spec file or by concurrency on a cloud they don't maintain, with retries limited to the tests that failed. Pick something else if tests must run on your own CI runners: Sauce Labs runs them on its device cloud.

## At a glance

Best for is our call; every other cell comes from that tool's vendor's own pages. Distribution model and split unit aren't columns, because How to choose sorts the tools by them.

| Tool | How it works with Playwright | Where tests run | Best for |
|---|---|---|---|
| Currents | `pwc-p run` orchestrates the tests across CI machines | Your existing CI | Playwright teams on their own runners that need a live queue |
| Knapsack Pro | The `@knapsack-pro/playwright` package plus its batch reporter in `playwright.config.ts` | Your existing CI infrastructure | A queue of test files, consumed in batches by each CI node |
| Buildkite Test Engine | The `buildkite-test-collector/playwright/reporter` reporter | Your pipeline jobs; results also accepted from non-Buildkite CI | Timing-based test splits with automatic re-balancing |
| CircleCI | Reads the JUnit XML Playwright writes | CircleCI, including Self-Hosted Runners | Teams already building on CircleCI |
| Testkube | Sharded Playwright example that combines node reports into one artifact | Your own infrastructure, cloud or on-prem | Test runs owned by your infrastructure, triggered from any CI |
| Harness | AI Test Automation runs your existing suite and config | Harness's managed cloud workers (AI Test Automation) | Teams already running CI on Harness |
| Azure Pipelines | JUnit file published with `PublishTestResults@2` | Agents, including self-hosted agents you set up to run jobs and manage yourself | Teams already on Azure Pipelines |
| TestMu AI HyperExecute | One YAML file, started from CI with its CLI | Fresh VMs it provides | Several frameworks and no CI machines of your own for tests |
| BrowserStack | The BrowserStack SDK | BrowserStack's infrastructure | OS and browser coverage |
| Sauce Labs | The `saucectl` CLI | Sauce Labs' device cloud | Spec or concurrency sharding on a vendor cloud |

## How to choose

Start from where your tests run and what has to happen when something breaks. If your Playwright team runs on its own CI runners, start with Currents: its orchestrator keeps a live queue of pending tests and assigns them to machines as they become available, and the tests run on [your existing environment](https://docs.currents.dev/guides/test-orchestration). Orchestrated runs can rerun only failed tests with `pwc-p discover` and `--last-failed`. Currents Orchestration can automatically reassign the tests from a to-be-terminated instance to another machine.

CircleCI's dynamic test splitting distributes test atoms from a shared queue across parallel nodes as the job runs. Knapsack Pro creates a queue of test files that each parallel CI node consumes in batches, and TestMu AI HyperExecute hands tests to VMs as they free up. Buildkite's `bktec` splits tests automatically based on your historical timing data, and with a timing strategy Harness CI divides the first parallel run by file size, then uses timing data from earlier runs to split tests by time. With `fullyParallel: true`, Playwright's sharding gives each shard an even distribution of tests, and Azure Pipelines' documented slicing assigns files by index.

### By setup

- If you already build on CircleCI, Azure Pipelines or Harness, use that CI's splitting before you add another tool.
- If you want timing-based splits and a dashboard that also accepts results from non-Buildkite CI systems, pick Buildkite Test Engine.
- If you want a file queue that wraps the runner you have, pick Knapsack Pro.
- If you have no runner fleet, or you run several frameworks, pick TestMu AI HyperExecute.
- If you need OS and browser coverage and want each run cut down to the tests a change affects, pick BrowserStack for Smart Test Selection.
- If you want the suite sharded by spec file or by concurrency, with smart retries that rerun only the tests that failed in the previous attempt, pick Sauce Labs.
- If test runs must live on your own infrastructure and start from any CI, pick Testkube.

### One long file

Queues stop helping when a single spec file is the bottleneck. Currents orchestration balances test files rather than individual tests, and Knapsack Pro's queue is a queue of test files. Split the long file, or turn on test-level parallelism so its tests spread across workers, before you pay for more machines.

### When built-in sharding is enough

Built-in sharding with blob reports and merged reports is enough when your files are small and even, test-level granularity is on, and a few shards run in a GitHub Actions matrix. The matrix option runs a separate job for every possible combination of the provided options. Add `--last-failed` for reruns. Once shards finish far apart run after run, or a dead runner costs you a whole rerun, [native CI has hit its ceiling](/posts/playwright-ci-at-scale-github-gitlab#when-native-ci-hits-its-ceiling) and a queue earns its place.

<AntiPattern title="Static shards over uneven files" id="anti-pattern-static-shards-over-uneven-files">

Teams pick a shard count, wire it into a matrix and leave the default file-level split in place. With uneven files, certain shards may end up running significantly more tests, while others may run fewer or even none.

```yaml
# Anti-pattern: fixed shards split by whole file, so one heavy file pins one shard
name: Playwright
on: [push]
jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        shard: [1, 2, 3, 4]
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: lts/*
      - run: npm ci
      - run: npx playwright install --with-deps
      - run: npx playwright test --shard=${{ matrix.shard }}/4
```

<AntiPattern.Fix>

Turn on test-level granularity, so each shard balances individual tests instead of files:

```ts
import { defineConfig } from '@playwright/test';

export default defineConfig({
  // Test-level granularity: shards balance individual tests, not whole files
  fullyParallel: true,
});
```

Then have every shard write a blob report, and merge the reports in a final job:

```yaml
name: Playwright
on: [push]
jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        shardIndex: [1, 2, 3, 4]
        shardTotal: [4]
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: lts/*
      - run: npm ci
      - run: npx playwright install --with-deps
      - run: npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --reporter=blob
      - uses: actions/upload-artifact@v4
        if: ${{ !cancelled() }}
        with:
          name: blob-report-${{ matrix.shardIndex }}
          path: blob-report
          retention-days: 1

  merge-reports:
    if: ${{ !cancelled() }}
    needs: [test]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: lts/*
      - run: npm ci
      - uses: actions/download-artifact@v4
        with:
          path: all-blob-reports
          pattern: blob-report-*
          merge-multiple: true
      - run: npx playwright merge-reports --reporter html ./all-blob-reports
      - uses: actions/upload-artifact@v4
        with:
          name: html-report
          path: playwright-report
          retention-days: 14
```

Keep the merge input clean on any runner that reuses its workspace between runs. Someone reported that the blob reporter no longer clears its output directory, so merge-reports can pick up stale reports ([#43161](https://github.com/microsoft/playwright/issues/43161)). The report adds that changing the shard count between runs leaves the old run's report behind. A maintainer replied that this is the new intended behavior. Delete old blob reports before each shard runs, and the merge directory before each merge.

When a run fails, rerun only the failures instead of the whole suite:

```bash
npx playwright test --last-failed
```

</AntiPattern.Fix>

</AntiPattern>

## Frequently asked questions


### What are the best test orchestration platforms?

If your Playwright team runs on its own CI runners, start with Currents: its orchestrator keeps a live queue of pending tests and assigns them to machines as they become available, and the tests run on your existing environment. If you already build on CircleCI, Azure Pipelines or Harness, use that CI's splitting before you add another tool.


### What is test orchestration?

An orchestration platform decides which machine runs which test, and what happens when something breaks. A CI server, a browser cloud and a test-selection tool solve different problems, so ranking them side by side tells a Playwright team little. The article ranks tools against [the five checks](#the-five-checks) instead.


### How does Playwright sharding work?

`--shard=x/y` splits the suite into shards before the run, and Playwright can shard only tests that can run in parallel, which by default means whole test files. In test-level granularity mode, each shard balances the number of individual tests it runs instead, and the docs call that the preferred mode for even load, as [Playwright's baseline](#playwrights-baseline) explains.


### Why are my Playwright shards uneven?

With the default file-level split and uneven files, certain shards may end up running significantly more tests, while others may run fewer or even none. Turn on test-level granularity with `fullyParallel: true`, so each shard balances individual tests instead of files, as [the static shards anti-pattern](#anti-pattern-static-shards-over-uneven-files) shows.


### How do I merge Playwright reports from multiple shards?

Have every shard write a blob report, and merge the reports in a final job with `merge-reports`. Keep the merge input clean on any runner that reuses its workspace between runs: delete old blob reports before each shard runs, and the merge directory before each merge, as [the static shards anti-pattern](#anti-pattern-static-shards-over-uneven-files) shows.


### How do I rerun only failed Playwright tests?

Use `--last-failed`, which reruns only the tests that failed.


### When is Playwright's built-in sharding enough?

Built-in sharding with blob reports and merged reports is enough when your files are small and even, test-level granularity is on, and a few shards run in a GitHub Actions matrix. Once shards finish far apart run after run, or a dead runner costs you a whole rerun, a queue earns its place, as [When built-in sharding is enough](#when-built-in-sharding-is-enough) explains.




---

## About the author

**Walter Galvão**, Software Engineer. Walter Galvão is a software engineer at Currents. He writes about Playwright in practice: debugging flaky tests, structuring suites for CI, and the engineering workflows that keep large test suites reliable.

LinkedIn: https://www.linkedin.com/in/waltergalvao/
