InfoExampleYour test suite has 500 E2E tests.
- A full run takes 1 hour
- 50 tests fail and take about 6 minutes to run
Note: Pricing is based on GitHub’s official Actions runner pricingfor GitHub-hosted runners:
- Linux (2-core): $0.006 per minute
- Windows (2-core): $0.010 per minute
- macOS: $0.062 per minute
Quick Reference
How it works
Two CLI commands power this workflow:npx tdpw cachestores failed test metadata after a runnpx tdpw last-failedreturns Playwright arguments for the last failed tests
github.run_attempt:
NotePlaywright compatibility: Since
@playwright/test@1.50+, Playwright has native --last-failed support. TestDino extends this with cross-runner caching, shard awareness, and workflow-level persistence.Quick start
Add this logic to your Playwright step:cache step runs with the if: always() condition, so failures are recorded even when tests fail.
How to re-run failed tests in GitHub Actions?
1
Open the failed job
In the GitHub Actions run, find the failed job for Playwright:
- Go to your GitHub repository’s Actions tab.
- Select the failed workflow run.
- Under Jobs, open the job where Playwright tests get executed & fail.
NoteThis is the main job that executes Playwright and sharding.

2
Check the run attempt
Inside the job, open the Playwright execution step. In the logs, you can see:
-
GitHub run attempt: <number> -
Re-run detection output
3
Identify the failed tests
Scroll to the end of the Playwright output. GitHub Actions show:
- Total failed test count
-
Failed test titles
4
Confirm caching
Open the Cache failed test metadata step. Look for:This confirms TestDino stored the failure metadata.

5
Confirm Re-run
Re-run the failed pipeline and confirm the execution of only the last failed tests.
-
The workflow detects
run_attempt > 1 -
tdpw last-failedretrieves the failed tests -
Only those tests are executed
Example: Sharded test execution
Example: Sharded test execution
First run: 12 tests across 3 shards. Two shards fail.Re-runs all tests in failed shards, including tests that already passed.
Re-run comparison:
- Without TestDino
- With TestDino
Full workflow
For a complete workflow with sharding and report merging, see the example repository.View full workflow YAML
View full workflow YAML
File name:
.github/workflows/playwright.ymlRepository: github.com/testdino-hq/playwright-sample-tests-javascriptHow the workflow logic works
The workflow uses a conditional check based ongithub.run_attempt:
- On the first attempt (
run_attempt == 1), the full shard is executed. - On subsequent attempts, the workflow attempts to re-run only previously failed tests.
What `last-failed` returns
What `last-failed` returns
The These flags can be passed directly to
tdpw last-failed command outputs test filters formatted for Playwright:npx playwright test.Why `eval` is used
Why `eval` is used
The command uses This keeps the
eval to handle quoted arguments in the test filter:-g "pattern" quoting intact when passed to Playwright.Edge cases
Pipeline fails before tests run
Pipeline fails before tests run
If a job fails during dependency installation or setup, no test metadata exists.On re-run:And then, it will run the normal execution:
tdpw last-failedreturns nothing- The workflow detects the empty result
- The job runs the full shard
Skipped tests due to `--max-failures`
Skipped tests due to `--max-failures`
Playwright’s Playwright stops after 2 failures. Tests that did not run are not recorded.On re-run, only the failed tests execute. Skipped tests are not included as of now.
--max-failures option stops test execution after N failures. For example:Related
CI Optimization Overview
CI optimization strategies for Playwright
GitHub Actions
Set up Playwright tests in GitHub Actions
GitHub Status Checks
Configure PR status checks
Flaky Tests
Detect and fix flaky tests