This feature may change or be removed in a future version.
Some checks are easy for a person and awkward in code: "the table columns line up", "the error message is helpful", "nothing overlaps in the sidebar". verify hands such a check to a coding agent.
await term.verify("the table is aligned and the header row is bold");testingterm starts an agent over the Agent Client Protocol: Claude Code if it is installed, otherwise Codex, each with its own sign in. The agent gets:
- the statement to check
- where in your script the check is (file, line and the surrounding code) and the steps the test took so far
- the current screen
- the testingterm commands to inspect the terminal:
screen,screen --styles,screenshot(which it can look at),scrollback
It reports pass or fail with a one sentence reason. A failed check throws, with the agent's reason, a screenshot and a notes file with the agent's transcript.
Options
const result = await term.verify("the progress bar reaches 100%", {
agent: "claude",
model: "sonnet",
effort: "low",
interact: true,
timeout: 120_000,
soft: true,
});
// result: { pass, reason, agent, durationMs, artifacts, error? }| Option | Default | What it does |
|---|---|---|
agent |
Claude Code, else Codex | "claude", "codex", or any ACP agent as { command, args, env } |
model, effort |
the agent's default | Passed to the agent if it supports them |
interact |
false |
Allow pressing keys, typing and clicking, not only looking |
timeout |
180000 |
Milliseconds before giving up |
artifacts |
true |
Save a screenshot and notes on failure |
soft |
false |
Return the result instead of throwing |
error is set when the agent could not run or never reported a result, so you can tell "the statement is false" apart from "the check didn't happen".
From the CLI
$ testingterm verify "the menu lists three items"
pass (claude, 12s): The menu shows Open project, Run tests and Deploy.
$ testingterm verify --agent codex --interact "pressing Enter opens the project"Exit codes: 0 pass, 1 fail, 2 the agent could not run.
Safety
The agent is only allowed to run testingterm commands and to read files; other tool requests are refused. It is told not to edit files.
Tips
- Prefer plain assertions whenever you can; they are faster, free and deterministic. A check takes 10 to 30 seconds.
- Write statements a person could verify by looking: concrete, about the screen, one thing at a time.