[ agent view ]
Documentation Index
Fetch the complete documentation index at: https://e2e.com/docs/llms.txt Use this file to discover all available pages before exploring further.
From Maestro
Move Maestro flows to TypeScript with locators, assertions, and agent goals.
e2e replaces Maestro's YAML flows with TypeScript tests. Each command becomes an awaited call, usually on a locator, or one agent goal covers several. Both runners can use the same simulator or emulator while you move one flow at a time.
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
<Note>Set up a target with the mobile guide and a model with the quickstart.</Note>
The reference pages hold the details: screen, expect, test, and the mobile engine.
| Maestro | e2e |
|---|---|
appId at the top of every flow | app: { bundleId: 'com.example.app' } on the target, the app app.open() launches |
a different appId per flow, or a second one mid-flow | device.openApp(id) inside the test, or separate app-specific configs and runs; every test runs on every selected target. With mobileTools, the agent's open_app tool switches apps inside a goal, see Agent tools |
--platform ios | mobile({ platform: 'ios' }), one engine per platform |
--device | mobile({ device: 'iPhone 17' }); a list is a pool, one worker per device |
.maestro/config.yaml flows | tests, default tests/**/*.e2e.ts; Maestro runs one folder level, e2e recurses |
flows: ['!helper.yaml'] | a tests entry with a leading !: tests: ['tests/**/*.e2e.ts', '!tests/helpers/**'] |
tags and --include-tags | { tags: [...] } on a test or group, --tag on the CLI |
--exclude-tags | --exclude-tag |
env and ${VAR} | module constants, and params in a goal: agent.act('sign in as {email}', { params: { email } }) |
MAESTRO_* variables | process.env in the config; a password or token goes under credentials or secrets, which the model never sees, see Authentication |
--format junit, --output | --reporter list,junit, written to .e2e/junit.xml |
--format html | htmlReporter() from @e2e-dev/html-reporter writes .e2e/report.html |
properties (JUnit <property>) | Not yet |
--shards, --shard-split | device: [...] plus workers on one machine; --shard <index/total> across machines, see Sharding |
maestro record | npx e2e run --video, one MP4 of the device per attempt, or video in the config |
maestro test -c, Maestro Studio | Not yet. npx e2e mcp gives a coding agent a live session on the device, see MCP server |
maestro hierarchy | Not yet. device.unstable_raw.client.capture.snapshot({}) returns agent-device's node tree, see unstable_raw; device.locator takes agent-device selectors for nodes screen cannot name |
| Maestro Cloud | your CI, see Continuous integration |
Rewrite one flow
Start with a flow whose optional steps and runFlow: { when } branches
often need updating.
appId: com.example.app
---
- launchApp:
clearState: true
- tapOn: "Get started"
- tapOn:
id: "email"
- inputText: "ada@example.test"
- tapOn: "Continue"
- assertVisible: "Check your inbox"
- scrollUntilVisible:
element: "Resend"
- assertVisible:
id: "resend"
test('asks for the email', async ({ app, agent, screen }) => {
await app.clearState();
await agent.act('get started with the email {email}', { params: { email: 'ada@example.test' } });
await expect(screen.getByText('Check your inbox')).toBeVisible();
await screen.scrollUntilVisible(screen.getByTestId('resend'));
await expect(screen.getByTestId('resend')).toBeVisible();
});
Map each command
Calls on device run only on a device, so a test that uses it declares
requires: ['device'] and other targets skip it. Calls on screen, app,
agent, and expect(locator) run on every target. "Not yet" marks a
command e2e doesn't have today, and "No equivalent" one it leaves out on
purpose.
| Maestro | e2e |
|---|---|
launchApp | app.open(), the fresh launch of the target's app.bundleId; nothing launches on its own |
launchApp: { clearState: true }, clearState | app.clearState() |
launchApp: { stopApp: false } | device.openApp(id) without relaunch |
launchApp: { arguments } | app.launchArguments on the target, or device.openApp(app, { relaunch: true, launchArguments }) for one launch; a list of strings, not a map |
launchApp: { permissions } | app.permissions on the target, set before every fresh launch, or device.openApp(app, { relaunch: true, permissions }) for one; grant, deny, reset for allow, deny, unset; no all, nothing is granted unless named |
stopApp, killApp | device.closeApp() |
stopApp, then launchApp | app.restart() |
clearKeychain | device.clearKeychain(), the whole simulator's keychain; iOS only |
openLink | device.openLink(url, { app }); on iOS the link opens into app, default the pinned app |
addMedia | Not yet. Add the photo from the host before app.open(): xcrun simctl addmedia on an iOS simulator; Android is unchecked. See the "Photos for a picker test" accordion under The device fixture |
back | app.back(), or device.back() |
| Maestro | e2e |
|---|---|
tapOn: "Text" | screen.getByText('Text').tap(); exact, see Rewrite selectors |
tapOn: { id: x } | screen.getByTestId('x').tap() |
tapOn: { text, index: 2 } | .nth(2) |
tapOn: { below: "Email" }, above, leftOf, rightOf, containsDescendants | No equivalent, see Rewrite selectors |
tapOn: { point: "x,y" } | screen.tapAt({ x, y }); inside a node, .tap({ position: { x, y } }) |
retryTapIfNoChange, waitToSettleTimeoutMs | mobile({ transition }), engine-wide; no per-call knob |
doubleTapOn, longPressOn | .doubleTap(), .longPress({ duration }) |
inputText | screen.getByTestId('field').fill('text') |
inputRandomEmail, inputRandomText, faker | unique() around a value in act params so the cache still replays; any npm faker for the rest |
eraseText | .clear() |
hideKeyboard | device.dismissKeyboard() |
pressKey: Enter | .press('Enter') on the field |
pressKey: Home, back | device.home(), device.back() |
pressKey: lock, power, volume up, volume down | Not yet. device.unstable_raw.client.command.hardwareButton({ button }) presses one: 'power', 'volume-up', or 'volume-down' on Android; on iOS only the volume keys, on a physical device, not a simulator |
| TV remote keys | Not yet |
copyTextFrom, pasteText | await locator.textContent(), then .fill(text) |
setClipboard | device.setClipboard(text); device.clipboard() reads it. Neither works on an Android build with no clipboard shell command |
label: "..." on a command | Not yet. Every screen, device, and agent call is a report step named by the call |
| Maestro | e2e |
|---|---|
swipe: { direction: UP } | screen.swipe({ direction: 'down' }), or locator.swipe(...) inside one node; Maestro names the finger's direction, e2e the content's |
swipe: { start, end } | screen.swipe({ from: { x, y }, to: { x, y } }) |
scroll | screen.swipe({ direction: 'down' }) |
scrollUntilVisible: { element } | screen.scrollUntilVisible(locator, { direction }) |
waitForAnimationToEnd | an assertion on the settled state; mobile({ transition }) for the engine |
| Maestro | e2e |
|---|---|
assertVisible, assertNotVisible | await expect(locator).toBeVisible(), .toBeHidden() |
assertVisible: { text, enabled: true } | .toBeVisible() and .toBeEnabled() |
assertVisible: { checked, selected, focused } | .toBeChecked(), .toBeSelected(), .toBeFocused() |
assertTrue: ${...} | expect(value).toBe(true), or expect.poll for a value that is still changing |
extendedWaitUntil: { visible, timeout } | .toBeVisible({ timeout }) |
assertScreenshot: { path, thresholdPercentage } | await expect(screen).toHaveScreenshot(name, { maxDiffPixelRatio }), see Visual comparison |
assertDarkMode, assertLightMode | Not yet. Assert on a themed control |
retry: { maxRetries, commands } | expect.poll for a value, { retries } on the test for the flow |
takeScreenshot | app.screenshot('label'), secure fields masked |
| Maestro | e2e |
|---|---|
setLocation | device.setLocation({ latitude, longitude }) |
travel: { points } | device.setLocation in a loop |
setAirplaneMode, toggleAirplaneMode | device.setAirplaneMode(true) or false, the state you want; true is Android only |
setDarkMode, toggleDarkMode | device.setAppearance('dark') or 'light' |
setOrientation | device.setOrientation('landscape-left') |
setPermissions | device.setPermission(name, 'grant' | 'deny' | 'reset'), one permission per call, on the target's app, which need not be running; call it before app.open() |
| platform-specific selectors | device.locator('role=text label="..."'), agent-device's selector terms |
| Maestro | e2e |
|---|---|
assertWithAI, assertNoDefectsWithAI | agent.assert('...'), agent.assert('...', { vision: true }) |
extractTextWithAI | agent.extract('...', { schema }) |
runFlow: file.yaml | a function, or a fixture from test.extend |
runFlow: { when: { visible } } | if (await locator.isVisible()) { ... }, see Rewrite selectors |
optional: true on a command | the same isVisible() check |
repeat: { times: n }, repeat: { while } | a for or while loop |
runScript, evalScript, ${output.x} | TypeScript in the test |
http.get, http.post, json() | Node fetch, see API |
onFlowStart, onFlowComplete | beforeEach, afterEach |
startRecording, stopRecording | app.startRecording(), app.stopRecording() |
Rewrite selectors
Four differences from Maestro's selectors cause most edits.
- Maestro reads text and id as case-insensitive regular expressions, so
tapOn: ".*Save.*"matches any text with Save in it, and"Mute Account"matchesMute account.getByTextandgetByTestIdmatch the whole string, case included. WritegetByText(/^mute account$/i)orgetByTestId(/^row-/)for a pattern, or{ exact: false }for a case-insensitive substring of text. - Maestro taps the first of several matches. e2e fails with
LOCATOR_AMBIGUOUS, so write.first()when the first match is what you mean. isVisible(), the check that replacesoptionalandrunFlow: { when }, isfalseon zero matches andLOCATOR_AMBIGUOUSon several. Add{ visible: true }to the query or.first()when a hidden twin may exist.below,above,leftOf,rightOf, andcontainsDescendantshave no port. e2e hasfilter({ has, hasText })and chaining for structure, and nothing spatial. UsegetByLabel, a test id, or a goal:agent.act('enter {email} in the email field', { params })finds the field.
What differs on purpose
- e2e records and redacts the calls on
screen,app,device, and the agent.device.unstable_rawhands a test agent-device's client for what those don't cover. Its calls aren't steps: the report and trace leave them out, the agent cache doesn't replay them, nothing redacts their arguments, and nothing waits for the screen to settle after one. - A device has no
test.setupor{ session }, see what differs from the web.
Next
Configure your app and devices.
Goals, assertions, and locators instead of scripted selectors.
