How to add new E2E flows: Maestro YAML (API) in the repo, Maestro Studio, and best practices.
Flows are YAML files under e2e/flows/. Structure:
appId: org.stellar.freighterdev
tags:
- feature-name
---
- launchApp:
clearState: true
clearKeychain: true
- assertVisible:
id: some-screen
- tapOn:
id: some-button
# ... more steps- Frontmatter:
appId, optionaltags. - Commands: List of Maestro commands. Use
id(backed bytestIDin React Native) for stability.
Add new flows in the right folder (e.g. flows/onboarding/,
flows/transactions/), then:
- Run locally:
yarn test:e2e:ios MyNewFlow(orandroid). - Add a matrix entry in
android-e2e.ymlandios-e2e.yml(new shard +flow-name), or document that the flow is run only locally/manually.
See Maestro Commands and Selectors.
Studio helps author flows by visually picking UI elements and getting YAML
snippets. Prefer id selectors (from testID) over raw text or coordinates
when you add them to flows.
There are two options. Use the comparison below to choose:
| Desktop app | CLI / in-browser | |
|---|---|---|
| What it is | Standalone IDE: create, edit, and run flows | Element picker + REPL in browser (maestro studio) |
| Flow editing | Built-in; edit YAML in the app | None; you edit flows in your editor and paste snippets |
| Run tests | Run locally from the UI | You run maestro test (or yarn test:e2e) yourself |
| Env vars | Settings UI (e.g. E2E_TEST_RECOVERY_PHRASE, E2E_TEST_FUNDED_RECOVERY_PHRASE); one-by-one |
No env config; use -e when running maestro test |
| CLI required | No | Yes (Maestro CLI) |
| Best for | Inspecting, editing, creating flows; setting env vars; all-in-one workflow | Quick element discovery and REPL when you already use the CLI |
Full IDE: create and edit flows, connect a device, run tests locally, and set environment variables in the app. No CLI needed.
- Download: Mac · Windows · Linux
- Docs: Maestro Studio Desktop
- Install the app, connect a simulator/emulator, and open your project (or
e2e/flows/). - Create or edit flows in the UI. Use Settings to add env vars (e.g.
E2E_TEST_RECOVERY_PHRASE,E2E_TEST_FUNDED_RECOVERY_PHRASE). - Run flows via Run Locally or Run on Cloud; save
.yamlundere2e/flows/(e.g.flows/onboarding/,flows/transactions/).
Element picker + REPL only. You edit flow files in your own editor; Studio helps discover selectors and try commands. No flow editing, project view, or env configuration in the UI.
- Docs: Maestro Studio (CLI)
-
Boot the app in a simulator/emulator.
-
Run:
maestro studio
-
In the browser: click elements on the device screenshot to get YAML examples, or run commands in the REPL. Copy snippets and paste them into your
.yamlflows undere2e/flows/. -
Run tests via
yarn test:e2e(ormaestro test). Pass env vars with-eif needed; the script injectsE2E_TEST_RECOVERY_PHRASEandE2E_TEST_FUNDED_RECOVERY_PHRASEwhen set in.env.
To produce an MP4 of a flow (for demos or debugging):
maestro record e2e/flows/onboarding/CreateWallet.yaml
# Or local-only rendering:
maestro record --local e2e/flows/onboarding/CreateWallet.yamlThis is separate from the recording.mp4 saved per flow by
run-e2e-tests.sh in e2e-artifacts/.
-
Prefer
testIDover text or coordinates
Useid: my-buttonin flows and settestID="my-button"on the corresponding React Native component. IDs are stable across i18n and UI copy changes; text andpoint:break more often. -
Isolation
UselaunchAppwithclearState: trueandclearKeychain: trueso each run starts from a clean app state. -
Waits
UseextendedWaitUntilwith a timeout for elements that appear after async work (e.g. account data). PlainassertVisiblecan flake if the UI isn't ready yet. -
Conditional steps
UserunFlowwithwhen(e.g.platform: ios, orvisible: ...) for optional steps like biometrics or platform-specific prompts. -
Documentation
Add brief comments in YAML for non-obvious steps, and update Test Flows (and CI matrix docs) when adding or changing flows.