/e2e:migrate-to-e2efrom e2e
Ports Playwright, Cypress, Selenium, Appium, Detox, Maestro, or TesterArmy test suites to e2e incrementally, keeping both suites green and tracking progress in MIGRATION.md.
Ships in e2e. 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.
A migration is never one change. Each session ports one slice, proves it,
and leaves both suites green: the old runner keeps every test it had, and
the new e2e tests pass beside it. A progress file, MIGRATION.md, records
what moved, what is left, and why, so the next session, yours or another
agent's, starts from it instead of from scratch. The user decides when an old test goes.
Two references do most of the work. Read them; do not restate them.
.agents/skills/e2e/SKILL.md
once npx e2e init or npx skills add e2e-inc/e2e ran, or
npx e2e guide <topic> from the installed package. Topics named below
(setup, writing-tests, agent, mcp, running, debugging) are its
reference files.missing) with today's workaround. Both ship in the installed package under
node_modules/e2e/docs/ with the same paths as .mdx files.Detect the source runner, then read both docs in its row in full, before the inventory and before writing any code. Each later step leans on them.
| Source | Detect it by | Migration guide | Engine |
|---|---|---|---|
| Playwright | playwright.config.*, @playwright/test | migrate/playwright | web |
| Cypress | cypress.config.*, a cypress/ folder | migrate/cypress | web |
| Selenium | selenium-webdriver, Selenium in a pom.xml, build.gradle, or requirements.txt | migrate/selenium | web |
| Appium | appium: capabilities in a wdio.conf.* or test setup, appium in package.json, io.appium in a pom.xml or build.gradle, Appium-Python-Client in requirements.txt | migrate/appium | mobile |
| Detox | .detoxrc*, detox in package.json | migrate/detox | mobile |
| Maestro | YAML flows opening with appId: and ---, .maestro/, maestro test in a script or workflow | migrate/maestro | mobile |
| TesterArmy | testerarmy MCP tools, a testerarmy entry in an MCP config, testerarmy or tester.army in a script or workflow, or the user says so | migrate/testerarmy | web or mobile, by the project's type |
WebdriverIO for the web has no guide. Map its WebDriver calls with the Selenium guide, and tell the user the mapping is partial. WebdriverIO with Appium capabilities is an Appium project. A project with two source runners migrates one at a time, one section of the progress file each.
TesterArmy tests live in TesterArmy, not in the repo. Read them through
the TesterArmy MCP server. When your client has no testerarmy tools, add
the server as the guide's "Connect the TesterArmy MCP server" section says,
ask the user to sign in and restart the session, and wait.
list_projects). Its settings,
environments, credentials, memories, and files are the harness inputs
(step 3); its groups are the slices (step 4).assert steps. A disabled test counts as
skipped. A disabled step is left out and not counted.run_test and run_group start cloud runs
against the deployed app: in step 6, call them only when the user agrees,
else record Run old: not run. Never create, update, or delete anything
in TesterArmy; retiring a test means the user disables or deletes it.agent.act, agent.assert),
so the config needs a model (step 3.2). A step that needs no judgment
ports to a locator call instead, as the guide's "Map each step" section
says. Learn the exact name first (step 5), and note each swap in the
row's Notes.Look for MIGRATION.md beside the e2e config, then at the repo root. When
one exists, this is a later session:
Source line
names. Its Next section names the slice this session takes, unless the
user names another.ported test still
exists in both suites, every source file or test it lists still exists
(except retired ones, deleted on purpose), and no new source file or
test is missing from it (add those as todo). No Defect check: line: ask
as in step 2. A planted bug noted under Next: revert it first (step 6).Run new command once. A ported test that fails now is
the first thing to fix, before any new slice.Harness: line says done, go to step 3, Build
the harness. Otherwise go to step 4, Pick the slice.No progress file means a first session: steps 2 and 3, then the rest.
Answer these from the repo; ask the user only what you cannot observe.
| Question | Where the answer is | What it decides |
|---|---|---|
| Source runner | The detection table above | The two docs read before this table |
| Tests | Every spec, flow, or test file, with its titles, tags, and per-platform or per-browser branches. Count tests with the runner's own list or dry-run mode, not by grepping, which misses tests made in a loop. npx playwright test --list prints a test once for every project that runs it, so count a test listed under several projects once | The progress file's rows, one per source file. Count each file's assertions now so a port can be checked against the count: explicit ones (expect, should, assertVisible), plus, where the runner's steps are its checks (a Maestro tapOn fails when its target is missing), those steps |
| Shared code | Page objects, custom commands, subflows (runFlow: file.yaml), fixtures, hooks, globalSetup | Helpers to port once, before the first test that needs each |
| How it runs | The CI job that runs the suite and the scripts it calls: the build, the services and mock servers it starts, seed and reset calls, env files, devices or browsers, ports | The e2e harness. The CI job is usually the only complete description; read it line by line |
| Where e2e lives | A JavaScript or TypeScript project with a package.json: its root (in a monorepo, beside the source runner's config), tests in tests/**/*.e2e.ts. A native, Java, or Python project: an e2e/ folder with its own package.json beside the app. Then the source runner's file pattern (testDir, testMatch, specPattern, the flow folder) | The e2e config's location and the progress file's. The two runners must not collect each other's files: when the patterns overlap, narrow one of them. Playwright suites often name files *.e2e.ts already, which leaves the directories as the only separation: no e2e test under a Playwright testDir, and no Playwright file under e2e's tests glob. Compare npx playwright test --list with npx e2e list |
| Can the old suite run here | The source runner installed, the build it needs, the services | Whether parity is checked against a live old run (step 6) or only against the source text |
Write MIGRATION.md now (format in step 8), every source file todo.
Ask whether each slice should also run against a planted defect (step 6)
and record the answer as Defect check: on or off.
The harness is the config, the app launch, and one green test. It is done once and the progress file says so; later sessions skip this step.
npx e2e init --yes (topic setup), with --engine mobile
on a device project. Delete or rewrite the example test. One target per
platform or browser the source suite covers.agent). A literal port needs none: every test can be deterministic, and
a config without a model runs those.app.command with readyUrl (topic
setup). The command gets only PATH, HOME, the temp-directory
variables, and command.env, not the shell's environment, so pass
what the server read from the old runner's environment in
command.env.services key. Databases, queues, and mock servers start
before the run with the command the CI job uses, or app.command runs
a script that brings them up and then serves the app. Name the command
in the progress file.runScript with http.post,
cy.task('db:reset'), an API call in beforeEach) becomes fetch in a
beforeEach or a fixture, so each test still starts from known data..ts file as an ES module.
Importing it into a test can then fail with __dirname is not defined, with "does not provide an export named" for a CommonJS
package, or with ERR_UNSUPPORTED_DIR_IMPORT. When it does, run the
helper unchanged in a child process with the repo's own TypeScript
runner (ts-node, tsx) and call it from a fixture. Do not edit the
app's modules to make them load.credentials or secrets (topic setup). When the old config loaded
an env file (dotenv.config()), load it the same way in the e2e
config, so tests and helpers see the same values. app.command does
not see them; pass the ones the server needs in command.env.npx e2e doctor (e2e 0.23.0 or newer) and fix every check it fails. It
loads the config and checks each target's engine without starting the
app: the browser on a web target; agent-device, the toolchain, the
devices, and the build at appPath on a local-device mobile target (a
device-provider target skips these). When step 3.2 configured a model,
add --check-model to call each model once.init adds a test:e2e script (e2e run) unless a script already has
that name. When the name was taken, or init did not run, add one under
a free name. Keep the old suite's scripts as they were.A slice is what this session can finish green: one file, one folder, one tag, or one feature area, usually one to five tests. Ask the user which. When they leave it to you, suggest in this order:
missing, last.Write the slice into the progress file's Next section before starting, so an
interrupted session leaves a trail.
Port the slice's shared helpers first, once, as plain .ts files (not
.e2e.ts, so the runner does not collect them), for example under
tests/support/. A subflow
becomes a function or a test.extend fixture; a page object becomes a
fixture (topic writing-tests). Record each in the progress file.
Then each test, one at a time:
// Ported from __e2e__/flows/login.yml), so reports and reviewers map
one to the other.waitForFunction) becomes one more, so the e2e
count is at least the inventory's.writing-tests topic gives ("Structure"). Lines move, split
tests copy the steps they need, and closing waits are added; no source
step or assertion is dropped:
describe per source file or feature, named after it.
Setup tests stay top-level.beforeEach, a fixture, or the app's API.locator.waitFor(), agent.waitFor). It still counts
toward the assertion count, since it fails on timeout.e2e mcp with open_session,
observe, and locate (topic mcp). When your client has no e2e MCP
tools, run the test and read the screen listed on its trace page
(topic debugging); do not build a bridge. The guide's notes on
selectors list the edits most ports need: e2e matches whole strings and
fails on several matches where the old runner took the first. When a
query also matches a hidden copy (another layout's), add
{ visible: true }. When two visible nodes match, such as a second
toast over the first, pick the one the step means.agent.waitFor on the state it waited
for (agent.waitFor('the upload finished')), or an assertion with a
timeout when a locator names that state or the config has no model.
Never port the duration.{ platforms: [...] } on a test, or an if
on the platform fixture inside one.hideKeyboard, a
coordinate tap, a retry loop around a picker) is a workaround for the old
runner. Try the plain step first; keep a workaround only when e2e needs it
too, with its own comment saying why.missing,
use its workaround. When there is none, the test stays in the old
runner: mark it stays with the reason and offer to send
npx e2e feedback --type feature -m "<the gap>" once: preview it with
--dry-run and send it only when the user agrees (the e2e skill,
Feedback).agent.act or a different locator; propose the app change to the user
instead of making it. A defect check's planted bug (step 6) is
the exception, reverted the same session.agent.act comes after the literal port passes, never instead of it, and
only with a model configured. Propose it for a stretch the source kept
patching: coordinate taps, picker spins, long tap sequences through a
wizard. Keep the test's shape: an agent.act in the arrange block ends it
with a wait for the state it reached, and one under test is checked by the
locator assertions at the end (topic agent).
A port is done when it is as strict as the source and passes every time.
npx e2e run <file> --repeat-each 3, plus --no-cache when it has agent
steps. Three of three on each target, or it is not done (topic
running).blocked with what
failed.debugging).With Defect check: on, show both suites fail on the same bug:
Next until it is reverted.Run old on the slice
(when it runs here) and npx e2e run <files> --no-cache.git checkout -- <file>), rebuild, and confirm
git diff -- <file> is empty.Defect check cell, for example total +1: both fail,
or old not run when the old suite cannot run here.Until the user retires a source test, both runners keep it.
retired. Once neither a remaining source
test nor e2e code uses a source helper, propose deleting it, and delete
it when the user confirms.running, Continuous integration).stays, the progress file says
the migration is complete and which tests, if any, stay behind.MIGRATION.md, beside the e2e config, is the migration's state. Update it
as you go, not at the end; an interrupted session must leave it true.
# Migration to e2e
Source: Maestro, `__e2e__/flows/**` (guide: https://e2e.com/docs/migrate/maestro.md, engine: https://e2e.com/docs/mobile.md)
e2e: `e2e.config.ts`, tests `tests/**/*.e2e.ts`
Start dependencies: `pnpm e2e:mock-server`
Run old: `maestro test __e2e__`
Run new: `npx e2e run`
Harness: done, smoke `tests/login.e2e.ts` on ios and android
Defect check: on
| Source | e2e | Status | Assertions (source → e2e) | Passing | Defect check | Notes |
| --- | --- | --- | --- | --- | --- | --- |
| flows/login.yml | tests/login.e2e.ts | ported | 3 → 3 | ios 3/3, android 3/3 | wrong screen: both fail | |
| flows/create-account.yml | | blocked | 6 → | | | date picker spin fails on android, trace in .e2e/results |
| flows/search-screen.yml | | todo | 4 → | | | |
## Shared helpers
| Source | e2e | Used by |
| --- | --- | --- |
| setupApp.yml | tests/support/app.ts `openSignedOut()` | login, create-account |
## Gaps
- `addMedia` has no e2e equivalent (guide: Not yet); feedback sent.
## Next
flows/composer.yml and flows/composer-self-label.yml (both need `signInAlice()`).
One row per source file. A file whose tests end in different statuses gets one row per test, each with its own assertion count. A suite with hundreds of tests keeps file rows: the table is read at the start of every session.
Statuses: todo; ported (green in e2e, the source test still runs);
retired (the user confirmed, the source test is deleted); blocked
(tried, does not pass yet, with what failed); stays (stays in the old
runner on purpose, with why).
Tell the user what this session moved and what it proved: the tests ported
and their pass counts per target, defect check results, the helpers ported,
what is blocked or stays and why, the gaps reported, and the next slice.
Ask which ported source tests may be retired. List every file you created or changed.
ported test passes.setup).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub e2e-inc/e2e --plugin e2e3 skills in this plugin
/create-verification-skillGenerate a project-local verify-<app> skill on top of e2e, so any coding agent can launch the app, check it is worth driving, exercise a feature the way a user does, keep evidence, and bug bash it. Writes the skill, a feature map with one explore charter per feature, and proves it once. Use for /create-verification-skill, "make a verification skill for this repo", or when a project has no scripted way to prove UI behavior./e2eWrites, runs, and debugs end-to-end tests for web and mobile apps with e2e, the agentic test runner, which mixes agent.act goals with exact locator assertions on a Playwright browser or an iOS or Android device. Also drives a project's running app live over the e2e MCP server to look at a screen, check a UI change, take a screenshot or record a video, and try a locator; and runs bug bashes, parallel e2e explore runs with each bug proven by a repro test. Use when a project depends on e2e or has an e2e.config.ts, when asked for end-to-end, browser, mobile, or agentic UI tests, to check a change in the running app, to QA or bug bash an app or branch, or when an e2e run fails.Other plugins' skills for the same job