e2e replaces Cypress command chains with async TypeScript tests that run in Node. Both suites can stay in the project while you move one spec at a time.
Agent prompt
Migrate this project's Cypress tests to e2e, one spec at a time. Docs: https://e2e.tester.army/docs/migrate/cypress.md
- Read the migration guide above. It maps Cypress config, commands, and assertions to e2e.
- If the project has no e2e config (
e2e.config.ts,.mts,.js, or.mjs), runnpx e2e init --yes(or the pnpm or bun equivalent). It writes a config and an example test, and installs nothing yet. - Read the e2e skill (
npx e2e guideprints it,npx e2e guide <topic>prints a topic) and follow it for every step below. - If you ran init, ask me which model to use for agent steps: a ChatGPT, GitHub Copilot, OpenCode Console, or SuperGrok subscription, an API key, or a local model. Configure it with its provider package. If it needs a sign-in, give me the
npx e2e logincommand and wait until I confirm. - Port
cypress.config.*into the e2e config:baseUrland the dev server command become the target'sapp, and if the specs select bydata-cy, setweb({ testIdAttribute: 'data-cy' })soscreen.getByTestIdreads it. Keep Cypress installed while both suites run. - Install dependencies.
- List the Cypress end-to-end specs and ask me which one to move first. Suggest one that breaks often or waits with
cy.wait(ms). Component tests have no e2e equivalent; leave them in Cypress. - Rewrite that spec as a
.e2e.tsfile undertests/(e2e runstests/**/*.e2e.tsby default) with the guide's tables, one awaited call per line. Wherecy.containsmatched a fragment, pass{ exact: false }. Replace eachcy.wait(ms)with an assertion on the state the test waits for. - Keep navigation and the final assertions deterministic, with
app.open()and locator assertions. Where a run of scripted interactions breaks often, propose anagent.actgoal for it instead. - Run the new file with
npx e2e run <file>and fix it until it passes. Keep the Cypress spec until I confirm it can go. - Summarize which tests moved, which stayed in Cypress, and why.
For a migration that spans several sessions, the migrate-to-e2e skill records what moved in a progress file and keeps the old suite running until you retire each test.
Port the config
Install e2e and configure a model with the quickstart. The example below uses an agent call.
Keep your data-cy attributes. The config below reads them as test ids.
e2e.config.ts
Rewrite one spec
Start with a spec that often breaks.
Cypress
e2e
Map each command
Two things differ from Cypress:
- There is no chain. Await each call on its own line. It returns a value:
const text = await locator.textContent(). - Actions and single-node reads and assertions need one match. Several fail
with
LOCATOR_AMBIGUOUS. Narrow with.filter(),.first(), or.nth(). See screen.