patrol-write-test
Installation
SKILL.md
If the project's Patrol tests use LeanCode's Modules/System/ApiClients architecture (e.g. a patrol_test/modules/ directory and a testApp wrapper), also follow patrol-test-architecture, which builds on this skill and wins where the two differ.
Order of actions when writing new tests
- Inspect existing test code for functions that can be reused
- Also think if one of existing functions can be adjusted to match its existing usage and new test
- Assign test keys to required elements if they are not assigned yet
- Start writing test: reuse existing functions + put new test steps in new test file
- Write patrol actions directly in the test file, do not create new methods
- Run the test frequently during development — don't wait until the full test is written. Run after completing each logical group of steps to catch failures early
- After full test passes, reorganize new code into reusable functions
- Rerun the test after reorganizing to confirm it still passes
Patrol MCP Usage
When working with Patrol tests: