e2e tests a React Native app on a simulator or emulator with your normal
debug or release build, with no Detox framework in the app. Your testID
props work with getByTestId on both platforms.
Migrate this project's Detox tests to e2e, one spec at a time. Docs: https://e2e.tester.army/docs/migrate/detox.md and https://e2e.tester.army/docs/mobile.md
- Read the migration guide above. It maps
.detoxrc.jsand the Detox API to e2e. The mobile guide covers devices and app builds. - If the project has no e2e config (
e2e.config.ts,.mts,.js, or.mjs), runnpx e2e init --yes --engine mobile(or the pnpm or bun equivalent). It writes a mobile config with one target for this machine's platform and an example test against the Settings app, and installs nothing yet. Rewritetests/example.e2e.tsfor your app or delete it. - 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
.detoxrc.jsinto the e2e config: one target per platform withmobile({ platform }), the app'sbundleIdandappPathon the target, and the device type asmobile({ device }). e2e uses the normal debug or release build, with no Detox framework. - Install dependencies, then run
npx agent-device doctorand fix what it reports. - List the Detox specs and ask me which one to move first. Suggest a flow that needs frequent maintenance.
- Rewrite that spec as a
.e2e.tsfile undertests/(e2e runstests/**/*.e2e.tsby default), not in the Detox folder, with the guide's tables. Start it withapp.open(), since nothing launches on its own. Narrow queries that match several nodes. - Keep the launch 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. - Build and install the app, run the new file with
npx e2e run <file>on each platform target, and fix it until it passes. Keep the Detox spec until I confirm it can go. - Summarize which tests moved, which stayed in Detox, 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
Rewrite one spec
Start with a flow that needs frequent maintenance. If its screens take time
to settle, set the engine’s
settle and transition options.
Nothing launches on its own, so the test starts with app.open(). The
password comes from configured credentials.
Map each Detox call
Two things differ from Detox:
- Actions and single-node reads and assertions need one match. Several fail
with
LOCATOR_AMBIGUOUS. Narrow with.filter(),.first(), or.nth(). See screen. - A device has no
test.setupor{ session }. See what differs from the web.