---
name: webapp-testing
description: ALWAYS use this when the task involves browser automation, UI verification, DOM inspection, end-to-end checks, or reproducing a web bug in a running application.
Web App Testing
Selective Reading Rule
Start with:
references/usage-routing.md
references/quality-checklist.md
Then load only the inherited docs, scripts, assets, or examples that match the user's actual task.
Core Rule
Discover first, then automate. Do not guess selectors or page state before checking the rendered application.
Selective Reading Rule
Start with:
references/senior-master-standard.md
references/selector-strategy.md
references/flake-triage.md
Then use examples/ only for patterns you actually need.
Decision Tree
- If the target is static HTML, read the file directly to discover likely selectors.
- If the target is a dynamic app, wait for the rendered state before inspecting the DOM.
- If a local server is needed, use
scripts/with_server.py to manage it instead of hand-rolling startup logic.
Testing Workflow
- Map the surface area.
- Identify routes, important pages, key components, and critical user journeys.
- Inspect before acting.
- Wait for
networkidle on dynamic pages before reading DOM state.
- Capture screenshots, page content, console logs, or element inventories to discover selectors.
- Automate critical flows.
- Cover happy paths first.
- Then test auth, high-value actions, and important error states.
- Review failures.
- Prefer root-cause fixes over adding waits.
Best Practices
- Test behavior rather than implementation details.
- Prefer stable selectors such as role, text, label, or
data-testid.
- Keep tests independent and state-aware.
- Use screenshots and traces when failures are hard to explain from logs alone.
- Treat flaky tests as bugs, not noise.
Runtime Scripts
scripts/playwright_runner.py
- Use for quick browser checks, screenshots, and lightweight audits.
scripts/with_server.py
- Run with
--help first.
- Use to manage one or more local servers before a Playwright script runs.
Example Resources
Review examples in examples/ when you need patterns for:
- element discovery
- static HTML automation
- console logging
1---2name: webapp-testing3description: ---4---5---6name: webapp-testing7description: ALWAYS use this when the task involves browser automation, UI verification, DOM inspection, end-to-end checks, or reproducing a web bug in a running application.8---910# Web App Testing1112## Selective Reading Rule1314Start with:1516- `references/usage-routing.md`17- `references/quality-checklist.md`1819Then load only the inherited docs, scripts, assets, or examples that match the user's actual task.2021## Core Rule2223Discover first, then automate. Do not guess selectors or page state before checking the rendered application.2425## Selective Reading Rule2627Start with:2829- `references/senior-master-standard.md`30- `references/selector-strategy.md`31- `references/flake-triage.md`3233Then use `examples/` only for patterns you actually need.3435## Decision Tree3637- If the target is static HTML, read the file directly to discover likely selectors.38- If the target is a dynamic app, wait for the rendered state before inspecting the DOM.39- If a local server is needed, use `scripts/with_server.py` to manage it instead of hand-rolling startup logic.4041## Testing Workflow42431. Map the surface area.44 - Identify routes, important pages, key components, and critical user journeys.452. Inspect before acting.46 - Wait for `networkidle` on dynamic pages before reading DOM state.47 - Capture screenshots, page content, console logs, or element inventories to discover selectors.483. Automate critical flows.49 - Cover happy paths first.50 - Then test auth, high-value actions, and important error states.514. Review failures.52 - Prefer root-cause fixes over adding waits.5354## Best Practices5556- Test behavior rather than implementation details.57- Prefer stable selectors such as role, text, label, or `data-testid`.58- Keep tests independent and state-aware.59- Use screenshots and traces when failures are hard to explain from logs alone.60- Treat flaky tests as bugs, not noise.6162## Runtime Scripts6364- `scripts/playwright_runner.py`65 - Use for quick browser checks, screenshots, and lightweight audits.66- `scripts/with_server.py`67 - Run with `--help` first.68 - Use to manage one or more local servers before a Playwright script runs.6970## Example Resources7172Review examples in `examples/` when you need patterns for:7374- element discovery75- static HTML automation76- console logging