tests/e2e/. This guide explains the test format so you can understand, modify, and create tests manually.
File Location & Naming
Tests are stored in:tests/e2e/
Example paths:
Basic Structure
Here’s a minimal test:Full Test Example
Here’s a realistic, complete test:Section Breakdown
name & description
- name: Short title for the test (appears in test lists)
- description: Longer explanation of what the test does (for documentation)
preconditions
| Field | Type | Default | Description |
|---|---|---|---|
appLaunch | boolean | true | Whether to launch the app at the start |
clearData | boolean | false | Clear app data (like signing out users) |
clearCache | boolean | false | Clear app cache files |
steps
The sequence of actions to perform:Step Actions
tap- Taps/clicks an element
target: Text description of the element (vision-based detection)timeout: Maximum milliseconds to wait for element
- Types text into a focused input field
value: Text to typetimeout: Maximum milliseconds to wait
- Scrolls the screen
direction:"up","down","left", or"right"amount: Number of scroll swipestimeout: Maximum milliseconds to wait
- Pauses execution
timeout: Milliseconds to wait
- Performs a swipe gesture
direction:"up","down","left", or"right"speed:"slow"or"fast"
- Long-press/hold on an element
target: Element to pressduration: Milliseconds to holdtimeout: Max wait for element
assertions
Verifications that confirm expected behavior:Assertion Types
text visibility- Checks that specific text is visible on screen
- Checks that an element exists (regardless of visibility)
- Checks that an element is NOT present
- Checks that the current URL contains a string (web apps)
config
Test configuration options:| Field | Type | Default | Description |
|---|---|---|---|
useAIFallback | boolean | true | Use AI vision if element not found |
screenshotOnFailure | boolean | true | Capture screenshot when test fails |
retryOnFailure | number | 0 | Retry count if test fails |
Real-World Examples
Example 1: Search Flow
Example 2: Onboarding Flow
Example 3: Navigation Test
Best Practices
Naming Targets
OpenTester uses vision-based element detection, so be descriptive: ✅ Good target names:"Login button""Email input field""Username text at top of screen""Settings gear icon"
"button""element""something"
Timeouts
Set appropriate timeouts based on action:- Quick actions (tap):
3000-5000ms - Network requests:
5000-10000ms - App transitions:
2000-3000ms
Step Best Practices
- Add waits after actions that load new screens
- Use meaningful timeout values
- Keep steps sequential and simple
- Avoid testing too many things in one test
Assertion Best Practices
- Include multiple assertions to verify complete state
- Use specific text rather than generic messages
- Include timeouts for network-dependent assertions
Creating Tests Manually
You can create tests by hand if needed:- Create a
.jsonfile intests/e2e/ - Use the structure from this guide
- Run the test with OpenTester
Schema Validation
OpenTester validates test files on load. Invalid tests will show errors. Common issues:- Missing
namefield - Invalid action names
- Missing
targeton tap/scroll actions - Assertion type not recognized
Modifying Existing Tests
You can edit tests directly in your editor:- Open the test file in
tests/e2e/ - Modify steps or assertions
- Save and validate with OpenTester
- Commit to version control
- Fixing element targets (if UI changed)
- Adding new assertions
- Adjusting timeouts
- Updating test descriptions
