
What is Patrol?
Patrol is a powerful, open-source UI testing framework designed specifically for Flutter apps. Released in September 2022 and developed by LeanCode, one of the world’s leading Flutter development consultancies, Patrol builds upon Flutter’s core testing tools to enable developers to do things that were previously impossible.Native Automation
Interact with permission dialogs, notifications, WebViews, and device settings directly from your Dart tests
Custom Finders
Write cleaner, more intuitive tests with Patrol’s streamlined finder syntax
Hot Restart
Develop tests faster with hot restart support - no need to rebuild your app
Production-Ready
Battle-tested in production apps with millions of users
Why Patrol?
Flutter’s built-inintegration_test package is powerful, but it has significant limitations that make it difficult to test real-world scenarios. Patrol overcomes these limitations while providing a better developer experience.
Native Platform Access
Unlock native platform features right within your Flutter tests:- Interact with permission dialogs, notifications, and WebViews
- Modify device settings, toggle Wi-Fi, and control network conditions
- Handle system alerts and native UI elements
- Achieve all this effortlessly using plain Dart code
Intuitive Custom Finders
Say goodbye to verbose test code. Patrol’s custom finder system makes tests readable and maintainable.- With Patrol
- Without Patrol
Patrol’s custom finders are also available standalone in the patrol_finders package for use in widget tests.
Production-Grade Features
Patrol revolutionizes Flutter’s built-inintegration_test plugin:
- Full test isolation between tests prevents flaky tests
- Test sharding for parallel execution on CI/CD
- Hot Restart makes development fast and enjoyable
- Console logs provide real-time insights during test execution
- DevTools extension for inspecting Android/iOS views
Compatible with Device Farms
With Patrol’s native-like testing capabilities, you can use popular device farms:Firebase Test Lab
BrowserStack
LambdaTest
Marathon
emulator.wtf
AWS Device Farm
Platform Support
Patrol supports multiple platforms with comprehensive native automation capabilities:| Platform | Support Level | Minimum Version | Native Automation |
|---|---|---|---|
| Android | ✅ Full | API 21 (Android 5.0) | ✅ Yes |
| iOS | ✅ Full | iOS 13.0 | ✅ Yes |
| macOS | 🟡 Alpha | macOS 10.14 | ⏳ Coming soon |
| Web | ✅ Full | Modern browsers | ✅ Yes |
| Windows | ❌ Not supported | - | - |
| Linux | ❌ Not supported | - | - |
Patrol works on both physical devices and emulators/simulators for supported platforms.
Version Requirements
To use Patrol, you need:- Dart SDK: 3.8.0 or higher
- Flutter SDK: 3.32.0 or higher
- patrol package: 4.1.1 (current stable)
- patrol_cli: 4.1.0 (current stable)
How Patrol Works
Patrol consists of three main components:- Dart package (
patrol) - The test API you use in your test code - CLI tool (
patrol_cli) - Runs your tests and manages the test environment - Native automation servers - Android and iOS native code that executes platform interactions
Write tests in Dart
Use Patrol’s intuitive API to write tests that interact with both Flutter widgets and native platform features.
Native automation executes
Native servers on Android/iOS receive commands from your Dart code and execute platform interactions.
Trusted by the Flutter Community
Patrol is a fully open-source project used by developers and companies worldwide. At LeanCode, we use Patrol to test production-grade apps for clients across industries.Get Started with Patrol
Ready to write your first test? Follow our quickstart guide to set up Patrol in minutes.
Need Expert Help?
LeanCode offers end-to-end automated UI testing services tailored for Flutter apps:Learn More
Quickstart Guide
Get Patrol installed and running in your project
Write Your First Test
Follow a hands-on tutorial to write a complete test
GitHub Repository
View the source code and contribute
Join Discord
Get help from the community
Video Introduction: Watch our YouTube video for a quick introduction to Patrol.