ExampleYour test suite has 500 E2E tests.
Note: Pricing is based on GitHub’s official Actions runner pricingfor GitHub-hosted runners:
- A full run takes 1 hour
- 50 tests fail and take about 6 minutes to run
| Scenario | Full suite rerun time | Failed only rerun time | Time saved | Cost saved on Linux | Cost saved on Windows | Cost saved on macOS |
|---|---|---|---|---|---|---|
| Per rerun | 60 min | 6 min | 54 min | $0.324 | $0.54 | $3.348 |
| Per day (10 reruns) | 600 min | 60 min | 540 min (9 hrs) | $3.24 | $5.40 | $33.48 |
| Per 30-day month (10 reruns daily) | 18,000 min | 1,800 min | 16,200 min (270 hrs) | $97.20 | $162.00 | $1,004.40 |
- Linux (2-core): $0.006 per minute
- Windows (2-core): $0.010 per minute
- macOS: $0.062 per minute
Quick Reference
| Task | Command/Action | Link |
|---|---|---|
| Run full test suite | npx playwright test | - |
| Cache failed test metadata | npx tdpw cache | Setting up cache |
| Get last failed tests | npx tdpw last-failed | How it works |
| Re-run detection | Check github.run_attempt | Workflow logic |
| Upload HTML report | actions/upload-artifact@v4 | Quick start |
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:
| Condition | Behavior |
|---|---|
run_attempt = 1 | Run full test suite |
run_attempt > 1, flags found | Run failed tests only |
run_attempt > 1, no flags | Run full test suite (fallback) |
Playwright 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?
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.
This is the main job that executes Playwright and sharding.

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
Identify the failed tests
Scroll to the end of the Playwright output. GitHub Actions show:
- Total failed test count
-
Failed test titles
Confirm caching
Open the Cache failed test metadata step. Look for:This confirms TestDino stored the failure metadata.

Example: Sharded test execution
Example: Sharded test execution
First run: 12 tests across 3 shards. Two shards fail.
Re-run comparison:Re-runs all tests in failed shards, including tests that already passed.
| Shard | Tests | Result |
|---|---|---|
| Shard 1 | 4 tests | 2 Passed, 2 Failed |
| Shard 2 | 4 tests | Passed |
| Shard 3 | 4 tests | 3 Passed, 1 Failed |
- 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 overview, GitHub Actions, status checks, and flaky tests.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

