test-looplisted
Install: claude install-skill burhankhatri/e2e-testing
# Test Automation Loop
> The core insight: if the agent is going in circles, it needs a test — not more prompts. Write the test. Let the agent iterate against it. Walk away.
## The testing.md Pattern
Every project should have a `testing.md` at the root (or in relevant submodule folders) containing EVERYTHING the agent needs to run tests autonomously:
### Template:
```markdown
# Testing Guide
## Environment Setup
- Required env vars: [list with descriptions]
- Database: [commands to start/seed test DB]
- Services: [docker-compose, external APIs]
- Test user: [how to create/seed test data]
## Running Tests
### Unit Tests
Command: `npm test`
Location: `tests/unit/`
### Integration Tests
Command: `npm run test:integration`
Env vars needed: [list]
What they test: [scope description]
### E2E Tests (Playwright)
Command: `npx playwright test`
Setup: `npx playwright install chromium`
Base URL: [how it's configured]
Auth: [how test auth works]
Location: `tests/e2e/`
## Debugging Failed Tests
- Single test: `npm test -- -t "test name"`
- Headed browser: `npx playwright test --headed`
- Traces: `npx playwright show-trace test-results/*/trace.zip`
- Verbose: `npm test -- --verbose`
```
**Create this file FIRST** if it doesn't exist. The agent cannot iterate autonomously without it.
## The Autonomous Loop
```
1. Read testing.md
2. Set up the test environment (DB, env vars, services)
3. Ensure screenshot capture is enabled:
- Verify playwright.config.ts has screenshot: 'on'