Agentic end-to-end tests (e2e)
For tests that mix agent goals ("upgrade the workspace to Pro") with exact checks on what the screen shows. e2e is a separate, optional Node tool; learn its current behaviour from npx e2e guide <topic> rather than from memory.
- Check it is there. Look for
e2e.config.ts (or .mts), an e2e entry in package.json and a tests/**/*.e2e.ts glob. If it is missing, tell the user what npx e2e init writes (config, an example test, .gitignore lines, skill and MCP entries; Node 24.8+ or 22.22.3+) and that the CLI reports usage telemetry unless npx e2e telemetry disable. Run it only after they say yes. The version is the one in package.json and the lockfile. After any upgrade, re-read the guide topics you use, because npx e2e guide <topic> describes the installed version.
- Learn the screens before writing. Read the components for roles, labels and button text, or open the page with
--headed. A locator needs the accessible name the app really renders.
- Write one goal per
agent.act. Pin every outcome right after it with expect or agent.assert. Use exact values through screen and judge meaning, not phrasing (toContain('Pro'), not a sentence a model wrote). Never add a sleep: use a matcher that retries. A goal that submits, pays or invites can repeat when a run is retried, so reset the test account before each run or make the action idempotent.
- Keep secrets out of test code. Declare accounts under
credentials and other sensitive values under secrets in the config; hand the opaque value only to fill() or agent.act params. Point the config at staging and test accounts only: an agent goal presses real buttons, so a production account could upgrade a plan or send a message.
- Run one file, read the trace.
npx e2e run tests/<feature>.e2e.ts. On a failure open .e2e/results/<test>/trace.md, fix the locator, the expectation or the app, and run again. .e2e/ is output: read it, never edit it. A goal that passes once and fails once is flaky until shown otherwise: run it again and read the trace before you change the test.
- Bug bash. Run
npx e2e explore charters in parallel, merge the findings, and prove each with a repro test that fails on the reported assertion before any fix.
- Say what you ran. List the commands, what passed, what failed and what you could not run (for example no model key).
Never run npx e2e feedback: it sends text to the e2e team, so do it only when the user asks. Topic guides, config shape, cost control and CI: read reference.md in this folder. The shared bar: ../../references/checklists/engineering-quality-bar.md.
1---2name: bosskuai-agentic-e2e3description: "Use when writing or running agentic end-to-end UI tests with the e2e runner (e2e.config.ts, agent.act steps beside exact locators, web or mobile), exploring an app toward a goal, or bug-bashing a branch. Plain Playwright suites belong to e2e-testing."4metadata:5 source: https://skillmd.com/skills/wankimmy/bosskuai-agentic-e2e6---78# Agentic end-to-end tests (e2e)910For tests that mix agent goals ("upgrade the workspace to Pro") with exact checks on what the screen shows. e2e is a separate, optional Node tool; learn its current behaviour from `npx e2e guide <topic>` rather than from memory.11121. **Check it is there.** Look for `e2e.config.ts` (or `.mts`), an `e2e` entry in `package.json` and a `tests/**/*.e2e.ts` glob. If it is missing, tell the user what `npx e2e init` writes (config, an example test, `.gitignore` lines, skill and MCP entries; Node 24.8+ or 22.22.3+) and that the CLI reports usage telemetry unless `npx e2e telemetry disable`. Run it only after they say yes. The version is the one in `package.json` and the lockfile. After any upgrade, re-read the guide topics you use, because `npx e2e guide <topic>` describes the installed version.132. **Learn the screens before writing.** Read the components for roles, labels and button text, or open the page with `--headed`. A locator needs the accessible name the app really renders.143. **Write one goal per `agent.act`.** Pin every outcome right after it with `expect` or `agent.assert`. Use exact values through `screen` and judge meaning, not phrasing (`toContain('Pro')`, not a sentence a model wrote). Never add a sleep: use a matcher that retries. A goal that submits, pays or invites can repeat when a run is retried, so reset the test account before each run or make the action idempotent.154. **Keep secrets out of test code.** Declare accounts under `credentials` and other sensitive values under `secrets` in the config; hand the opaque value only to `fill()` or `agent.act` params. Point the config at staging and test accounts only: an agent goal presses real buttons, so a production account could upgrade a plan or send a message.165. **Run one file, read the trace.** `npx e2e run tests/<feature>.e2e.ts`. On a failure open `.e2e/results/<test>/trace.md`, fix the locator, the expectation or the app, and run again. `.e2e/` is output: read it, never edit it. A goal that passes once and fails once is flaky until shown otherwise: run it again and read the trace before you change the test.176. **Bug bash.** Run `npx e2e explore` charters in parallel, merge the findings, and prove each with a repro test that fails on the reported assertion before any fix.187. **Say what you ran.** List the commands, what passed, what failed and what you could not run (for example no model key).1920Never run `npx e2e feedback`: it sends text to the e2e team, so do it only when the user asks. Topic guides, config shape, cost control and CI: read `reference.md` in this folder. The shared bar: `../../references/checklists/engineering-quality-bar.md`.