E2E YAML Reference
Reference for the YAML scenario syntax used by the @ohah/react-native-mcp-server test runner. One test suite per file.
File structure
config.platform:ios|android. Can be overridden by CLI-p.config.bundleId: e.g.org.example.app(iOS),com.example.app(Android). Runner starts the app after the server is up.config.orientation: iOS only. Force a GraphicsOrientation value (1=Portrait, 2=Portrait180, 3=LandscapeA, 4=LandscapeB). Omit for auto-detection viaxcrun simctl spawn.setup/teardown: Each isStep[].teardownruns even when a step fails.
Step types
The runner supports 34 step types across 8 categories. See the Steps Reference for full details on every step.
Full example
Video recording
- startRecording:
{ path?: string }— Start screen recording (idb on iOS, adb screenrecord on Android). Ifpathis omitted, saves tooutputDir/e2e-recording.mp4. Path must be under the current working directory. - stopRecording:
{}— Stop the current recording and save the file. Safe to call in teardown even when no recording was started (no-op).
Use startRecording in setup and stopRecording in teardown so the full run is captured; teardown runs even on step failure, so the recording is always stopped.
E2E CLI (@ohah/react-native-mcp-server test)
Usage
npx @ohah/react-native-mcp-server test run <path> [options]
<path>: A YAML file or a directory- Directory runs only
.yml/.yamlfiles directly under the directory (no recursive traversal).
- Directory runs only
Commands
run <path>: Run a YAML test file or a directory
Options
-p, --platform <ios|android>: Overrideconfig.platformfrom YAML.-r, --reporter <type>: Reporter type.console|junit|json|html|slack|github-pr(default:console)-o, --output <dir>: Output directory (default:./results)--slack-webhook <url>: Slack webhook URL (for-r slack; or setSLACK_WEBHOOK_URL)--report-url <url>: Report link for Slack message (e.g. CI artifact URL)-t, --timeout <ms>: Global timeout override (connection wait, etc.)-d, --device <id>: Device ID (idb/adb)--no-bail: Continue running next suites after a failure (default: bail on first suite failure)--no-auto-launch: Do not auto-launch the app increate(). Use this in CI when you pre-install the app and launch insetup(or via workflow steps).-h, --help: Show help
Examples
- Run a directory:
npx @ohah/react-native-mcp-server test run path/to/e2e/ -p ios - Run a single file:
npx @ohah/react-native-mcp-server test run path/to/suite.yaml -p android - Custom output dir:
npx @ohah/react-native-mcp-server test run e2e/ -o e2e-artifacts/yaml-results - Keep going after failure:
npx @ohah/react-native-mcp-server test run e2e/ --no-bail - CI (built artifact):
node packages/react-native-mcp-server/dist/test/cli.js run examples/demo-app/e2e/ -p ios -o e2e-artifacts/yaml-results --no-auto-launch - HTML report:
npx @ohah/react-native-mcp-server test run e2e/ -r html -o results - Slack:
npx @ohah/react-native-mcp-server test run e2e/ -r slack --slack-webhook $SLACK_WEBHOOK - GitHub PR comment: In CI,
-r github-pr -o results
Reporter types
How to verify reporters
- HTML: After running, open
output/report.htmlin a browser and check suite/step summary and failure screenshots. - Slack: Run with
-r slackand confirm the channel receives the summary and failure details. - GitHub PR: Run with
-r github-pron a PR and confirm the PR comment oroutput/pr-comment.mdbody.