Testing Multi-Screen User Journeys
Write a Maestro flow that covers sign-up, onboarding, and core feature usage across multiple screens, using inputText and tapOn to drive each step.
What Is a Multi-Screen User Journey?
A user journey is a sequence of interactions that spans multiple screens to accomplish a meaningful goal. Examples include the registration journey (onboarding → email signup → profile setup → home), the purchase journey (browse → add to cart → checkout → confirmation), and the content creation journey (home → compose → preview → post).
E2E tests that cover complete journeys provide the most value because they verify that all the pieces of your app work together correctly. A unit test can confirm that a form validates correctly, but only a journey test confirms that a validated form actually navigates to the next screen.
Planning a Journey Flow
Before writing the YAML, sketch the journey on paper: which screens appear, what the user taps or types on each screen, and what the expected final state is. Identify the happy path first — the normal flow without errors — then add edge case flows for error states.
Break the journey into logical phases and comment your YAML accordingly. Comments in YAML start with #. Clear comments make the flow readable to teammates who did not write it and help you debug which phase failed when the test reports an error.
# Journey: User Registration and First Login
# Phase 1: Onboarding
# Phase 2: Sign Up Form
# Phase 3: Email Verification (mocked in dev build)
# Phase 4: Profile Setup
# Phase 5: Home Screen Verification
appId: com.example.myapp
---
# Phase 1: Onboarding
- launchApp:
clearState: true
- assertVisible:
text: 'Welcome'
- tapOn:
text: 'Create Account'All lessons in this course
- Installing Maestro and Running Your First Flow
- Assertions and Waiting for Elements
- Testing Multi-Screen User Journeys
- Maestro in CI with GitHub Actions