Patrol
Integration and UI testing framework for Flutter that extends Flutter's built-in integration_test package with native interaction capabilities. Patrol solves Flutter integration test's biggest limitation: the inability to interact with native OS dialogs (permission prompts, notifications, system alerts, keyboard). Key features: native UI interaction (tap system permission dialogs), notification testing, deep link testing, uninstall/reinstall apps, and a parallel test runner (patrol_cli). Works alongside Flutter Driver and integration_test but adds native OS layer access.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
Test framework — no production security concerns. CI device access must be restricted. Test credentials should use test-specific accounts. Permission grants during tests should be revoked after test run.
⚡ Reliability
Best When
You're writing Flutter integration tests that need to interact with native OS dialogs (permissions, notifications, system alerts) — Patrol is the only Flutter-native solution for testing these interactions.
Avoid When
Your tests don't need native OS interactions (use integration_test directly), you need non-Flutter app testing, or your CI doesn't have iOS/Android simulators.
Use Cases
- • Test agent app permission flows in Flutter — grant/deny camera, microphone, or location permissions using Patrol's native dialog interaction that integration_test cannot access
- • Automate end-to-end agent onboarding flows that include push notification permission prompts — Patrol can tap iOS/Android permission dialogs during test execution
- • Run Flutter integration tests in parallel across devices using patrol_cli — scale agent app E2E test suite with parallel execution on multiple simulator/emulator instances
- • Test deep link handling in agent apps — Patrol can open custom URL schemes and universal links to test agent deep link routing
- • Verify agent background processing and notification delivery — Patrol can interact with notification banners and verify notification content in the device notification tray
Not For
- • Unit and widget tests — Patrol is for integration/E2E tests that require device or simulator; use flutter_test for unit and widget tests
- • Non-Flutter native apps — Patrol is Flutter-specific; use Detox (React Native), XCUITest (iOS), or Espresso (Android) for native app testing
- • Simple integration tests without native interactions — Flutter's built-in integration_test package is simpler if you don't need to interact with system dialogs or notifications
Interface
Authentication
Testing framework — no auth concepts. Tests authenticate via the app under test, not Patrol itself.
Pricing
Patrol is Apache 2.0 licensed, maintained by LeanCode. Free for all use.
Agent Metadata
Known Gotchas
- ⚠ patrol_cli required for parallel execution — `patrol test` via patrol_cli handles device discovery and parallel runs; running tests with `flutter test integration_test/` misses Patrol's native bridging layer
- ⚠ Native permissions persist between test runs — iOS/Android device permission state carries across test sessions; use $.native.grantPermissionWhenInUse() explicitly in test setup and revoke after; CI should reset app between test suites
- ⚠ iOS requires physical device or simulator with hardware permissions — certain permission dialogs (Face ID, NFC) only appear on physical devices; plan test matrix accordingly
- ⚠ Patrol version alignment — patrol, patrol_cli, and patrol_finders must have compatible versions; version mismatch causes cryptic gRPC bridge errors between test runner and device agent
- ⚠ Flutter integration_test coexistence — Patrol extends integration_test but adds its own server on device; both must be configured; patrolTest() wraps integration test runner — don't mix patrolTest and testWidgets in same file
- ⚠ Simulator notification permissions require OS version — iOS 16+ changed notification permission dialog behavior; Patrol's native interaction for notifications may vary by iOS version; test on representative OS versions
Alternatives
Full Evaluation Report
Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for Patrol.
Scores are editorial opinions as of 2026-03-06.