How It Works
-
Run the full suite.
npx playwright testexecutes all tests. -
Cache results.
npx tdpw cachereads Playwright’s report and stores pass/fail metadata in TestDino (branch/commit aware, shard aware). -
Rerun failures.
npx tdpw last-failedreturns the exact tests that failed last time. Pass that list to Playwright to run only those tests.
TestDino caching survives new runners, works across shards and jobs, and can be triggered from separate workflows.
Requirements
- Playwright installed and working in CI
- TestDino CLI (
tdpw) available vianpx - TestDino API token stored as a GitHub secret (e.g.,
TESTDINO_TOKEN) - TestDino GitHub App for automated uploads/comments (optional but recommended)
Sample GitHub Actions Workflow
1. Full run & cache (playwright-tests.yml)
Runs on push; always caches results immediately after tests.
This workflow runs the entire test suite and records the results to establish a baseline.
.github/workflows/test.yml
Place
tdpw cache immediately after npx playwright test, guarded by if: always().2. Rerun failed only (rerun-failed-tests.yml)
Triggered manually; fetches failures, then runs only those tests.
This workflow executes only the tests that failed during the main run.
.github/workflows/test.yml
Example Scenario
A pull request triggers a full CI run with 50 tests, taking 10 minutes. 47 tests pass, but 3 fail in login.spec.ts, cart.spec.ts, and checkout.spec.ts due to a temporary network issue. Instead of running all 50 tests again, trigger a targeted rerun. The second run executes only those 3 failed tests, completing in under a minute and confirming the issue is resolved.General Rules
1. After the tests run
1. After the tests run
2. Before a rerun
2. Before a rerun
3. Authentication
3. Authentication
Pass
--token with each command or set TESTDINO_TOKEN as an environment variable.4. Branch and commit overrides (optional)
4. Branch and commit overrides (optional)
5. How rerun output works
5. How rerun output works
The command returns output formatted for direct use with Playwright:Pass it directly to
npx playwright test for selective reruns.6. Artifacts
6. Artifacts
Continue uploading Playwright reports alongside caching for screenshots, videos, and traces.
Two-Part Workflow
The workflow operates in two stages:-
Run & Save: The
playwright-tests.ymlworkflow runs on every code push. It executes all tests to establish a quality baseline and usestdpw cacheto save failures to TestDino. -
Fetch & Rerun: If the main run has failures, manually trigger the
rerun-failed-tests.ymlworkflow. It retrieves what failed previously and runs only those tests for a quick verification.