| name | testing |
| description | Comprehensive guide for writing tests for React/frontend projects. MUST be read before planning any coding session and during every coding session. Use when planning, writing, verifying, or debugging any type of test. |
| allowed-tools | Read, Grep, Glob, Bash, mcp__playwright__browser_navigate, mcp__playwright__browser_snapshot, mcp__playwright__browser_click, mcp__playwright__browser_console_messages, mcp__playwright__browser_network_requests, mcp__playwright__browser_take_screenshot, mcp__test-coverage__coverage_summary, mcp__test-coverage__coverage_file_summary, mcp__test-coverage__start_recording, mcp__test-coverage__get_diff_since_start |
๐งช Testing Skill
A key guide on how to plan and code with testing in mind inclding how to write tests efficiently, how run/debug tests and other crucial information for any coding session. Use this skill whenever planning any development, before coding, while planning tasks, during coding, and during testing. This ensures tests are considered from the start and written correctly
๐ Skill Documents
| Document | Purpose | When to Use |
|---|---|---|
| IMPORTANT: The Test Workflow | The sequence of steps that must be followed when planning, writing, and verifying tests. | MUST be read before any feature or test coding. Follow this workflow from start to finish for any testing task - it ensures thorough context gathering before writing and proper verification after. |
| ๐ Useful Commands | Commands to start the application and run tests. | Use these commands to get the system running for investigation, run tests before adding new ones to establish baseline, and run again after writing tests to verify they pass. |
| ๐ฏ Testing Strategy & Tooling | Guidance on test types (page vs component vs unit), what outcomes to test, and which frameworks/libraries to use. | Consult during planning to decide test types, understand what to verify, and ensure you're using the recommended frameworks. |
| ๐ Test Code: Patterns & Practices | Mandatory rules and best practices for writing tests. | These rules must be read and followed every time tests are written. See detailed breakdown below. |
| ๐ง Test Tools (MCP) & Agents | MCP tools and specialized agents for testing workflows. | Reference when you need browser automation (Playwright), coverage measurement, test planning, healing failing tests, or fixing accessibility issues. Includes test-planner, test-healer, test-verifier, and page-locator-fixer agents. |
๐ Test Code: Patterns & Practices
Read The Test Anatomy before writing any test.
๐ Canonical Example: For a real, working example that demonstrates all patterns, read the test configured in config.toml under [canonical_example].
| Document | When to Use |
|---|---|
| The Test Anatomy | Mandatory first read - Core structure, 6 critical rules, AAA pattern, and examples |
| The Test Data | When working with JSONs, entities, or any test input data |
| Assertions | When writing expect statements and verifying outcomes |
| Mocking | When mocking external systems or network requests |
| Testing with DOM | When testing React components with testing-library or Playwright |
| Testing with Database | When tests interact with a real database |
| What to Test | When deciding coverage scope and edge cases |
| โ ๏ธ System-Wide E2E Best Practices | ONLY for system-wide E2E tests spanning multiple processes - NOT for unit/component/integration/page tests |