Last Updated: 2026-02-09 Testing Framework: Maestro Coverage: Critical user journeys
The ObjectStack Mobile app uses Maestro for End-to-End (E2E) testing. Maestro provides a simple, declarative YAML-based syntax for defining mobile app flows and is designed specifically for React Native and Flutter applications.
# macOS/Linux
curl -Ls "https://get.maestro.mobile.dev" | bash
# Verify installation
maestro --version- Xcode installed
- iOS Simulator available
xcrun simctl listshows available devices
- Android Studio installed
- Android emulator available or physical device connected
adb devicesshows connected devices
Before running E2E tests, build the app for your target platform:
# iOS
npx expo run:ios
# Android
npx expo run:androidThe E2E test suite is located in .maestro/ and consists of the following test flows:
Purpose: Verifies the complete authentication cycle.
Coverage:
- ✅ Sign in with email/password
- ✅ Landing on home screen after authentication
- ✅ Navigation to profile tab
- ✅ Sign out functionality
- ✅ Return to sign-in screen after logout
Expected Duration: ~15 seconds
How to Run:
maestro test .maestro/auth-flow.yamlPurpose: Verifies tab bar navigation and basic UI presence.
Coverage:
- ✅ Sign in first
- ✅ Navigate to Apps tab
- ✅ Navigate to Notifications tab
- ✅ Navigate to Profile tab
- ✅ Return to Home tab
Expected Duration: ~20 seconds
How to Run:
maestro test .maestro/app-navigation.yamlPurpose: Verifies object list view rendering and interactions.
Coverage:
- ✅ Navigate to an object list view
- ✅ Verify records are displayed
- ✅ Search functionality
- ✅ Sort functionality
- ✅ Filter drawer (if implemented)
- ✅ Pull-to-refresh
Expected Duration: ~25 seconds
How to Run:
maestro test .maestro/record-list.yamlPurpose: Verifies create, read, update, and delete operations.
Coverage:
- ✅ Create a new record
- ✅ View record details
- ✅ Edit a record
- ✅ Delete a record
- ✅ Verify changes persist
Expected Duration: ~30 seconds
How to Run:
maestro test .maestro/record-crud.yamlmaestro test .maestro/This will execute all YAML files in the .maestro/ directory in alphabetical order.
maestro test .maestro/auth-flow.yamlMaestro can record your test execution as a video:
maestro test --format junit .maestro/Maestro can be integrated into GitHub Actions or other CI/CD pipelines:
# Example GitHub Actions workflow
- name: Run Maestro Tests
uses: mobile-dev-inc/action-maestro-cloud@v1
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: app.ipa # or app.apkE2E tests assume a running ObjectStack backend server with:
-
Test User Account:
- Email:
test@example.com - Password:
password123
- Email:
-
Sample Objects:
- At least one installed package with objects
- Sample records for testing CRUD operations
-
Server Configuration:
- Server must be accessible from the mobile device/simulator
- API endpoint configured in app (e.g.,
https://demo.objectstack.devorhttp://localhost:3000)
For local testing, you can use the ObjectStack test environment:
# Option 1: Use demo server
export OBJECTSTACK_API_URL=https://demo.objectstack.dev
# Option 2: Run local server
cd ../objectstack-server
npm run dev
# Update app.config.ts to point to local server
# extra.apiUrl = "http://localhost:3000"Solution: Make sure the app is installed on the simulator/emulator:
# iOS
npx expo run:ios
# Android
npx expo run:androidSolution: Increase timeout values in YAML:
- assertVisible:
text: "Home"
timeout: 15000 # Increased from default 10000msSolution: Verify test credentials exist in the backend:
- Email:
test@example.com - Password:
password123
Or update credentials in all test YAML files to match your environment.
Solution:
- Close other apps on simulator/emulator
- Use a release build instead of debug build
- Reduce animations in simulator settings
-
Enable Debug Logs:
maestro test --debug .maestro/auth-flow.yaml -
Run in Studio Mode (Interactive):
maestro studio
This opens an interactive UI where you can manually execute commands and build flows.
-
Take Screenshots: Add to your YAML:
- takeScreenshot: debug-screenshot
-
Add Wait Commands: If tests are flaky, add explicit waits:
- waitForAnimationToEnd
Based on the ROADMAP, the following features should be covered by E2E tests:
- Authentication (sign in/sign out)
- Tab navigation
- App discovery
- Object list views
- Record CRUD operations
- Search and filtering
- Sorting
- Batch operations
- File upload/download
- Offline mode
- Biometric authentication
To add new test flows:
- Create a new YAML file in
.maestro/(e.g.,offline-mode.yaml) - Follow the Maestro YAML syntax
- Test locally with
maestro test .maestro/offline-mode.yaml - Add to this documentation
Example template:
# New Flow
appId: com.objectstack.mobile
---
- launchApp
- assertVisible: "Expected Element"
# Add your test steps hereEach test should be able to run standalone without depending on others:
# ✅ Good: Start fresh each time
- launchApp
- clearState # or clearKeychain on iOS
# ❌ Bad: Assume previous test stateDon't rely on implicit timing:
# ✅ Good: Wait for specific element
- assertVisible:
text: "Dashboard"
timeout: 10000
# ❌ Bad: Generic sleep
- sleep: 5000Focus on critical user journeys before edge cases:
- Sign in → Browse → CRUD → Sign out
Use unique, descriptive text for UI elements to make tests maintainable.
If tests create data, clean it up:
# Create record
- tapOn: "New Record"
# ... test steps ...
# Clean up
- tapOn: "Delete"
- tapOn: "Confirm"name: E2E Tests
on:
pull_request:
push:
branches: [main, develop]
jobs:
e2e-ios:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: pnpm install
- name: Build iOS app
run: npx expo run:ios --configuration Release
- name: Install Maestro
run: curl -Ls "https://get.maestro.mobile.dev" | bash
- name: Run E2E tests
run: maestro test .maestro/
e2e-android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
- name: Install dependencies
run: pnpm install
- name: Build Android app
run: npx expo run:android --variant Release
- name: Install Maestro
run: curl -Ls "https://get.maestro.mobile.dev" | bash
- name: Run E2E tests
run: maestro test .maestro/To complete Phase 6.3 (Final Optimization), the following E2E test work is recommended:
-
Enhance Existing Flows:
- Add more assertions to verify UI state
- Test error scenarios (invalid login, network errors)
- Add performance timing measurements
-
Add New Test Flows:
file-upload.yaml- Test file picker and uploadoffline-sync.yaml- Test offline mode and syncbiometric-auth.yaml- Test Face ID/Touch IDbatch-operations.yaml- Test multi-select and batch delete
-
Setup CI/CD:
- Configure GitHub Actions workflow
- Set up test environment/backend
- Configure secrets for test credentials
-
Test Metrics:
- Track test execution time
- Monitor flaky tests
- Generate test reports