For the complete documentation index, see llms.txt. This page is also available as Markdown.

Sharded runs

How to set up failed test reruns for sharded Playwright runs on GitHub Actions

When using native Playwright --shard parallelism, the Last Failed GitHub Action can fetch and rerun failed tests from the last workflow run.

Step-by-step guide:

Add the currents-dev/playwright-last-failed step

Add a step to the workflow before the test step runs.

- name: Playwright Last Failed action
  id: last-failed-action
  uses: currents-dev/playwright-last-failed@v2
  with:
    pw-output-dir: basic/test-results
    matrix-index: ${{ matrix.shard }}
    matrix-total: ${{ strategy.job-total }}

See the action configuration for details.

A full example

For a workflow with a custom CI build ID, see Custom CI Build ID for Reruns.

Full examples:

  • rerun-shards-pwc.yml - rerun only the tests that failed in the previous run, using the pwc helper command from @currents/playwright.

  • rerun-shards-reporter.yml - rerun only the tests that failed in the previous run, using reporter setup in playwright.config.ts.

Last updated

Was this helpful?