Skip to main content

Trigger a run

Pass a test ID to kick off a run immediately:
Without --wait, the command returns as soon as the run is accepted by the backend — exit 0. You get a runId you can use later:
The test starts executing in the cloud. Come back to it with testsprite test wait <run-id> whenever you’re ready.

Wait for the verdict

Add --wait to block until the run reaches a terminal status:
Control how long the CLI polls before giving up with --timeout <seconds> (range 1–3600, default 600):
Exit codes when --wait is used:
A timeout doesn’t cost you the runId: even on exit 7, the CLI prints a partial object ({ "runId": "...", "status": "running" }) to stdout before exiting, so a script can grab the ID and resume without having captured it earlier.

Resuming a run

If a run times out or you triggered it without --wait, resume polling with the run ID:
test wait accepts the same --timeout flag and emits the same exit codes as test run --wait. When a terminal status arrives, you see the run card:

Interrupting a wait vs cancelling the run

Ctrl-C during any --wait only detaches the CLI — the run keeps executing (and billing) on the server. The CLI exits 130 after printing the partial { "runId": "...", "status": "running" } plus a re-attach hint and a cancel hint, so nothing is lost. To actually stop the run server-side:
The run flips to cancelled, the test is immediately re-runnable, and the test’s last verdict is untouched. Already-charged credits are not refunded.

Cancelling a Run

Detach vs cancel, idempotent re-cancel, multi-id summaries, and the CI cleanup pattern

Overriding the target URL

By default the run hits the URL stored on the project. Override it for a single run with --target-url:
The URL must be a public http(s) address; localhost and private IPs are rejected before any network call (exit 5).

Common Issues

What to check if a URL is rejected
Testing against a localhost target requires the MCP Server and its built-in tunnel, not the CLI. The CLI is designed for cloud-accessible environments and CI.

Running a whole suite

Run every test in a project in a single wave-ordered batch:
--all requires --project. It triggers every test in the project (each billed like any run) and respects dependency waves derived from --produces / --needs annotations set at backend test-creation time — producer tests run before the consumers that depend on their output variables, with teardown tests last.

Creating Tests

How to declare --produces / --needs annotations
Narrow the batch with a name substring filter:
Control how many runs execute simultaneously:
--all runs every test in the project in wave order. A project holds a single type of test — frontend or backend, set by --type at project create — so don’t mix both in one project. For backend projects, producers run first and teardown tests last, so dependencies are always satisfied. If a batch is served by the legacy backend-only engine, frontend tests come back in skippedFrontend with an advisory — trigger those individually with testsprite test run <test-id>.

Run status and exit codes

Every test run and test wait exits with a code your script or agent can branch on:

Exit Codes

The full exit-code table, including codes for other commands
Exit 6 means a run is already in flight for this test. Wait for it to finish (or use testsprite test wait <run-id>) before triggering another.
When a run completes, the CLI prints a dashboard: line in text mode and includes dashboardUrl in JSON output (when available). That link deep-dives directly into the Portal run view — steps, video recording, analysis, and the full failure bundle — without any manual navigation.
The dashboardUrl is absent under --dry-run.

Where to Go Next

Reading Results

Inspect steps, pull failure bundles, and navigate run history

Rerun & Auto-Heal

Replay a saved script cheaply, or let AI repair UI drift automatically

Exit Codes

Complete exit-code reference for scripts and CI pipelines

CI/CD Integration

Wire the CLI into GitHub Actions or any pipeline