evanca/flutter-ai-rules/patrol-e2e-testing
Claude Code and agent skill by evanca/flutter-ai-rules
- community
Checking that the SKILL.md file is still in the repository.
Use when writing E2E/integration tests, testing native interactions like permissions or system dialogs, capturing UI regressions, or validating cross-platform behavior (Patrol 4.x).
Install
npx vskill@latest install evanca/flutter-ai-rules/patrol-e2e-testingSKILL.md
Patrol E2E Testing Skill
Design, implement, and run end-to-end (E2E) tests using Patrol 4.x in Flutter projects.
When to Use
Use this skill when:
- A new screen or user flow needs E2E test coverage.
- A feature interacts with native components (permissions, notifications, system dialogs, deep links).
- A UI bug should be captured as a regression test.
- Cross-platform behavior (Android / iOS / Web) must be validated.
- Setting up Patrol in a new or existing Flutter project.
Setup
Follow the official Patrol documentation for installation and project initialization: https://patrol.leancode.co/documentation#setup
Key Patrol conventions:
- Add
patrolas a dev dependency. - Place tests in
patrol_test/. - Name test files with a
_test.dartsuffix. - Execute tests with
patrol test.
Workflow
Follow these steps when implementing or updating Patrol tests.
1. Identify the user journey
Break the feature into:
- Actions: taps, scrolls, input, navigation, deep links.
- Observable outcomes: visible text, screen changes, enabled buttons, dialogs.
Rules:
- One test per primary (happy-path) journey.
- Separate tests for critical edge cases.
- Avoid combining unrelated flows in a single test.
2. Structure the Patrol test
Basic Patrol structure:
Key concepts:
- Use
patrolTest()instead oftestWidgets(). $is the Patrol tester.- Use
$(#keyName)to find widgets byKey. - Use explicit wait conditions (e.g.,
waitUntilVisible).
3. Handle native dialogs
For OS-level permission dialogs:
Use native automation only when required by the feature.
4. Selector & interaction quick reference
Finding widgets:
Tapping:
Entering text:
Scrolling:
Native interactions:
5. Running Patrol tests
Run all tests:
Run a specific file with live reload (development mode):
Run a specific file:
Run on web:
Headless web (CI):
Filter by tags:
6. Stabilization patterns
Flaky tests undermine confidence. Apply these patterns:
- Never use
Future.delayedas a synchronization mechanism. - Use
waitUntilVisibleorwaitUntilExiststo wait for UI state. - Set
settleTimeoutinPatrolTesterConfigfor slow CI environments.
Output requirements
When applied, this skill produces:
- Patrol test(s) covering the specified feature.
- Any required widget
Keyadditions to production code. - Exact
patrol testcommand(s) to execute locally. - Notes explaining stabilization or timing decisions.
Checkpoint: Run patrol test --target <file> locally to confirm the test passes before committing.
Quality bar
A valid Patrol test must be:
- Deterministic — no arbitrary delays; uses explicit wait conditions.
- Readable — clear test name describing the user journey.
- Minimal but complete — one assertion chain per journey.
- Secret-safe — credentials loaded from
String.fromEnvironment, never hardcoded. - CI-ready — passes headless with
--web-headless trueor on emulator.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/patrol-e2e-testing/SKILL.md
Popularity
- Repository stars
- 643
- Repository forks
- 66
- 7-day trend score
- 32
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 17 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/evanca/flutter-ai-rules/patrol-e2e-testing)