Skip to main content

Write Clear and Effective Tests

Create tests that read like well-structured guides while thoroughly examining your application. For optimal clarity and maintainability:
  • Targeted Focus – Each test should validate just one functionality or behavior, making debugging straightforward.
  • Simplicity First – Keep test steps simple.
  • Precise Assertions – Craft assertions that mirror actual user interactions, ensuring key behaviors are verified without excessive detail.

Validate Outcomes, Not Transient States

Validate what the user cares about — the result of an action, not loading spinners or transition text. Transient states may vanish before the screenshot is captured, causing flaky tests.
# BAD - transient state that may disappear
- type: validation
  step_description: "Loading spinner is visible"

# GOOD - validates the meaningful outcome
- type: validation
  step_description: "The product list is displayed"

Use Wait Blocks Sparingly

Steps have built-in retry logic — they automatically wait for elements to appear. Only add waits for known significant delays (after kill_app, system-level pauses like geofence detection).
# BAD - unnecessary wait
- type: instructions
  step_description: "Tap 'Login'"
- type: manual
  step_type: wait
  step_description: "2"
- type: validation
  step_description: "Dashboard is visible"

# GOOD - validation retries automatically
- type: instructions
  step_description: "Tap 'Login'"
- type: validation
  step_description: "Dashboard is visible"

Arrange-Act-Assert

The AAA approach offers a structured methodology for creating robust and maintainable tests:
  • Arrange - Set up the test environment
  • Act - Execute the code to test
  • Assert - Verify the results

Utilize Variables for Flexibility

Incorporating variables into your tests enhances adaptability and maintainability:
  • Data-Driven Testing – Execute tests with multiple data sets without duplicating test logic.
  • Credential Management – Reference information without hardcoding it.
  • Dynamic Content Handling – Adapt to changing content by updating variables rather than test steps.
  • Parameterization – Create more generic test steps that can be reused with different inputs.