e2e CLI, and the JSON report.
e2e mcp also gives it a live session on the app to inspect controls before
writing a test. e2e init installs the skill and registers the MCP server.
The skill
SKILL.md is the entry point: the mental model, a sample test, the rules,
and the list of topics. An agent reads a topic file only when it needs it.
Re-running init after an upgrade refreshes the copies.
Without init, npx skills add tester-army/e2e installs the skill from the
repository, and npx --no-install e2e guide [topic] prints it from the
installed package.
init does not touch AGENTS.md, CLAUDE.md, or Cursor rules. Agents that
load skills on demand find this one by its frontmatter description. For an
always-on pointer, one line in the project’s instructions file is enough:
AGENTS.md
How an agent looks at the app
e2e mcp serves a live session on one target. Its catalog includes the
engine’s action tools and locate, which tries a screen.* locator and
returns the call to write when exactly one node matches. The server exposes
open_session, tools, call, and close_session; call dispatches to the
session’s catalog by name.
init registers the server in .mcp.json for Claude Code and
.cursor/mcp.json for Cursor. To register it with Claude Code by hand:
How an agent writes a test
The skill tells an agent to look before it writes: reade2e.config.ts for
the tests glob, targets, and credentials, then an existing test for the
project’s conventions. Then it writes deterministic steps first and reaches
for the agent only where the flow varies.
tests/checkout.e2e.ts
npx --no-install e2e, nevernpx e2e. The bare form fetches whatever package is callede2eon npm when the runner is not installed locally.- One
agent.actper goal, followed by anexpect. The assertion makes the step’s cache entry eligible for replay, and it is what fails when the agent did the wrong thing. - No sleeps. Locators poll, actions wait for their target, and
expectretries until its timeout. - Secrets through
credentials.user(name), declared in the config, never literal in a test.
How an agent runs it
agent
without a model raises MODEL_UNAVAILABLE after the engine attempt starts.
A custom executor can implement agent.act and agent.assert without a
model. agent.waitFor and agent.extract still need a configured model when
they request a judgment. Provider credentials are needed only when a model
request is made. Check model configuration when the error reports a missing
model. For other exit-code-2 failures, follow the reported CLI, config, or
collection error.
The exit code says which side failed. 1 is a test. 2 is the CLI, config, or
collection, and retrying it changes nothing. 3 is the engine, the app
process, or the model provider.
How an agent reads the result
Every run writes.e2e/report.json. --reporter json prints the same
document on stdout for an agent that would rather parse than open a file.
run.errors[] first, because a
run-level failure means no test result is meaningful. Then the error of the
last attempt of each failed result, and the artifacts[] beside it; the
screenshot usually says more than the message. steps[] shows how far the
test got. For an agent step that went wrong, --debug adds the transcript as
an artifact and --ai-trace writes a trace the unbox-ai CLI summarizes.
Nothing should read .e2e/ai-trace.json directly; it is megabytes of resent
context.
How an agent treats the cache
Each passingagent.act records its actions under .e2e/cache/ and the next
run replays them. For a coding agent this means three things:
- A test is not proven until it passes with the cache off. Run
--no-cacheonce before declaring done, and whenever the failure might be the recording rather than the app. - Never edit a cache entry. A failing run evicts the entries it implicates.
--no-cachealso makes--ai-tracecomplete, since replayed steps make no model calls to trace.
The bar the skill is written to
An agent given only the skill, a project thatinit scaffolded, and a target
it can reach should write a test that passes on its first run. If your agent
needs a second attempt, the skill is missing something; the fix belongs in
skills/e2e/ in the e2e repository, not in your project’s copy.
CLI reference
init, guide, mcp, and run, flag by flag.
MCP server
Inspect the app before writing a test.
Debugging a run
The report, the artifacts, and the agent flags.
