Trigger a run
Pass a test ID to kick off a run immediately:--wait, the command returns as soon as the run is accepted by the backend — exit 0. You get a runId you can use later:
testsprite test wait <run-id> whenever you’re ready.
Wait for the verdict
Add--wait to block until the run reaches a terminal status:
--timeout <seconds> (range 1–3600, default 600):
--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:
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:
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 annotationsRun status and exit codes
Everytest 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.The dashboard link
When a run completes, the CLI prints adashboard: 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.
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