Skip to main content

What rerun does

Rerun re-executes a test using what’s already saved — no new plan generation, no new code generation.
Test typeWhat rerun executes
Frontend testsReplay the saved Playwright script verbatim against the live app. No cloud credits are charged for a clean verbatim replay.
Backend testsRe-run the full dependency closure: producers first, then the named test, then teardown — in the correct wave order.
This makes rerun the primary iteration loop once a test exists: fix code, rerun, read the verdict, repeat.

Rerunning a test

testsprite test rerun test_3a9f21c7 --wait
Without --wait, the command returns once the rerun is accepted. With --wait, it blocks until passed, failed, blocked, or cancelled — same exit codes as test run --wait. Control the polling ceiling:
testsprite test rerun test_3a9f21c7 --wait --timeout 300

Rerunning many

Rerun every test in a project at once:
testsprite test rerun --all --project proj_8f0f6 --wait
Useful flags for batch rerun:
FlagDescription
--skip-terminalSkip tests that are already in a terminal state (passed, failed, blocked, cancelled)
--status <list>Only rerun tests matching these statuses (comma-separated)
--filter <substr>Case-insensitive name substring filter
--max-concurrency <n>Max simultaneous reruns (1–100, default 50)
Example — rerun only the tests that failed, filtered to the checkout group:
testsprite test rerun --all --project proj_8f0f6 \
  --status failed --filter "checkout" --wait

Backend dependency closure

When you rerun a backend test, the CLI expands the run to include:
  1. Producer tests — any test that --produces a variable the named test --needs.
  2. The named test itself.
  3. Teardown tests — any test tagged --category teardown in the same project.
This ensures the test runs in a valid environment, not against stale or missing upstream state. To skip the expansion and rerun just the named test in isolation:
testsprite test rerun test_3a9f21c7 --skip-dependencies --wait
Important: --skip-dependencies can cause a backend test to fail if it relies on data created by a producer test. Use it only when you know the required fixtures are already in place.

Auto-heal

Auto-heal is on by default for every frontend rerun, on every plan tier, when triggered through the CLI. When your app’s UI has shifted since the test was last written — a button was renamed, a form gained an extra field, navigation was restructured — the verbatim script would fail even though the underlying feature still works. Auto-heal detects that drift and repairs the script so the test passes. If the feature itself is broken, the test stays failed.
Auto-heal is on by default for all CLI reruns. It consumes a small amount of credit only when healing actually repairs a step — a clean verbatim replay that passes is free. Opt out with --no-auto-heal. See Billing & Plans for current rates.
To opt out for a specific rerun:
testsprite test rerun test_3a9f21c7 --wait --no-auto-heal
Auto-heal is ignored for backend tests — backend test failures are almost always real assertion or fixture issues, not UI drift.
Minor UI refactors that moved or renamed things. A button relabeled from “Continue” to “Next”, a sidebar collapsed into a hamburger menu, a custom dropdown replaced with a design-system component. The feature still works; the saved script just refers to stale selectors or text. Auto-heal re-binds the test to the new UI in context and marks it passed.
A real product bug. The form rejects valid input, an API returns 500, the redirect lands on the wrong page. Auto-heal will attempt recovery and fail — the test stays failed. This is the correct outcome: auto-heal absorbs UI drift; it does not mask genuine regressions. Pull the failure bundle (testsprite test failure get <test-id>) to triage what actually broke.

Credits

ActionCost
Fresh test run (frontend)Charged per run
Fresh test run (backend)Free
test rerun — verbatim replay passesFree
test rerun — auto-heal engagesa small amount of credit
test rerun — backend closureFree
When your credit balance is insufficient, the command exits with code 12. Top up credits in the Portal under Settings → Billing.

Exit Codes

See the full list of exit codes and what each one means.

Where to Go Next

Running Tests

Trigger fresh runs, override the target URL, and understand the full exit-code table

Reading Results

Pull failure bundles, step logs, and run history after a rerun

Exit Codes

Exit 12 and everything else the CLI can emit

Agent Integration

Wire the rerun loop into your coding agent’s verify-fix cycle