Loading...
Loading...
Run Patrol E2E integration tests on macOS, iOS, Android, or Chrome. Use when writing, running, or debugging Patrol tests.
npx skill4agent add soliplex/flutter patrolpatrol--device# Run a specific test file
patrol test \
--device macos \
--target integration_test/$ARGUMENTS \
--dart-define SOLIPLEX_BACKEND_URL=http://localhost:8000
# Run all integration tests
patrol test \
--device macos \
--target integration_test/ \
--dart-define SOLIPLEX_BACKEND_URL=http://localhost:8000--ioslatest# Run on a specific iOS simulator
patrol test \
--device <DEVICE_ID> \
--target integration_test/$ARGUMENTS \
--dart-define SOLIPLEX_BACKEND_URL=http://localhost:8000
# If simulator OS != latest SDK, specify explicitly
patrol test \
--device <DEVICE_ID> \
--ios=18.6 \
--target integration_test/$ARGUMENTS \
--dart-define SOLIPLEX_BACKEND_URL=http://localhost:8000xcrun simctl list devices bootedadb devices# Boot emulator (if not running)
export ANDROID_HOME=~/Library/Android/sdk
export PATH="$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$PATH"
emulator -avd Patrol_Test_API_36 &
# Run on Android emulator
patrol test \
--device emulator-5554 \
--target integration_test/$ARGUMENTS \
--dart-define SOLIPLEX_BACKEND_URL=http://10.0.2.2:800010.0.2.2localhost# Run a specific test in Chrome
patrol test \
--device chrome \
--target integration_test/$ARGUMENTS \
--dart-define SOLIPLEX_BACKEND_URL=http://localhost:8000
# Run headless (for CI or no-GUI environments)
patrol test \
--device chrome \
--web-headless true \
--target integration_test/$ARGUMENTS \
--dart-define SOLIPLEX_BACKEND_URL=http://localhost:8000
# Custom viewport (default is browser-dependent)
patrol test \
--device chrome \
--web-viewport "1280x720" \
--target integration_test/$ARGUMENTS \
--dart-define SOLIPLEX_BACKEND_URL=http://localhost:8000$ARGUMENTSintegration_test/$ARGUMENTSsmoke_test.dart--no-auth-modepatrol --versiondart analyze integration_test/patrol testwaitForConditionharness.waitForLogtester.pump(duration)patrolTest('description', ($) async {
await verifyBackendOrFail(backendUrl);
ignoreKeyboardAssertions();
final harness = TestLogHarness();
await harness.initialize();
try {
await pumpTestApp($, harness);
// ... test body ...
} catch (e) {
harness.dumpLogs(last: 50);
rethrow;
} finally {
harness.dispose();
}
});| Target | Finder |
|---|---|
| Room list items | |
| Chat input | |
| Send button | |
| Chat messages | |
| Settings icon | |
find.bySemanticsLabelenterText| Logger | Pattern | Meaning |
|---|---|---|
| | App booted, router active |
| | Rooms API called |
| | Rooms parsed successfully |
| | AG-UI SSE stream opened |
| | First text chunk received |
| | SSE stream completed |
flutter runmcp__dart-tools__launch_appmcp__dart-tools__launch_app → starts app, returns DTD URI
mcp__dart-tools__connect_dart_tooling_daemon → connect to running app
mcp__dart-tools__get_widget_tree(summaryOnly: true) → see real widget hierarchy
mcp__dart-tools__get_app_logs(pid, maxLines: 50) → see stdout log output
mcp__dart-tools__get_runtime_errors → check for exceptions[DEBUG] Router: redirect called for /harness.expectLog()widgetRuntimeTypefind.byType()TestLogHarnessMemorySinkharness.expectLog('Router', 'redirect called')harness.waitForLog('ActiveRun', 'RUN_FINISHED')harness.dumpLogs(last: 50)[DEBUG]get_app_logsflutterdartunset GIT_DIR0.0.0-unknownscripts/| Symptom | Cause | Fix |
|---|---|---|
| "Multiple devices found" prompt | Missing | Add |
| | Add to PATH or use full path |
| Test hangs on "Waiting for app" | Entitlements missing/wrong | See macOS setup |
| GIT_DIR set in worktree | Use |
| "did not appear within 10s" | Widget in drawer, not body | See macOS setup |
| Finder matched Semantics, not TextField | Use |
| Accessibility permission denied | Entitlements changed | Re-approve in System Settings > Privacy > Accessibility |
| iOS: xcodebuild exit code 70 | | See iOS setup |
| iOS: "Device ... is not attached" | Wrong device ID format | Use UUID from |
| Android: "No connected devices" | Emulator not running or | See Android setup |
| Android: connection refused to localhost | Emulator can't reach host localhost | Use |
| Android: Gmail login prompt on boot | AVD uses Google Play image | See Android setup |
| Chrome: "Cannot find module playwright" | Node.js not installed | See Web setup |
| Chrome: CORS error in test | Backend missing CORS headers | See Web setup |
Chrome: "Failed to fetch" on | Backend offline or CORS block | Start backend; check browser console |