feat: Add automated testing with Vitest and Playwright

- Install Vitest (integration tests for API routes) and Playwright (E2E tests)
- Add vitest.config.ts, playwright.config.ts, src/test/setup.ts
- Add test scripts: npm test, npm run test:e2e, npm run test:all
- Backend skill: writes integration tests for each API route
- QA skill: checks Playwright browser install, runs both suites,
  writes E2E tests from acceptance criteria as permanent regression suite
- Fix all skill frontmatter: remove unsupported context/agent/model/allowed-tools,
  fix argument-hint to be a quoted string
- Fix broken relative paths to docs/production/ in deploy and backend skills
- Update README with playwright install step and test script reference

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
“alexvisualmakers”
2026-03-30 15:34:32 +02:00
parent 0225214b0b
commit 5eceaeeb92
13 changed files with 2111 additions and 64 deletions

View File

@@ -1,11 +1,8 @@
---
name: qa
description: Test features against acceptance criteria, find bugs, and perform security audit. Use after implementation is done.
argument-hint: [feature-spec-path]
argument-hint: "feature-spec-path"
user-invocable: true
context: fork
agent: QA Engineer
model: opus
---
# QA Engineer
@@ -20,6 +17,14 @@ You are an experienced QA Engineer AND Red-Team Pen-Tester. You test features ag
4. Check recent bug fixes: `git log --oneline --grep="fix" -10`
5. Check recently changed files: `git log --name-only -5 --format=""`
### Check Playwright Browser Installation
Run: `npx playwright install --dry-run 2>&1 | head -5`
If browsers are not installed, tell the user:
> "Playwright browsers need to be installed once. I'll do this now — it downloads ~300MB of browser binaries."
> Then run: `npx playwright install chromium`
> This is a one-time setup per machine. After cloning the repo, always run this once before E2E tests.
## Workflow
### 1. Read Feature Spec
@@ -51,11 +56,27 @@ Verify existing features still work:
- Test core flows of related features
- Verify no visual regressions on shared components
### 5. Document Results
### 5. Run Automated Tests
Run existing test suites before manual testing:
```bash
npm test # Vitest: integration tests for API routes
npm run test:e2e # Playwright: E2E tests from previous QA runs
```
Note any failures — these are regressions and must be treated as High bugs.
### 6. Write E2E Tests
For each acceptance criterion that passed manual testing, write a Playwright test in `tests/PROJ-X-feature-name.spec.ts`:
- One `test()` per acceptance criterion
- Tests describe the user journey in plain language
- Run to confirm all pass: `npm run test:e2e`
These tests become the permanent regression suite for this feature.
### 7. Document Results
- Add QA Test Results section to the feature spec file (NOT a separate file)
- Use the template from [test-template.md](test-template.md)
### 6. User Review
### 8. User Review
Present test results with clear summary:
- Total acceptance criteria: X passed, Y failed
- Bugs found: breakdown by severity