Testing Expo apps with Maestro

Maestro mobile testing workflow

A screen can look perfect in isolation and still fail once state, navigation, keyboard focus, permissions, and network timing meet in the same session.

I use Maestro for the handful of paths where a regression changes how the product feels: getting into an account, creating the first meaningful thing, and recovering when something goes wrong. The goal is not more tests; it is a short feedback loop around the promises a user actually experiences.

That distinction matters because end-to-end feedback carries real cost. It builds an app, starts a simulator or emulator, and follows the rendered interface. In return, it catches the integration seams that a fast JavaScript-only test deliberately cannot see.

E2E tests are expensive compared with unit tests, but they answer a different question. They are the last small layer of a healthy testing strategy, not the whole pyramid.

ApproachBest at catchingFeedbackUse it when
UnitBusiness rules and edge casesVery fastA result can be proven without a UI
ComponentStates, labels, and interactionsFastOne screen or component owns the behaviour
Maestro flowReal navigation and integration seamsSlowerA user must complete a journey to prove it works

The win is not that Maestro replaces everything else. It lets a small suite verify that the pieces still work together on an emulator or simulator, where the user will actually meet them.

Start with one happy path that earns its place: onboarding, sign in, or creating the first project. Before writing YAML I make the path deterministic. That usually means a test account, a known backend state, and a launch that does not depend on whatever the previous test left behind.

Maestro displaying an app smoke test flow
  1. 01

    Name the outcome

    Describe the moment that should be true at the end, not the taps needed to reach it.

  2. 02

    Control the starting state

    Clear local state and seed only the data the flow needs.

  3. 03

    Use visible language

    Target text and accessibility labels a person can recognise, not coordinates.

  4. 04

    End on evidence

    Assert the final state a user sees, such as a project name or success message.

A Maestro Flow is intentionally plain YAML: configuration first, then an ordered list of actions. That makes the test readable in a pull request and keeps it close to the language of the interface. This example checks a simple email entry point without hard-coding device coordinates or adding arbitrary sleeps.

.maestro/onboarding.yaml
appId: com.example.appname: Sign up with emailtags:  - smokeenv:  EMAIL: test@example.com
---- launchApp:    clearState: true- tapOn: "Create an account"- tapOn: "Email address"- inputText: ${EMAIL}- tapOn: "Continue"- assertVisible: "Check your inbox"

Notice the boundaries. clearState makes the start explicit, env keeps disposable test data outside the steps, and assertVisible checks the outcome rather than an internal implementation. If the flow grows beyond one story, extract the repeated part into a subflow with runFlow instead of creating one giant test.

Write flows around stable intent

Prefer a label that a person can recognise when the copy is part of the product promise. When wording is intentionally flexible, give the important control a stable identifier and let the flow target that instead. The selector should describe what the control is for, not where it happens to sit on one device.

.maestro/create-project.yaml
appId: com.example.appname: Create a first projecttags:  - smokeenv:  PROJECT_NAME: Maestro demo
---- launchApp:    clearState: true- runFlow:    file: subflows/sign-in.yaml- tapOn:    id: new-project-button- inputText: ${PROJECT_NAME}- tapOn:    id: create-project-button- assertVisible:    text: ${PROJECT_NAME}

This flow is deliberately composed from one reusable sign-in subflow and one product-specific action. It proves the new project appears by name—the outcome a person sees—rather than asserting an internal store update or a navigation event.

Flaky tests rarely need a longer timeout. They usually reveal that the flow is asking the app to begin from an ambiguous state, or that it is targeting something users cannot reliably see. Fix the boundary first; only then consider a wait.

Maestro running a review reply flow on a mobile app
SymptomUsually meansBetter move
The first tap failsState is leaking between runsLaunch with a clean, seeded state
A flow breaks after a copy editThe selector is carrying too much meaningUse a stable accessibility label or test ID
CI fails but local passesThe test depends on timing or environment dataRemove the race and log the state you expect

Good flows feel almost boring. They name what the person sees, take one decisive action, and assert the next meaningful state. That restraint is why they stay useful six months later.

In particular, let assertVisible carry ordinary loading waits. Reach for a longer, explicit wait only when the product genuinely performs work that takes longer than a normal screen transition. A timeout should document a known boundary, not hide an uncertain one.

Run the smoke suite on every pull request once it is fast enough to be trusted. For Expo projects using EAS Workflows, the useful shape is simple: build a testable app artifact, then hand that build to a Maestro job with an explicit list of flows.

.eas/workflows/e2e-android.yml
name: e2e-android
on:  pull_request:
jobs:  build_android_for_e2e:    type: build    params:      platform: android      profile: e2e-test
  maestro_test:    needs: [build_android_for_e2e]    type: maestro    params:      build_id: ${{ needs.build_android_for_e2e.outputs.build_id }}      flow_path:        - .maestro/onboarding.yaml        - .maestro/create-project.yaml

Keep the pull-request suite small: sign in, one core creation path, and one recovery path. Broader regression coverage can run nightly. This split protects the team from both extremes: waiting forever for CI, or shipping without a meaningful mobile check.

These are the references I return to when a flow needs to grow beyond its first happy path.

A useful reading order

Start with a single local Maestro flow, then connect it to an Expo EAS build. Once the flow is reliable, use the React Native testing and accessibility guidance to improve the UI language it relies on. The result is one testing system, not a separate automation project.