maestro-mobile-testing
Skill5 starsChanged 8 months agoMITView on GitHub
Maestro mobile E2E testing patterns for React Native/Expo apps: YAML test flows, testID selectors, adaptive auth state, optimistic update verification, GraalJS scripting, cross-platform stability, CI/CD integration, Maestro Cloud, and MCP server integration. Use when: write Maestro test, flaky mobile test, test my app, automate mobile testing, mobile E2E, debug test failure, Maestro setup.
- Pipes a download into a shell
- Installs packages
2 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- patinaproject/skillsedited, first seen Oct 15, 2026
- bagisto/opensource-ecommerce-mobile-appedited, first seen Oct 8, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- bagisto/opensource-ecommerce-mobile-app★ 16k16% same
- patinaproject/skills★ 116% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository29 other files it gives its agents.
- skills/architect/CLAUDE.mdCLAUDE.md
- skills/council/CLAUDE.mdCLAUDE.md
- agent-browserSkill
- app-store-screenshotsSkill
- architectSkill
- architecture-reviewerSkill
- c-cpp-analyzerSkill
- councilSkill
- c-to-rust-migrationSkill
- demo-pipelineSkill
- e2e-pipelineSkill
- founder-modeSkill
- full-evalSkill
- hackathon-jurySkill
- idea-labSkill
- ios-glass-ui-designerSkill
- learn-by-mistakeSkill
- migration-validatorSkill
- mobile-design-systemSkill
- noricum-devSkill
- oss-readinessSkill
- pdf-presentationSkill
- playwright-recordingSkill
- post-run-analysisSkill
- rust-migrationSkill
- ui-ux-polishSkill
- vc-evaluatorSkill
- webreelSkill
- youtube-devrelSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 5 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 194
Cause: No simulator/emulator running, or Maestro can't detect it.
- Very specific: line 199
Verify with maestro devices (should list at least one device)
- Very specific: line 210
Run maestro hierarchy to see all elements on screen — check if your element exists
- Very specific: line 211
Use maestro studio to interactively explore the element tree
- Very specific: line 212
Add extendedWaitUntil before the interaction (the element may need time to render)
- Very specific: line 213
Check if a native alert or permission dialog is blocking — add tapOn: text: "OK" optional: true before your step
- Very specific: line 214
Verify the testID is actually set in your React Native component (testID="my-button")
- Distinctive: line 218
Symptoms: Test passes sometimes, fails other times.
- Distinctive: line 221
Race conditions: Add auth pre-flight pattern (Pattern 2) — don't interact before auth resolves
- Very specific: line 222
Animations: Use extendedWaitUntil instead of fixed sleep calls
- Distinctive: line 223
Network dependency: Start a mock API server instead of relying on real backends
- Distinctive: line 224
iOS cold boot crash: Add the post-launch swipe (see gotchas.md)
- Very specific: line 225
Optional elements: Don't use optional: true unless the action is genuinely optional
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Maestro Mobile E2E Testing
Overview
Maestro is a declarative YAML-based mobile E2E testing framework. It provides automatic waiting, built-in retry logic, and fast execution without boilerplate. It's more stable than Detox or Appium for React Native apps.
Key Features
- Declarative YAML — no imperative test code, just steps
- Automatic waiting — no manual
sleep()or flaky waits - Built-in retry — reduces test flakiness
- Fast execution — runs quickly without setup overhead
- Maestro Studio — interactive test builder (
maestro studio) - Sub-flows — reusable YAML sequences for DRY tests
- JavaScript scripting — GraalJS runtime for HTTP calls and data manipulation
- Maestro Cloud — real device testing in CI without local simulators
Quick Start
Install
curl -Ls "https://get.maestro.mobile.dev" | bash
brew install openjdk@17
export JAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/HomeMinimal test
appId: com.myapp
---
- launchApp
- tapOn:
id: "my-button"
- assertVisible: "Expected Text"Run
maestro test .maestro/smoke-test.yaml
maestro test --debug .maestro/smoke-test.yaml # step through
maestro studio # interactive builderPattern Index
| # | Pattern | Reference |
| 1 | Selector Strategy: testID vs Text | core-patterns.md |
| 2 | Auth Pre-Flight Pattern | core-patterns.md |
| 3 | Adaptive Tests (Both Auth States) | core-patterns.md |
| 4 | Testing Optimistic Updates | core-patterns.md |
| 5 | Dismissing Native Alerts | core-patterns.md |
| 6 | Sub-Flows for Reusability | core-patterns.md |
| 7 | Deep Links (Expo) | core-patterns.md |
| 8 | Platform-Specific Logic | core-patterns.md |
| 9 | Environment Variables | core-patterns.md |
| 10 | Selector State Properties | core-patterns.md |
| 11 | Relative Position Selectors | core-patterns.md |
| - | OTP/Magic-Link Auth Testing | auth-testing.md |
| - | CI/CD & Maestro Cloud | ci-cd.md |
| - | Critical Gotchas & Platform Differences | gotchas.md |
| - | MCP Server Integration | mcp-integration.md |
Test File Template
# {Feature} {Action} Test
#
# Tests: {what this validates}
# Prerequisites:
# - Simulator/emulator running with app installed
# - Backend or mock server running (if API-dependent)
appId: com.myapp
env:
TEST_EMAIL: maestro-{feature}@example.com
EMAIL_SERVICE_URL: http://localhost:8025
---
# ==========================================
# STEP 1: LAUNCH + AUTH PRE-FLIGHT
# ==========================================
- launchApp
- swipe:
direction: DOWN
duration: 100
- extendedWaitUntil:
visible:
id: "auth-loaded"
timeout: 15000
- takeScreenshot: 01-initial-state
# ==========================================
# STEP 2: {ACTION}
# ==========================================
- tapOn:
id: "target-element"
# ==========================================
# STEP 3: VERIFY
# ==========================================
- extendedWaitUntil:
visible:
id: "expected-result"
timeout: 5000
- takeScreenshot: 02-final-stateExample Output
Running a Maestro test produces output like this:
$ maestro test .maestro/smoke-test.yaml
║
║ > Flow: .maestro/smoke-test.yaml
║
║ ✅ Launch app "com.myapp"
║ ✅ Swipe from center to bottom
║ ✅ Wait until "auth-loaded" is visible (timeout: 15s)
║ ✅ Take screenshot "01-initial-state"
║ ✅ Tap on "tab-home"
║ ✅ Wait until "dashboard-header" is visible (timeout: 5s)
║ ✅ Tap on "action-button"
║ ✅ Wait until "undo-button" is visible (timeout: 3s)
║ ✅ Take screenshot "02-final-state"
║
║ Duration: 8.2s
║ Status: ✅ PASSEDScreenshots are saved to ~/.maestro/tests/{timestamp}/.
Folder Structure
.maestro/
├── README.md # Quick reference + testID inventory
├── config.yaml # Shared configuration
├── flows/ # Reusable sub-flows
│ ├── auth-and-return.yaml
│ ├── complete-action.yaml
│ └── verify-result.yaml
├── scripts/ # GraalJS helpers
│ ├── fetch-otp.js
│ └── split-otp.js
├── smoke-test.yaml # Guest navigation
├── auth-signin.yaml # OTP sign-in flow
├── feature-screenshots.yaml # Screenshot capture flows
└── feature-action.yaml # Feature-specific tests
scripts/
├── mock-api-server.ts # Lightweight mock for E2E
└── run-e2e.sh # Orchestration scriptNaming Conventions
| Type | Pattern | Example |
| Main test | {feature}-{action}.yaml | checkout-purchase.yaml |
| Sub-flow | {action}-{context}.yaml | auth-and-return-to-dashboard.yaml |
| Script | {verb}-{noun}.js | fetch-otp.js |
Troubleshooting
Device Not Found
Error: No devices foundCause: No simulator/emulator running, or Maestro can't detect it.
Fix:
- iOS: Open Xcode > Window > Devices and Simulators > boot a simulator, or run
xcrun simctl boot "iPhone 16" - Android: Start emulator with
emulator -avd <name>or open Android Studio > Device Manager - Verify with
maestro devices(should list at least one device)
Element Not Found
Error: Element not found: id "my-button"Cause: The element hasn't rendered yet, the testID is wrong, or a native alert is blocking it.
Fix:
- Run
maestro hierarchyto see all elements on screen — check if your element exists - Use
maestro studioto interactively explore the element tree - Add
extendedWaitUntilbefore the interaction (the element may need time to render) - Check if a native alert or permission dialog is blocking — add
tapOn: text: "OK" optional: truebefore your step - Verify the testID is actually set in your React Native component (
testID="my-button")
Flaky Tests
Symptoms: Test passes sometimes, fails other times.
Common causes and fixes:
- Race conditions: Add auth pre-flight pattern (Pattern 2) — don't interact before auth resolves
- Animations: Use
extendedWaitUntilinstead of fixedsleepcalls - Network dependency: Start a mock API server instead of relying on real backends
- iOS cold boot crash: Add the post-launch swipe (see gotchas.md)
- Optional elements: Don't use
optional: trueunless the action is genuinely optional
Checklist for New Tests
[ ] Unique test email (maestro-{feature}@example.com)
[ ] Selector strategy chosen (testID for i18n, text for single-language)
[ ] Auth pre-flight pattern used (auth-loaded)
[ ] Post-launch swipe added (iOS crash prevention)
[ ] Both auth states handled (adaptive flows)
[ ] Native alerts dismissed after mutations
[ ] Short timeouts for optimistic updates (3-5s)
[ ] Sub-flows created for reusable sequences
[ ] Descriptive screenshots at key points
[ ] Header comment with prerequisites
[ ] Mock API server started if backend-dependent
[ ] Tags added for CI filtering (ci, smoke, wip)Debugging
maestro test --debug .maestro/test.yaml # Step through interactively
maestro record .maestro/test.yaml # Record as video
maestro studio # Interactive UI builder
maestro hierarchy # View element treeResources
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

