Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,23 @@ pnpm exec vitest run src/compat/maestro/__tests__/replay-flow.test.ts src/compat
Run the Expo test-app flow on iOS:

```bash
pnpm test-app:start
pnpm ad --session test-app-maestro open "Expo Go" exp://127.0.0.1:8081 --platform ios --device "iPhone 17 Pro"
pnpm test-app:ios -- --device "iPhone 17 Pro"
pnpm ad --session test-app-maestro open "Agent Device Tester" --platform ios --device "iPhone 17 Pro"
pnpm ad --session test-app-maestro wait "Agent Device Tester" 30000 --platform ios --device "iPhone 17 Pro"
pnpm test-app:maestro:ios -- --session test-app-maestro -- --device "iPhone 17 Pro"
```

Use `pnpm test-app:maestro:android` for Android, passing the same extra
`agent-device` flags after `--`.
`pnpm test-app:ios` keeps Metro in the foreground after launching the app. Leave
that terminal running and run the `agent-device` and Maestro commands from a
separate terminal.

When targeting a specific Android emulator or device, build and install the
development client on that same target before running Maestro:

```bash
pnpm test-app:android -- --device "$ANDROID_DEVICE"
pnpm test-app:maestro:android -- --session test-app-maestro -- --device "$ANDROID_DEVICE"
```

## Guidelines

Expand Down
32 changes: 23 additions & 9 deletions examples/test-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,29 @@ These are the main case families this app can support without adding more screen

## Run locally

This fixture uses an Expo development build, not Expo Go. Expo's development-build
workflow installs `expo-dev-client`, builds the native app with `expo run:ios` or
`expo run:android`, and then serves JavaScript from Metro with `expo start`.
The app declares `@expo/dom-webview` directly to keep Expo's development runtime
on the SDK 56 native module; Android verification failed when the dev client
resolved an older transitive copy.

From the repo root:

```bash
pnpm test-app:install
pnpm test-app:ios
pnpm test-app:ios -- --device "iPhone 17 Pro"
```

`expo run:*` keeps Metro in the foreground after launching the app. Leave that
terminal running, then use a separate terminal for `agent-device` or Maestro
commands.

Or on Android:

```bash
pnpm test-app:install
pnpm test-app:android
pnpm test-app:android -- --device "$ANDROID_DEVICE"
```

If you prefer to work from inside the app folder:
Expand All @@ -75,7 +86,10 @@ pnpm install --ignore-workspace
pnpm android
```

Once the app is running, use `agent-device` against `Agent Device Tester` like any other target app.
After the first native build is installed, use `pnpm test-app:start` when you only
need to restart Metro for JavaScript or TypeScript changes. Once the app is
running, use `agent-device` against `Agent Device Tester` like any other target
app.

## Local Agent Device suites

Expand All @@ -102,13 +116,13 @@ underlying command directly so global flags stay before replay inputs:
node bin/agent-device.mjs test examples/test-app/replays \
--platform ios \
--device "iPhone 17 Pro" \
--env APP_TARGET=dev.expo.easagentdevice \
--env APP_TARGET=com.callstack.agentdevicelab \
--env APP_URL=<project-url> \
--artifacts-dir .tmp/test-app-replay/ios
```

Use `APP_TARGET=com.callstack.agentdevicelab` when the standalone fixture app is
installed instead of an Expo development shell.
Omit `APP_URL` when the installed development build can discover the local Metro
server from its launcher.

The Maestro prototype suite lives in `examples/test-app/maestro` and runs through
`agent-device replay --maestro`:
Expand All @@ -118,11 +132,11 @@ pnpm test-app:maestro:ios -- --open "Agent Device Tester"
pnpm test-app:maestro:android -- --open "Agent Device Tester"
```

When running through Expo Go, start the project first and pass the shell that is already showing
the app, for example:
When the development build is already open and connected to Metro, omit
`--open` and run the suite against the existing session:

```bash
pnpm test-app:maestro:ios -- --open "Expo Go"
pnpm test-app:maestro:ios
```

The suite intentionally covers the compat layer syntax used by public Maestro suites:
Expand Down
2 changes: 1 addition & 1 deletion examples/test-app/maestro/checkout-form.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
appId: host.exp.Exponent
appId: com.callstack.agentdevicelab
env:
CHECKOUT_NAME: Ada Lovelace
CHECKOUT_EMAIL: ada@example.com
Expand Down
8 changes: 5 additions & 3 deletions examples/test-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
"private": true,
"main": "expo-router/entry",
"scripts": {
"start": "expo start",
"ios": "expo start --ios",
"android": "expo start --android",
"start": "expo start --dev-client",
"ios": "expo run:ios",
"android": "expo run:android",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@expo/dom-webview": "~56.0.5",
"@expo/metro-runtime": "~56.0.15",
"expo": "~56.0.12",
"expo-constants": "56.0.18",
"expo-dev-client": "~56.0.20",
"expo-linking": "56.0.14",
"expo-router": "~56.2.11",
"expo-status-bar": "~56.0.4",
Expand Down
Loading
Loading