{"slug":"mobile-testing-maestro","title":"mobile-testing-maestro","summary":"Maestro mobile E2E testing - YAML flows, selectors, flow control, environment variables, JavaScript expressions, device interactions, Maestro Studio, Maestro Cloud CI, tags, test suites","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-09-29T15:28:16.636323Z","repo":{"url":"https://github.com/agents-inc/skills","stars":26,"forks":8,"license":"MIT","updatedAt":"2026-10-27T00:00:49Z"},"bodyHtml":"<hr>\n<h2>name: mobile-testing-maestro\ndescription: Maestro mobile E2E testing - YAML flows, selectors, flow control, environment variables, JavaScript expressions, device interactions, Maestro Studio, Maestro Cloud CI, tags, test suites</h2>\n<h1>Maestro Mobile UI Testing Patterns</h1>\n<blockquote>\n<p><strong>Quick Guide:</strong> Write E2E tests as declarative YAML flows. Use <code>id</code> selectors for stable element targeting (not text that changes with localization). Use <code>runFlow</code> to compose reusable subflows (login, setup). Use <code>waitForAnimationToEnd</code> before assertions on animated screens. Use <code>onFlowStart</code>/<code>onFlowComplete</code> hooks for setup/teardown. Maestro auto-retries assertions for up to 7 seconds before failing. Current stable: CLI 2.4.0.</p>\n</blockquote>\n<hr>\n<p>&lt;critical_requirements&gt;</p>\n<h2>CRITICAL: Before Using This Skill</h2>\n<blockquote>\n<p><strong>All code must follow project conventions in CLAUDE.md</strong> (kebab-case, named exports, import ordering, <code>import type</code>, named constants)</p>\n</blockquote>\n<p><strong>(You MUST use <code>id</code> selectors (accessibility identifiers) as primary selectors - text selectors break with localization or copy changes)</strong></p>\n<p><strong>(You MUST use <code>runFlow</code> for reusable sequences (login, onboarding) - NEVER duplicate steps across flow files)</strong></p>\n<p><strong>(You MUST use <code>waitForAnimationToEnd</code> before assertions on screens with animations or transitions - assertions on animated elements are flaky)</strong></p>\n<p><strong>(You MUST pair every <code>startRecording</code> with a <code>stopRecording</code> - unpaired commands produce corrupted or missing video files)</strong></p>\n<p><strong>(You MUST use environment variables or <code>env</code> blocks for credentials and environment-specific values - NEVER hardcode secrets in YAML flows)</strong></p>\n<p>&lt;/critical_requirements&gt;</p>\n<hr>\n<p><strong>Auto-detection:</strong> Maestro, maestro, .maestro, maestro test, maestro cloud, maestro studio, launchApp, tapOn, assertVisible, assertNotVisible, inputText, scrollUntilVisible, runFlow, evalScript, runScript, swipe, hideKeyboard, waitForAnimationToEnd, onFlowStart, onFlowComplete, maestro.yaml, config.yaml tags</p>\n<p><strong>When to use:</strong></p>\n<ul>\n<li>Writing E2E UI tests for iOS and Android mobile apps</li>\n<li>Automating user workflows (login, checkout, onboarding) with YAML flows</li>\n<li>Testing cross-platform behavior from a single flow file</li>\n<li>Running mobile tests in CI with Maestro Cloud</li>\n<li>Recording test execution for debugging or documentation</li>\n<li>Testing deep links, location, permissions, and device interactions</li>\n</ul>\n<p><strong>When NOT to use:</strong></p>\n<ul>\n<li>Unit testing business logic (use your unit test framework)</li>\n<li>API-only testing without UI (use direct HTTP tests)</li>\n<li>Testing web-only applications without mobile component</li>\n<li>Performance profiling or load testing (Maestro is for functional UI flows)</li>\n</ul>\n<p><strong>Key patterns covered:</strong></p>\n<ul>\n<li>Flow structure with appId, YAML commands, and selectors</li>\n<li>Selector strategies: id (preferred), text, point, relational, state</li>\n<li>Flow control: runFlow, repeat, retry, conditions (when), hooks</li>\n<li>Environment variables and parameterized flows</li>\n<li>JavaScript expressions: inline <code>${}</code>, evalScript, runScript, output object</li>\n<li>Device interactions: swipe, scroll, setLocation, openLink, permissions</li>\n<li>Workspace configuration: tags, test discovery, execution order</li>\n<li>Maestro Studio for visual flow creation and element inspection</li>\n<li>Maestro Cloud for CI integration with GitHub Actions</li>\n</ul>\n<p><strong>Detailed Resources:</strong></p>\n<ul>\n<li><a href=\"examples/core.md\">examples/core.md</a> - Flow structure, selectors, assertions, input, navigation</li>\n<li><a href=\"examples/flow-control.md\">examples/flow-control.md</a> - runFlow, repeat, retry, conditions, hooks, JavaScript</li>\n<li><a href=\"examples/device-interactions.md\">examples/device-interactions.md</a> - Swipe, scroll, location, links, permissions, recording</li>\n<li><a href=\"reference.md\">reference.md</a> - Command reference, CLI commands, workspace config, decision frameworks</li>\n</ul>\n<hr>\n\n<hr>\n\n<hr>\n<p>&lt;decision_framework&gt;</p>\n<h2>Decision Framework</h2>\n<h3>Selector Choice</h3>\n<pre><code>Can you add an accessibility identifier (testID/accessibilityIdentifier)?\n|-- YES -&gt; Use id selector (most stable)\n+-- NO  -&gt; Is the text static and unique on screen?\n    |-- YES -&gt; Use text selector\n    +-- NO  -&gt; Is there a unique parent or sibling?\n        |-- YES -&gt; Use relational selector (below, childOf, etc.)\n        +-- NO  -&gt; Use point selector as last resort (fragile)\n</code></pre>\n<h3>Flow Organization</h3>\n<pre><code>Is this sequence used in 2+ flows?\n|-- YES -&gt; Extract to subflows/ directory, call with runFlow\n+-- NO  -&gt; Keep inline in the flow\n\nDoes the flow need setup/teardown?\n|-- YES -&gt; For ALL flows: use onFlowStart/onFlowComplete in config.yaml\n|          For ONE flow: use runFlow at start/end of that flow\n+-- NO  -&gt; Start with launchApp directly\n\nIs there platform-specific behavior?\n|-- YES -&gt; Use when: platform: Android/iOS conditions\n+-- NO  -&gt; Single flow handles both platforms\n</code></pre>\n<h3>When to Use JavaScript</h3>\n<pre><code>Need a dynamic value (timestamp, random ID)?\n|-- YES -&gt; Inline ${} expression (e.g., ${Date.now()})\n+-- NO  -&gt; Need to compute and store a value?\n    |-- YES -&gt; evalScript for simple computation\n    +-- NO  -&gt; Need HTTP calls, file I/O, or complex logic?\n        |-- YES -&gt; runScript with external .js file\n        +-- NO  -&gt; Plain YAML commands are sufficient\n</code></pre>\n<p>&lt;/decision_framework&gt;</p>\n<hr>\n<p>&lt;red_flags&gt;</p>\n<h2>RED FLAGS</h2>\n<p><strong>High Priority Issues:</strong></p>\n<ul>\n<li>Using <code>text</code> selectors for buttons/labels that will be localized - breaks when language changes. Use <code>id</code> (accessibility identifiers) instead.</li>\n<li>Duplicating login/setup steps in every flow file - extract to subflow and call with <code>runFlow</code></li>\n<li>Missing <code>stopRecording</code> after <code>startRecording</code> - produces corrupted or zero-byte video files</li>\n<li>Hardcoding credentials or API keys in YAML flow files - use environment variables with <code>-e</code> or <code>MAESTRO_</code> prefix</li>\n<li>Using arbitrary <code>sleep</code> or <code>extendedWaitUntil</code> with long timeouts instead of <code>waitForAnimationToEnd</code> - Maestro's built-in tolerance handles most timing issues automatically</li>\n</ul>\n<p><strong>Medium Priority Issues:</strong></p>\n<ul>\n<li>Not using <code>clearState</code> or <code>clearKeychain</code> in setup - test results depend on leftover app state from previous runs</li>\n<li>Not using <code>tags</code> for flow categorization - makes it impossible to run targeted subsets (smoke, regression, etc.)</li>\n<li>Using <code>point</code> selectors (coordinates) as primary strategy - breaks on different screen sizes and resolutions</li>\n<li>Not using <code>label</code> on runFlow calls - test reports show file paths instead of meaningful step descriptions</li>\n<li>Putting all flows in the root directory without subdirectories - becomes unmanageable beyond 20+ flows</li>\n</ul>\n<p><strong>Gotchas and Edge Cases:</strong></p>\n<ul>\n<li><code>assertVisible</code> auto-retries for 7 seconds before failing - this is a feature, not a bug. Don't add explicit waits before assertions.</li>\n<li>CLI parameters are always strings - use <code>parseInt()</code> or comparison in JavaScript if you need numeric logic</li>\n<li><code>MAESTRO_</code> prefixed shell variables are automatically available in flows but only via CLI, not Maestro Studio</li>\n<li>The string <code>\"false\"</code> is truthy in JavaScript - use explicit <code>=== \"true\"</code> comparison in <code>when: true:</code> conditions</li>\n<li><code>onFlowComplete</code> runs even when the flow fails - design teardown logic that doesn't assume success</li>\n<li><code>runFlow</code> with <code>commands</code> (inline) and <code>runFlow</code> with <code>file</code> (external) are mutually exclusive - you cannot use both in the same runFlow call</li>\n<li>Template literals (backticks) do not work inside <code>evalScript</code> because the command is already wrapped in <code>${}</code> - use string concatenation instead</li>\n<li><code>console.log</code> in <code>evalScript</code> writes to <code>maestro.log</code>, not the terminal - use <code>runScript</code> for terminal-visible logging</li>\n<li><code>retry</code> maxRetries is capped at 3 - for more attempts, restructure the flow logic</li>\n<li>Maestro Cloud <code>--async</code> flag returns immediately without waiting for results - poll the API or use webhooks for completion</li>\n<li>FlashList / RecyclerView items may not have stable accessibility IDs - use <code>scrollUntilVisible</code> with text fallback for list items</li>\n</ul>\n<p>&lt;/red_flags&gt;</p>\n<hr>\n<p>&lt;critical_reminders&gt;</p>\n<h2>CRITICAL REMINDERS</h2>\n<blockquote>\n<p><strong>All code must follow project conventions in CLAUDE.md</strong></p>\n</blockquote>\n<p><strong>(You MUST use <code>id</code> selectors (accessibility identifiers) as primary selectors - text selectors break with localization or copy changes)</strong></p>\n<p><strong>(You MUST use <code>runFlow</code> for reusable sequences (login, onboarding) - NEVER duplicate steps across flow files)</strong></p>\n<p><strong>(You MUST use <code>waitForAnimationToEnd</code> before assertions on screens with animations or transitions - assertions on animated elements are flaky)</strong></p>\n<p><strong>(You MUST pair every <code>startRecording</code> with a <code>stopRecording</code> - unpaired commands produce corrupted or missing video files)</strong></p>\n<p><strong>(You MUST use environment variables or <code>env</code> blocks for credentials and environment-specific values - NEVER hardcode secrets in YAML flows)</strong></p>\n<p><strong>Failure to follow these rules will produce flaky tests, broken recordings, and security-exposed credentials in version control.</strong></p>\n<p>&lt;/critical_reminders&gt;</p>\n","files":[{"path":"examples/core.md","sizeBytes":6621,"isText":true},{"path":"examples/device-interactions.md","sizeBytes":7003,"isText":true},{"path":"examples/flow-control.md","sizeBytes":8920,"isText":true},{"path":"reference.md","sizeBytes":8997,"isText":true},{"path":"SKILL.md","sizeBytes":16647,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"notes-only","suspicious":0,"notes":1,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-10-24T19:01:20.562255Z","sha256":"226584FFA3265F28861E5DE5D644D060606497318B79965657FCF2D4F1CE43CC","sizeBytes":18648},"review":null,"source":{"repositoryUrl":"https://github.com/agents-inc/skills","path":"dist/plugins/mobile-testing-maestro/skills/mobile-testing-maestro","license":"MIT","commit":"845a1f2833eedc494bb82e3172710c06cab547a1","subtreeSha":"10E27D9D01F37666AC612F6A70419021FE1A38CEF84134172D5485088E615936","lastSyncedAt":"2026-11-14T00:39:21.716782Z"},"reviewedAt":"2026-10-24T19:10:22.749579Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/agents-inc/skills/tree/main/dist/plugins/mobile-testing-maestro/skills/mobile-testing-maestro"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install agents-inc-skills@llmmart"},{"target":"git","command":"git clone https://github.com/agents-inc/skills.git"}]}