Getting started

Define scenarios in YAML files and run E2E tests locally or in GitHub Actions without AI.

What is a YAML scenario

A format supported by @ohah/react-native-mcp-server/test: one file with platform, config, and setup / steps / teardown. MCP tools (tap, assertText, waitForText, etc.) are run as scenario steps.

Basic structure

name: Scenario name
config:
  platform: ios # ios | android
  timeout: 10000 # per-step timeout (ms)
  bundleId: org.example.app

setup:
  - launch: org.example.app
  - waitForVisible:
      selector: '#main-screen'

steps:
  - assertText:
      text: 'Count: 0'
      selector: '#counter'
  - tap:
      selector: '#increment-btn'
  - waitForText:
      text: 'Count: 1'
      timeout: 3000

teardown:
  - terminate: org.example.app
  • config: platform, timeout, bundleId
  • setup: launch app, wait for elements, etc.
  • steps: tap, input, assertions, screenshots
  • teardown: e.g. terminate app

Common steps

StepPurpose
launchLaunch app (bundleId)
terminateTerminate app
tapTap element matching selector
assertTextAssert text at selector
waitForTextWait until text appears
waitForVisibleWait until selector is visible
screenshotSave screenshot (path)

Use the app's testID as #testID for the selector.

Example: tap button and assert count

name: Press Counter tap
config:
  platform: ios
  timeout: 10000
  bundleId: org.reactnativemcp.demo

setup:
  - launch: org.reactnativemcp.demo
  - waitForVisible:
      selector: '#press-counter-button'

steps:
  - assertText:
      text: 'Count: 0'
      selector: '#press-counter-button'
  - tap:
      selector: '#press-counter-button'
  - waitForText:
      text: 'Count: 1'
      timeout: 3000
  - tap:
      selector: '#press-counter-button'
  - assertText:
      text: 'Count: 2'
      selector: '#press-counter-button'
  - screenshot:
      path: './results/counter.png'

teardown:
  - terminate: org.reactnativemcp.demo

How to run

  1. Build the MCP server: bun run build
  2. Have the app running or use launch in the scenario setup
  3. Run the test runner, e.g.:
bun run test:yaml

Or use the run script of @ohah/react-native-mcp-server/test with your YAML file. See E2E YAML Reference for full syntax, E2E Dashboard for viewing results, and E2E on GitHub Actions for CI.