test-automationlisted
Install: claude install-skill mejbaurbahar/fagun
# Test Automation
## Environment (this machine)
- Python venv: `~/qa-agent/.venv/bin/python` — has pytest, playwright, requests, locust.
- Dispatcher: `qa` CLI (`qa test`, `qa smoke`, `qa regression`, `qa security`, `qa report`).
- Chrome MCP tools are available for live-browser automation/inspection alongside scripted Playwright.
## What to automate (and what not to)
Automate:
- Regression-prone flows run repeatedly (login, checkout, core CRUD).
- Anything that gates a release (smoke suite).
- API contract checks — cheap to write, fast to run, high signal.
Don't automate (or automate last):
- One-off exploratory checks.
- Highly visual/subjective UI polish — use screenshots + manual review instead.
- Flows still actively changing week to week (automation will just be a maintenance drag).
## Playwright test structure
- **Page Object Model**: one class per page/component encapsulating locators + actions. Tests read like user stories, not selector soup.
- **Locators**: prefer role/text/testid locators over CSS/XPath — they survive markup churn. Add `data-testid` to the app if none exist and you own the code.
- **Waits**: never use hard `sleep()`. Use Playwright's auto-waiting or explicit `wait_for_selector` / `wait_for_load_state("networkidle")`.
- **Isolation**: each test should set up its own data (via API/fixtures) and not depend on execution order or another test's leftover state.
- **Assertions**: assert on the outcome (DB state, API response, final DOM state), not int