Inspecting a test
Get the current state of a single test by ID:Step-by-step results
test steps returns the cumulative execution log for a test — every step from every run, in order:
--run-id:
--page-size and --max-items for large histories.
Steps logged before run IDs were tracked are excluded when you supply
--run-id. If you need those older entries, query without the flag.The latest result
test result returns the outcome of the most recent completed run for a test:
--include-analysis to attach the AI triage block — root-cause hypothesis, recommended fix target, failure kind, and the snapshot ID that ties all artifacts together:
For backend tests, the result also surfaces the run’s captured stdout (
apiOutput) and Python traceback (trace) — full content under --output json (and inside failure bundles as result.json / failure.json); text mode prints a bounded 20-line tail of each.Run history
Pass--history to list prior runs instead of the latest result:
Triaging a failure
When a test is failed, start with the one-screen triage card:snapshotId. See Failure Bundle for the full contents.
Add --failed-only to keep only the failing step and its neighbors (±1), trimming the bundle for faster agent context loading:
Pinning to a specific run
test failure get always returns the latest failing run for a test — that pointer moves if a new run comes in. When multiple runs might be in flight simultaneously, pin to an exact run with test artifact get:
./.testsprite/runs/<run-id>/. The parent directory must exist before you run the command.
Reading test code
Print the generated test code to stdout:codeVersion token — useful if you plan to update the code with testsprite test code put and want protection against overwriting a concurrent edit.
Where to Go Next
Running Tests
Trigger runs, wait for verdicts, and understand exit codes
Rerun & Auto-Heal
Replay a test cheaply or let AI repair UI drift
Key Terms
runId, codeVersion, snapshotId, and the rest of the vocabulary
Command Reference
Full flag listing for every CLI command