Skip to main content

What rerun does

Rerun re-executes an existing test with no new plan generation. It is the main iteration loop: fix code, rerun, read the verdict, repeat. A fresh test run instead replays the saved script when it has current saved code, and otherwise lets the agent run the test. A --local run always uses the agent.

Rerunning a test

This uses the Default environment; add --env <name> for another (an unknown name fails, never falls back). Saved scripts can contain hard-coded URLs that an environment URL change does not rewrite; see Environments. A loopback environment opens a tunnel automatically (rerun has no --local flag; see Environments). Without --wait the command returns once the rerun is accepted; with it, it blocks until a terminal status, using the same exit codes as test run --wait.

Rerunning many

Backend dependency closure

A backend rerun expands to the producers (tests whose --produces variable the test --needs), the test itself, and teardown tests (--category teardown in the project), so it never runs against stale upstream state. To rerun only the named test:
--skip-dependencies can make a backend test fail if it relies on data a producer creates. Use it only when the fixtures are already in place.

Auto-heal

When the UI has shifted since the test was written (a button renamed, a form gained a field), the verbatim script fails even though the feature works. Auto-heal detects the drift and repairs the script so the test passes; if the feature itself is broken, the test stays failed. When a step is repaired, the new version replaces the saved one. It is on by default for every frontend CLI rerun on every plan, and ignored for backend tests, whose failures are almost always real assertion or fixture issues. Opt out to replay the saved script exactly:
For a deterministic regression gate, use --no-auto-heal or test flaky (which always replays without healing). A strict replay of a test with no saved code can be refused instead of started.
Minor UI refactors that moved or renamed things: a relabeled button, a sidebar collapsed into a menu, a custom dropdown replaced by a design-system component. The saved script refers to stale selectors or text, and auto-heal re-binds the test to the new UI.
A real product bug: the form rejects valid input, an API returns 500, the redirect lands on the wrong page. Recovery fails and the test stays failed. Pull the failure bundle (testsprite test failure get <test-id>) to see what broke.

Credits

A rerun is billed the same as a fresh run, whether or not auto-heal repairs a step; there is no discounted replay tier. Check current costs with testsprite usage. With insufficient credits the command exits 12; top up under Workspace Settings → Billing → Usage in the Portal. See Exit Codes.

Where to Go Next

Running Tests

Fresh runs, --target-url, and exit codes

Reading Results

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