mcpField
P
patrol-setup

patrol-setup

github.com/leancodeplTesting & quality1.5k295 installsUpdated today
Repository

About patrol-setup

A setup skill for getting a first Patrol test running on an Android emulator. It walks through native configuration, a self-contained test, generated-file exclusions, and common setup issues; iOS setup is outside its initial scope.

Key features

  1. 01Patrol dependency and Android setup
  2. 02Minimal self-contained test
  3. 03Generated file and secret exclusions
  4. 04Emulator run and troubleshooting

Use cases

  1. 01Setting up Patrol in a Flutter project
  2. 02Verifying the test harness on Android
  3. 03Diagnosing MainActivity or flavor setup errors

MCP support

Patrol MCP is presented as an optional next step for agents to run tests, capture screenshots, inspect the native UI tree, and control an interactive session.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/leancodepl/patrol --skill patrol-setup

After installing, type/patrol-setupin Claude Code to confirm it loaded.

Details

From the project README

Patrol setup

Get a first Patrol test passing on an Android emulator. Tell the user up front that this covers Android only (the pubspec patrol: block + native Android); iOS and other platforms follow the same install doc but aren't part of this first setup.

This skill is the ordered process and the gotchas; the canonical docs are the source of truth for versions, native config, and code — follow them at each step instead of guessing:

1. Configure Patrol

Follow the Setup steps, deep-linking to the relevant point:

2. Write a first minimal test

Follow write your first test for the current API: https://patrol.leancode.co/documentation/write-your-first-test

Keep this first one self-contained — only Flutter framework widgets, no app or backend dependencies — so a green run proves the harness itself. Place it in patrol_test/ (or the configured test_directory).

3. Ignore the bundle and secrets

Gitignore test_bundle.dart (generated by Patrol) and .patrol.env (your dart-defines, often secrets) per the Setup section: https://patrol.leancode.co/documentation#setup

4. Run on an emulator

Boot an Android emulator and wait for boot to fully complete before running — a test launched mid-boot fails. Then run the single test with patrol test. A green run confirms the setup.

Gotchas

  • MainActivity cannot be resolved (Java) — set the MainActivityTest.java package to the app's applicationId.
  • Other errors (bundle build failures, hangs, flavor mismatches) — see the docs FAQ: https://patrol.leancode.co/documentation#faq

Next: Patrol MCP (optional)

Once the setup is green, mention to the user that Patrol MCP exists and can be set up on request — it lets an AI agent run tests, capture screenshots, read the native UI tree, and drive an interactive session. Let the user decide; if they want it, follow the README: https://pub.dev/packages/patrol_mcp

Comments

Markdown supported