Agentic end-to-end tests with the e2e runner — setup, browser and mobile flows, agent.act/assert, replay cache, reports, and bug bashes. Use when a project uses e2e, when asked for end-to-end, browser, mobile, or agentic UI tests or a bug bash, or when an e2e run fails.
Ships in core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
e2e runs UI tests that mix agent goals with exact steps. agent.act drives
one goal; agent.assert, agent.waitFor, and agent.extract judge the
screen; screen, app, browser, and expect act and check exactly. UI
targets use @e2e-dev/web for browsers, @e2e-dev/mobile for iOS
simulators, Android emulators, and connected phones, or @e2e-dev/desktop
(a prototype) for native apps on macOS.
Read the one reference that matches the request before doing anything else.
Each stands on its own; a reference names another topic only for a side
trip. mise x -- e2e guide <topic> prints the installed package's version of a
reference; prefer it when it differs from this copy.
The Rules and e2e 自体の問題 sections below still apply.
| When you are | Topic | Read |
|---|---|---|
Adding e2e to a project, writing e2e.config.ts, starting the app from the config, signing in to a model, setting up mobile targets | setup | references/setup.md |
Looking at the running app, checking a UI change, taking a screenshot or video, trying a locator, running a test line, or walking a flow while you write its test, over e2e mcp | mcp | references/mcp.md |
Writing or fixing a test: fixtures, locators, actions, matchers, sign-in sessions, the browser fixture, API-only tests | writing-tests | references/writing-tests.md |
Adding agent.* steps, picking a model, cutting cost, budgets, the replay cache | agent | references/agent.md |
Running tests: CLI flags, CI, reporters, trace pages, report.json for scripts, exit codes | running | references/running.md |
Handling a failed run: error codes and their fixes, --headed, --debug, --ai-trace | debugging | references/debugging.md |
Exploring an app toward a goal without a test file: e2e explore, its budgets and verdict | explore | references/explore.md |
| Asked to bug bash, QA, or hunt for bugs across an app or a branch | bug-bash | references/bug-bash.md |
For anything the references do not cover, the full documentation ships in
the docs/ directory of the installed e2e package
(node_modules/e2e/docs in a single-package project); a link such as
/reference/cli is docs/reference/cli.mdx. Complete projects for Vite,
Next.js, Astro, Angular, Expo, SwiftUI, Jetpack Compose, Kotlin Multiplatform,
Flutter, and .NET MAUI are in https://github.com/e2e-inc/e2e/tree/main/examples.
A config with one web target and a model, and a test that drives one goal and pins the outcome:
// tests/billing.e2e.ts
import { describe, test } from '@e2e-dev/web';
import { expect } from 'e2e';
describe('billing', () => {
test('a member upgrades to Pro', async ({ app, agent, screen, browser }) => {
await app.open('/settings/billing');
await agent.act('upgrade the workspace to the Pro plan');
await expect(screen.getByRole('status')).toContainText('Pro');
await expect(browser).toHaveURL('/settings/billing');
});
});
導入・モデル設定・telemetry・cache の扱いは
OpenCode Go setup を先に読む。
モデルは OpenCode Go の mimo-v2.6-flash、キーは mise + age の
OPENCODE_API_KEY を使う。config template を
対象アプリに合わせる。Vercel Gateway は明示的に選んだ場合だけ使う。
初回起動前から E2E_TELEMETRY_DISABLED=1 を渡し、MCP・CI にも適用する。
TesterArmy への feedback は自動送信しない。CLI は mise、アプリの依存関係は
exact pin と cooldown 7 日、汎用 skill は skillctrl で管理する。
init --yes や未導入 package を取得する npx / dlx をそのまま使わない。
テストは自分でデータを作成・検証・削除し、前回の残存データに依存しない。
固定値と安定した操作は screen + expect、判断が必要な操作は agent.act にする。
PRD criterion とテストの対応を残し、出荷判断では未確認の criterion も明示する。
モデルの画像入力・schema・tool call の診断 helper は debugging の Tools、証跡の秘密混入検査 helper は running の Output を必要時に読む。
e2e.config.ts, .mts, .js, or .mjs, the tests glob
(default tests/**/*.e2e.ts), e2e in package.json. Nothing there:
follow setup when the user has requested e2e (see Rules).e2e mcp server (topic mcp), write the test while
you walk the flow, not from memory after the walk. A test written
afterwards fails on each name or step you got wrong, one run at a time.
Before open_session, create tests/<feature>.e2e.ts, opening on the
screen it covers (step 3). Then add each step to the file as you take it
in the session. An act goal goes in before you walk its path, and the
path's actions stay out of the test. A screen line is the Test line:
its action printed, copied as is. When the outcome shows, run its
expect with run_code and add it once it passes; a passing line
also joins test_lines; checks go in the test's assert block at the end.
run_code runs JavaScript on the test API, so use it for most of a
session's work, a loop or a read and a check in one call, over many
single actions.
The walk ends with the test written. Without a
server, learn the accessible names the app renders from the components or
a --headed run.writing-tests, "Structure"):
one top-level describe per feature, and in it one test per behavior,
titled with the outcome it verifies. Each test runs arrange, act, assert,
in that order: reach the starting state, do the one thing under test,
then every expect or agent.assert at the end. A second outcome worth
checking is a second test, so a failing title says what broke.
A step is an agent.act goal or screen lines. Drive the flow with
agent.act, one atomic goal per call; three goals make three calls.
Start the test on the screen it covers, since every rerun pays
for the steps before: in a browser a saved session instead of the
sign-in form and app.open on that screen's path, on a device
device.openLink, and data from the app's API (topic writing-tests).
Exact values go through screen: a sign-in form in a setup test, a field
that must receive one specific string, a count that must be one number.E2E_TELEMETRY_DISABLED=1 mise x -- pnpm exec e2e run tests/<feature>.e2e.ts:<line>
from the shell, the line its test( opens on, with the flags in
"Rerunning a test while you fix it" below. Agent steps need a model in
the config and that provider's authentication (a saved subscription
login, an API key); a local endpoint may need none. Tests without agent
steps need no model.The run already saw every screen up to the failure. Fix from what it recorded; never walk the flow again from the start over MCP just to see a screen.
expected and observed), where the
screen was (❯ at: a URL on the web, the app and screen title on a
device), and the nodes nearest a failed locator (❯ on screen). Then
read the trace page it names (❯ trace .e2e/results/<test>/trace.md):
every step with what it did, what the app logged, the agent's turns, and
## Screen at failure, the screen one node per line (topic debugging).setTimeout, waitForTimeout): wait for the state you
need with agent.waitFor('<that state>') instead (topic agent; it
needs a model).expect.soft lets it go on),
and every wrong line after it costs another run. Before rerunning, check
the lines after it as far as you can: against the screen at failure, the
app source, or a live session.mcp). open_session {test: "tests/<feature>.e2e.ts"} (with :<line>
of its test( call when the file holds several) runs the test and stops
on the live screen where it failed. Act out the lines after it there and
put the Test line: each action prints in place of a wrong one, so the
next rerun catches every mistake. Otherwise open or reuse a session, go
straight to that screen, then observe and locate, or run_code for
the fixed line and the ones after it. On the web, navigate to the path
of the ❯ at URL or the screen's route, and tap only to reach a state no
URL opens. A device session starts on the app's launch screen: take the
shortest path from there.open_session {test} (topic mcp says when a session
must close first). Repeat with the next failure.Every run of a failing test waits out its failure, and every agent.act
that runs live spends model calls. Keep each rerun to the one test and the
lines you changed:
file:line, not the file or the suite. After an edit above the
test, look its test( line up again: a stale line runs another test, or
fails with NO_TESTS listing the lines tests start at.--action-timeout 5000: a locator that matches nothing fails in 5 s
instead of the default 30 s. It also bounds each action inside an agent
step, so keep it longer than the slowest screen takes to load. A screen
call's own { timeout } still wins. An expect already gives up after
5 s by default (assertionTimeout).writing-tests), and the next run replays those with no model call.
New, changed, and failed goals run live, and so does a replay the trace
page shows as handed off. agent.assert, agent.waitFor, and
agent.extract always call the model. Leave --no-cache off: it sends every goal to the model
again. Only a read-write cache records: the local default, but not with
CI set and no cache mode in the config, nor in strict mode. A stopped
run (Ctrl-C, a command your tool's timeout kills, --max-duration) saves
nothing, so give the command a timeout longer than the test.describe, or its file, and don't reword a
goal, change its params, or change the agent's context or the test's
agentContext once a goal passes. Each is part of a recording's key, so
every goal it touches records again live. Fixing a locator or an
expectation keeps the recordings.--retries 0 when retries are on (retries in the config, or CI
set, where the default is 1); a retries option on the test or its
describe wins over the flag. Outside strict mode (--strict-cache, cache.strict), a
retry never replays: it runs every goal live and waits out the failure
again.--action-timeout and run it one time with
--no-cache: every goal runs live at the config's timeouts, which shows
the agent still reaches it without its recordings.mise x -- pnpm exec e2e ...
(use that repo's package manager). Prefix E2E_TELEMETRY_DISABLED=1 until the
environment setting is active. Commands in upstream topics illustrate APIs;
apply the local setup rules to installation, providers, and process startup.e2e mcp server in the client: the e2e plugin's
(Codex and Cursor), or one registered in the project (topic mcp). In a directory with no e2e config, a live look still
works (topic mcp). Tests need a config and run with the CLI.
Keep a session open across runs while you write or fix a web test; topic
mcp says when a run can go beside it, and what to do on
APP_ALREADY_RUNNING.export default { ... } satisfies E2EConfig with
import type { E2EConfig } from 'e2e'. targets is required; a UI target
names an engine and declares the app beside it: { engine: web(), app: { url, command } }.
A tools-only target can omit the engine and set platform.test, describe, the hooks, expect, credentials, and
secrets from e2e. A test that uses the browser fixture imports test,
describe, and the hooks from @e2e-dev/web: the same runtime functions,
typed with browser.package.json sets as type.expect retries
assertions. Reads such as textContent() wait for one match until the
action timeout, then answer the current value; count() and isVisible()
answer from the current screen. Nothing waits for a value to change, so use
a matcher when a value has to settle.LOCATOR_AMBIGUOUS; narrow it
(topic writing-tests).credentials and
every other sensitive value under secrets in the config; resolve with
credentials.user(name).password or secrets.get(name) (separate
namespaces: secrets.get never returns a password), and hand the opaque
Secret only to fill() or agent.act params.describe per feature, one behavior per test,
arrange, act, assert with every assertion last (topic writing-tests).
Bad: one test that adds a todo, checks it, marks it done, and checks
again. Good: 'adds a todo to the list' and 'marks a todo as done',
the second adding its todo in its arrange block.act, the wording on screen, real values
in params. A goal is atomic: one outcome that one check confirms. Two
outcomes are two goals in two act calls (topic agent), never 'add a todo and mark it done'. Judge meaning, not phrasing: toContain('Pro'),
not an exact sentence a model produced.expect(locator)), an engine matcher
(expect(browser).toHaveURL), or agent.assert. A passing one confirms
every act before it, so they can be cached and replayed without model
calls, and so do locator.waitFor, browser.waitForURL, and
agent.waitFor. Reads, expect.poll, and plain-value expect confirm
nothing (topic agent, "The replay cache").context for vocabulary the screens use,
system for how it works, tools for a test API, named personas under
agents. When a step fails, tighten the goal first, then the context, then
the agent..e2e/ is output (report.json, results/, cache/, logs/; the
config's output moves the report and artifacts, never cache/ or the
app's log). Read it, never edit it.コマンド・API・docs の問題はローカルの証跡とともにユーザーに報告する。
e2e feedback などで開発元へ自動送信しない。
assets/e2e.config.ts (opens in a new tab)references/agent.md (opens in a new tab)references/bug-bash.md (opens in a new tab)references/debugging.md (opens in a new tab)references/explore.md (opens in a new tab)references/mcp.md (opens in a new tab)references/opencode-go.md (opens in a new tab)references/running.md (opens in a new tab)references/setup.md (opens in a new tab)references/writing-tests.md (opens in a new tab)tools/audit-artifacts.ts (opens in a new tab)tools/check-model.ts (opens in a new tab)tools/helpers.test.ts (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
/core:e2efrom core
npx claudepluginhub wwwyo/skills --plugin core56 skills in this plugin
/agent-friendly-cliAI agent や自動化から呼ぶ CLI・script の設計指針。CLI の新設、subcommand・flag・JSON出力の追加、API の CLI 化、skill helper の作成、MCP と CLI の選択で使う。agent 向けと明示されない CLI 設計にも適用する。/architectSketch types, signatures, and module structure before code, then stay in the loop while implementation fills in. Use for /architect, 'architect this', 'design this', or non-trivial work where jumping to code would lock in the wrong shape./benchmark-checklistVet a perf measurement (limiter, tuning, limits, errors, repeatability, relevance, and whether the work happened) before you report or act on it. Use when you run a benchmark or report a speedup or regression you measured.Other plugins' skills for the same job