Creates and maintains Maestro E2E tests
Creates and maintains Maestro E2E tests for React Native apps. Use it to write YAML test flows for mobile gestures, platform-specific tests, and visual regressions, then verify changes with linting and type-checking.
/plugin marketplace add IvanTorresEdge/molcajete.ai/plugin install react-native@Molcajete.aiCreates and maintains Maestro E2E tests for React Native.
MUST reference these skills for guidance:
maestro-testing skill:
post-change-verification skill:
<pkg> run format to format code
c. Run <pkg> run lint to lint code (ZERO warnings required)
d. Run <pkg> run type-check for type verification (ZERO errors required)
e. Run maestro test for affected E2E tests
f. Document any pre-existing issues not caused by this change# macOS/Linux
curl -Ls "https://get.maestro.mobile.dev" | bash
# Verify installation
maestro -v
__tests__/
└── e2e/
├── login_flow.yaml
├── signup_flow.yaml
├── navigation_flow.yaml
└── checkout_flow.yaml
# __tests__/e2e/login_flow.yaml
appId: com.myapp
---
- launchApp
- tapOn: "Email"
- inputText: "test@example.com"
- tapOn: "Password"
- inputText: "password123"
- tapOn: "Sign In"
- assertVisible: "Welcome"
- takeScreenshot: login_success
# __tests__/e2e/navigation_flow.yaml
appId: com.myapp
---
- launchApp
# Navigate through tabs
- tapOn:
id: "tab-home"
- assertVisible: "Home"
- tapOn:
id: "tab-search"
- assertVisible: "Search"
- tapOn:
id: "tab-profile"
- assertVisible: "Profile"
# __tests__/e2e/form_validation.yaml
appId: com.myapp
---
- launchApp
- tapOn: "Sign Up"
# Test empty submission
- tapOn: "Submit"
- assertVisible: "Email is required"
# Test invalid email
- tapOn: "Email"
- inputText: "invalid-email"
- tapOn: "Submit"
- assertVisible: "Invalid email"
# Test valid submission
- clearText
- inputText: "valid@example.com"
- tapOn: "Password"
- inputText: "ValidPass123"
- tapOn: "Submit"
- assertVisible: "Success"
- scroll
- assertVisible: "Item at bottom"
# Scroll until visible
- scrollUntilVisible:
element: "Target Item"
direction: DOWN
timeout: 10000
- runFlow:
when:
visible: "Accept Cookies"
file: dismiss_cookies.yaml
- tapOn: "Continue"
- waitForAnimationToEnd
- extendedWaitUntil:
visible: "Data Loaded"
timeout: 15000
# iOS-specific
- runFlow:
when:
platform: iOS
commands:
- tapOn: "iOS Settings"
# Android-specific
- runFlow:
when:
platform: Android
commands:
- tapOn: "Android Settings"
# Swipe left to delete
- swipe:
direction: LEFT
start: "Item to delete"
# Swipe down to refresh
- swipe:
direction: DOWN
start:
above: "First Item"
appId: ${APP_ID}
---
- launchApp
- tapOn: "Email"
- inputText: ${TEST_EMAIL}
- tapOn: "Password"
- inputText: ${TEST_PASSWORD}
# Run with variables
TEST_EMAIL=test@example.com TEST_PASSWORD=pass123 maestro test login.yaml
# flows/login.yaml
- tapOn: "Email"
- inputText: ${email}
- tapOn: "Password"
- inputText: ${password}
- tapOn: "Sign In"
# main_test.yaml
- runFlow:
file: flows/login.yaml
env:
email: "test@example.com"
password: "password123"
maestro test __tests__/e2e/login_flow.yaml
maestro test __tests__/e2e/
# iOS
maestro test __tests__/e2e/ --platform ios
# Android
maestro test __tests__/e2e/ --platform android
maestro test __tests__/e2e/ --format junit --output test-results/
# .github/workflows/e2e.yml
name: E2E Tests
on: [push, pull_request]
jobs:
e2e:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Maestro
run: |
curl -Ls "https://get.maestro.mobile.dev" | bash
echo "$HOME/.maestro/bin" >> $GITHUB_PATH
- name: Build iOS App
run: |
npx expo prebuild --platform ios
xcodebuild -workspace ios/*.xcworkspace -scheme MyApp -configuration Debug -sdk iphonesimulator -derivedDataPath build
- name: Run Maestro Tests
run: |
maestro test __tests__/e2e/ --format junit --output test-results/
- name: Upload Results
uses: actions/upload-artifact@v3
with:
name: e2e-results
path: test-results/
# Good: Descriptive file names
login_successful.yaml
login_invalid_credentials.yaml
signup_new_user.yaml
# Good: Use comments
# Test: User can log in with valid credentials
- launchApp
- tapOn: "Email"
# Use accessibility labels for reliable selection
- tapOn:
id: "login-button" # accessibilityLabel
# Avoid fragile selectors
# ❌ Bad: Text that might change
- tapOn: "Click here to log in!"
# ✅ Good: Stable ID
- tapOn:
id: "submit-btn"
# Take screenshots at key points
- takeScreenshot: before_action
- tapOn: "Submit"
- takeScreenshot: after_action
# Compare visually in CI
You are an elite AI agent architect specializing in crafting high-performance agent configurations. Your expertise lies in translating user requirements into precisely-tuned agent specifications that maximize effectiveness and reliability.