{"id":13549774,"url":"https://github.com/leancodepl/patrol","last_synced_at":"2026-04-09T16:20:32.938Z","repository":{"id":59889681,"uuid":"496206645","full_name":"leancodepl/patrol","owner":"leancodepl","description":"Flutter-first UI testing framework. Ready for action!","archived":false,"fork":false,"pushed_at":"2025-04-09T15:47:00.000Z","size":14646,"stargazers_count":1041,"open_issues_count":261,"forks_count":158,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-09T16:48:27.333Z","etag":null,"topics":["dart","flutter","flutter-test","greybox-testing","hacktoberfest","integration-testing","testing","ui-automation","whitebox-testing"],"latest_commit_sha":null,"homepage":"https://patrol.leancode.co","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leancodepl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":"docs/supported-platforms.mdx","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-25T11:44:09.000Z","updated_at":"2025-04-08T17:28:06.000Z","dependencies_parsed_at":"2023-09-23T03:33:53.451Z","dependency_job_id":"2de815f5-f01f-4e56-896f-bf4367463b62","html_url":"https://github.com/leancodepl/patrol","commit_stats":{"total_commits":1762,"total_committers":59,"mean_commits":"29.864406779661017","dds":0.6674233825198638,"last_synced_commit":"370a0fe808074d7edfae5cbcc48249be01c16d47"},"previous_names":[],"tags_count":382,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leancodepl%2Fpatrol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leancodepl%2Fpatrol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leancodepl%2Fpatrol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leancodepl%2Fpatrol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leancodepl","download_url":"https://codeload.github.com/leancodepl/patrol/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586065,"owners_count":21128980,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","flutter","flutter-test","greybox-testing","hacktoberfest","integration-testing","testing","ui-automation","whitebox-testing"],"created_at":"2024-08-01T12:01:25.356Z","updated_at":"2026-04-09T16:20:32.919Z","avatar_url":"https://github.com/leancodepl.png","language":"Dart","readme":"# Patrol\n\n[![patrol on pub.dev][patrol_badge]][patrol_link]\n[![patrol_cli on pub.dev][patrol_cli_badge]][patrol_cli_link]\n[![patrol_finders on pub.dev][patrol_finders_badge]][patrol_finders_link]\n[![patrol_discord]][patrol_discord_link]\n[![code style][leancode_lint_badge]][leancode_lint_link]\n[![patrol_github_stars]][patrol_github_link]\n[![patrol_x]][patrol_x_link]\n\nA powerful, multiplatform E2E UI testing framework for Flutter apps that overcomes the limitations of integration_test by handling native interactions. Developed by LeanCode since 2022, battle-tested and shaped by production-grade experience.\n\n[![Patrol promotional graphics][promo_graphics]][docs]\n\n## Learn more about Patrol:\n\n- [Our extensive documentation][docs]\n- [How Patrol 4.0 Makes Cross-Platform Flutter Testing Possible][article_4x]\n- [Simplifying Flutter Web Testing: Patrol Web][article_web]\n- [Patrol VS Code Extension - A Better Way to Run and Debug Flutter UI Tests][article_vscode]\n\n## How can we help you:\n\nPatrol is an open-source framework created and maintained by LeanCode.\nHowever, if your company wants to scale fast and accelerate Patrol’s\nadoption, we offer a set of value-added services on top of the core framework.\n\nYou can find out more below:\n\n- 🚀  [Automate Flutter app testing with Patrol][automate_flutter_app_testing_with_patrol]\n- 🚀  [Patrol Setup \u0026 Patrol Training][patrol_setup_and_training]\n\n## Patrol custom finders\n\nFlutter's finders are powerful, but not very intuitive to use.\n\nWe took them and made something awesome.\n\nThanks to Patrol's custom finders, you'll take your tests from this:\n\n```dart\ntestWidgets('signs up', (WidgetTester tester) async {\n  await tester.pumpWidget(AwesomeApp());\n  await tester.pumpAndSettle();\n\n  await tester.enterText(\n    find.byKey(Key('emailTextField')),\n    'charlie@root.me',\n  );\n  await tester.pumpAndSettle();\n\n  await tester.enterText(\n    find.byKey(Key('nameTextField')),\n    'Charlie',\n  );\n  await tester.pumpAndSettle();\n\n  await tester.enterText(\n    find.byKey(Key('passwordTextField')),\n    'ny4ncat',\n  );\n  await tester.pumpAndSettle();\n\n  await tester.tap(find.byKey(Key('termsCheckbox')));\n  await tester.pumpAndSettle();\n\n  await tester.tap(find.byKey(Key('signUpButton')));\n  await tester.pumpAndSettle();\n\n  expect(find.text('Welcome, Charlie!'), findsOneWidget);\n});\n```\n\nto this:\n\n```dart\npatrolTest('signs up', (PatrolIntegrationTester $) async {\n  await $.pumpWidgetAndSettle(AwesomeApp());\n\n  await $(#emailTextField).enterText('charlie@root.me');\n  await $(#nameTextField).enterText('Charlie');\n  await $(#passwordTextField).enterText('ny4ncat');\n  await $(#termsCheckbox).tap();\n  await $(#signUpButton).tap();\n\n  await $('Welcome, Charlie!').waitUntilVisible();\n});\n```\n\n[Learn more about custom finders in the docs][docs_finders]!\n\nPatrol's custom finders are also available standalone in [the patrol_finders\npackage][patrol_finders_link].\n\n## Patrol native automation\n\nFlutter's default [integration_test] package can't interact with the OS your\nFlutter app is running on. This makes it impossible to test many critical\nbusiness features, such as:\n\n- granting runtime permissions\n- signing into the app which through WebView or Google Services\n- tapping on notifications\n- [much more!](https://patrol.leancode.co/native/feature-parity)\n\nPatrol's native automation feature solves these problems:\n\n```dart\nvoid main() {\n  patrolTest('showtime', (PatrolIntegrationTester $) async {\n    await $.pumpWidgetAndSettle(AwesomeApp());\n    // prepare network conditions\n    await $.platform.mobile.enableCellular();\n    await $.platform.mobile.disableWifi();\n\n    // toggle system theme\n    await $.platform.mobile.enableDarkMode();\n\n    // handle native location permission request dialog\n    await $.platform.mobile.selectFineLocation();\n    await $.platform.mobile.grantPermissionWhenInUse();\n\n    // tap on the first notification\n    await $.platform.mobile.openNotifications();\n    await $.platform.mobile.tapOnNotificationByIndex(0);\n  });\n}\n\n```\n\n## CLI\n\nSee [packages/patrol_cli][github_patrol_cli].\n\nThe CLI is needed to enable Patrol's native automation feature in integration\ntests. It also makes development of integration tests much faster thanks to [Hot\nRestart].\n\nTo run widget tests, you can continue to use `flutter test`.\n\n## Package\n\nSee [packages/patrol][github_patrol].\n\n## CI/CD Workflows\n\nSee [.github/WORKFLOWS.md][github_workflows] for detailed documentation about all GitHub Actions workflows, including test schedules, Flutter versions, and deployment pipelines.\n\n## Patrol contracts generator\n\n1. (Optionally) add new request type:\n\n```dart\nclass OpenAppRequest {\n  late String appId;\n}\n```\n\n2. Add new method to `NativeAutomator`:\n\n```dart\nabstract class NativeAutomator\u003cIOSServer, AndroidServer, DartClient\u003e {\n  ...\n  void openApp(OpenAppRequest request);\n  ...\n}\n```\n\n3. Run `gen_from_schema` script, few files will be updated\n\n## Develop patrol_cli\n\nIf you have previously activated patrol_cli run:\n\n```bash\ndart pub global deactivate patrol_cli\n```\n\nthen\n\n```bash\ncd packages/patrol_cli\nflutter pub global activate -s path .\n```\n\n## 🛠️ Maintained by LeanCode\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://leancode.co/?utm_source=github.com\u0026utm_medium=referral\u0026utm_campaign=patrol-readme\"\u003e\n    \u003cimg src=\"https://leancodepublic.blob.core.windows.net/public/wide.png\" alt=\"LeanCode Logo\" height=\"100\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\nThis package is built with 💙 by **[LeanCode](https://leancode.co?utm_source=github.com\u0026utm_medium=referral\u0026utm_campaign=patrol-readme)**.\nWe are **top-tier experts** focused on Flutter Enterprise solutions.\n\n### Why LeanCode?\n\n- **Creators of [Patrol](https://patrol.leancode.co/?utm_source=github.com\u0026utm_medium=referral\u0026utm_campaign=patrol-readme)** – the next-gen testing framework for Flutter.\n\n- **Production-Ready** – We use this package in apps with millions of users.\n- **Full-Cycle Product Development** – We take your product from scratch to long-term maintenance.\n\n\u003cdiv align=\"center\"\u003e\n  \u003cbr /\u003e\n\n  **Need help with your Flutter project?**\n\n  [**👉 Hire our team**](https://leancode.co/get-estimate?utm_source=github.com\u0026utm_medium=referral\u0026utm_campaign=patrol-readme)\n  \u0026nbsp;\u0026nbsp;•\u0026nbsp;\u0026nbsp;\n  [Check our other packages](https://pub.dev/packages?q=publisher%3Aleancode.co\u0026sort=downloads)\n\n\u003c/div\u003e\n\n[patrol_badge]: https://img.shields.io/pub/v/patrol?label=patrol\n[patrol_finders_badge]: https://img.shields.io/pub/v/patrol_finders?label=patrol_finders\n[patrol_cli_badge]: https://img.shields.io/pub/v/patrol_cli?label=patrol_cli\n[leancode_lint_badge]: https://img.shields.io/badge/code%20style-leancode__lint-black\n[patrol_github_stars]: https://img.shields.io/github/stars/leancodepl/patrol\n[patrol_x]: https://img.shields.io/twitter/follow/patrol_leancode\n[patrol_discord]: https://img.shields.io/discord/1167030497612922931?color=blue\u0026logo=discord\n[patrol_link]: https://pub.dev/packages/patrol\n[patrol_finders_link]: https://pub.dev/packages/patrol_finders\n[patrol_cli_link]: https://pub.dev/packages/patrol_cli\n[leancode_lint_link]: https://pub.dev/packages/leancode_lint\n[patrol_x_link]: https://x.com/patrol_leancode\n[patrol_github_link]: https://github.com/leancodepl/patrol\n[patrol_discord_link]: https://discord.gg/ukBK5t4EZg\n[github_patrol]: https://github.com/leancodepl/patrol/tree/master/packages/patrol\n[github_patrol_cli]: https://github.com/leancodepl/patrol/tree/master/packages/patrol_cli\n[github_workflows]: https://github.com/leancodepl/patrol/blob/master/.github/WORKFLOWS.md\n[docs]: https://patrol.leancode.co/?utm_source=github.com\u0026utm_medium=referral\u0026utm_campaign=patrol-readme\n[docs_finders]: https://patrol.leancode.co/finders/overview\n[promo_graphics]: assets/promo_banner.png\n[article_web]: https://leancode.co/blog/patrol-web-support?utm_source=github.com\u0026utm_medium=referral\u0026utm_campaign=patrol-readme\n[article_4x]: https://leancode.co/blog/patrol-4-0-release?utm_source=github.com\u0026utm_medium=referral\u0026utm_campaign=patrol-readme\n[article_vscode]: https://leancode.co/blog/patrol-vs-code-extension?utm_source=github.com\u0026utm_medium=referral\u0026utm_campaign=patrol-readme\n[integration_test]: https://github.com/flutter/flutter/tree/master/packages/integration_test\n[automate_flutter_app_testing_with_patrol]: https://leancode.co/products/automated-ui-testing-in-flutter?utm_source=github.com\u0026utm_medium=referral\u0026utm_campaign=patrol-readme\n[patrol_setup_and_training]: https://leancode.co/products/patrol-setup-training?utm_source=github.com\u0026utm_medium=referral\u0026utm_campaign=patrol-readme\n","funding_links":[],"categories":["Dart","Frameworks"],"sub_categories":["Testing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleancodepl%2Fpatrol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleancodepl%2Fpatrol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleancodepl%2Fpatrol/lists"}