YAML Test Examples
This guide provides practical, real-world examples of YAML tests for common scenarios.Important Note About Test Execution
All tests automatically navigate to the build URL (web) or open the app (mobile) when they start. You do NOT need to include manualnavigate
or open_app
steps at the beginning of your tests.
The examples below demonstrate the correct pattern: starting with instructions, validations, or extractions.
Basic Examples
Simple Validation (Web)
Test that verifies a page loads correctly:Mobile App Validation (iOS)
Test that verifies an app launches correctly:Login Flows
Simple Login (Web)
Basic login test with hardcoded credentials:Login with High Level Instruction
Using variables for flexible credential management:Mobile Login with Biometrics Check
Login flow with conditional:Data Extraction and Validation
Extract and Verify Price
Ensuring price consistency across pages:Extract Order ID for Later Use
Capturing data for verification:Extract Multiple Values
Working with multiple extracted variables:Conditional Logic
Optional Popup Handling
Handling popups that may or may not appear:Different Paths Based on State
Branching based on user state:Nested Conditionals
Complex conditional logic:Loops and Iteration
Load All Content
Loading paginated content:Dismiss Multiple Notifications
Clearing all notifications:When Manual Navigation IS Needed
Mobile App Lifecycle Testing
Example of when close_app/open_app is appropriate:Advanced Patterns
Form Submission with Validation
Complete form flow:Search with No Results Handling
Search flow with conditional result handling:Multi-Step Checkout
Complete e-commerce checkout flow:Best Practices
Do NOT Start with Manual Navigation
Use Descriptive Variable Names
Validate After Important Actions
Related Documentation
- YAML Schema Reference - Complete schema (toggle for User/LLM view)
- Control Flow Guide - Detailed if/while usage
- Using Variables - Variable management