Web Testing Skill
Output style: Follow process/development-protocols/communication-standards.md — answer-first, plain language, no unexplained jargon, TL;DR on long responses.
Comprehensive web testing: unit, integration, E2E, load, security, visual regression, accessibility.
Quick Start
npx vitest run # Unit tests
npx playwright test # E2E tests
npx playwright test --ui # E2E with UI
k6 run load-test.js # Load tests
npx @axe-core/cli https://example.com # Accessibility
npx lighthouse https://example.com # Performance
Testing Strategy (Choose Your Model)
| Model |
Structure |
Best For |
| Pyramid |
Unit 70% > Integration 20% > E2E 10% |
Monoliths |
| Trophy |
Integration-heavy |
Modern SPAs |
| Honeycomb |
Contract-centric |
Microservices |
→ ./references/testing-pyramid-strategy.md
Reference Documentation
Core Testing
./references/unit-integration-testing.md - Vitest, browser mode, AAA
./references/e2e-testing-playwright.md - Fixtures, sharding, selectors
./references/playwright-component-testing.md - CT patterns (production-ready)
./references/component-testing.md - React/Vue/Angular patterns
Test Infrastructure
./references/test-data-management.md - Factories, fixtures, seeding
./references/database-testing.md - Testcontainers, transactions
./references/ci-cd-testing-workflows.md - GitHub Actions, sharding
./references/contract-testing.md - Pact, MSW patterns
Cross-Browser & Mobile
./references/cross-browser-checklist.md - Browser/device matrix
./references/mobile-gesture-testing.md - Touch, swipe, orientation
Performance & Quality
./references/performance-core-web-vitals.md - LCP/CLS/INP, Lighthouse CI
./references/visual-regression.md - Screenshot comparison
./references/test-flakiness-mitigation.md - Stability strategies
Accessibility & Security
./references/accessibility-testing.md - WCAG, axe-core
./references/security-testing-overview.md - OWASP Top 10
./references/security-checklists.md - Auth, API, headers
API & Load
./references/api-testing.md - Supertest, GraphQL
./references/load-testing-k6.md - k6 patterns
Checklists
./references/pre-release-checklist.md - Complete release checklist
./references/functional-testing-checklist.md - Feature testing
Scripts
Initialize Playwright Project
node ./scripts/init-playwright.js [--ct] [--dir <path>]
Creates best-practice Playwright setup: config, fixtures, example tests.
Analyze Test Results
node ./scripts/analyze-test-results.js \
--playwright test-results/results.json \
--vitest coverage/vitest.json \
--output markdown
Parses Playwright/Vitest/JUnit results into unified summary.
CI/CD Integration
jobs:
test:
steps:
- run: pnpm run test:unit # Gate 1: Fast fail
- run: pnpm run test:e2e # Gate 2: After unit pass
- run: pnpm run test:a11y # Accessibility
- run: npx lhci autorun # Performance
1---2name: vc-web-testing3description: Web testing with Playwright, Vitest, k6. E2E/unit/integration/load/security/visual/a11y testing. Use for test automation, flakiness, Core Web Vitals, mobile gestures, cross-browser.4license: Apache-2.05---67# Web Testing Skill89> **Output style:** Follow `process/development-protocols/communication-standards.md` — answer-first, plain language, no unexplained jargon, TL;DR on long responses.1011Comprehensive web testing: unit, integration, E2E, load, security, visual regression, accessibility.1213## Quick Start1415```bash16npx vitest run # Unit tests17npx playwright test # E2E tests18npx playwright test --ui # E2E with UI19k6 run load-test.js # Load tests20npx @axe-core/cli https://example.com # Accessibility21npx lighthouse https://example.com # Performance22```2324## Testing Strategy (Choose Your Model)2526| Model | Structure | Best For |27|-------|-----------|----------|28| Pyramid | Unit 70% > Integration 20% > E2E 10% | Monoliths |29| Trophy | Integration-heavy | Modern SPAs |30| Honeycomb | Contract-centric | Microservices |3132→ `./references/testing-pyramid-strategy.md`3334## Reference Documentation3536### Core Testing37- `./references/unit-integration-testing.md` - Vitest, browser mode, AAA38- `./references/e2e-testing-playwright.md` - Fixtures, sharding, selectors39- `./references/playwright-component-testing.md` - CT patterns (production-ready)40- `./references/component-testing.md` - React/Vue/Angular patterns4142### Test Infrastructure43- `./references/test-data-management.md` - Factories, fixtures, seeding44- `./references/database-testing.md` - Testcontainers, transactions45- `./references/ci-cd-testing-workflows.md` - GitHub Actions, sharding46- `./references/contract-testing.md` - Pact, MSW patterns4748### Cross-Browser & Mobile49- `./references/cross-browser-checklist.md` - Browser/device matrix50- `./references/mobile-gesture-testing.md` - Touch, swipe, orientation5152### Performance & Quality53- `./references/performance-core-web-vitals.md` - LCP/CLS/INP, Lighthouse CI54- `./references/visual-regression.md` - Screenshot comparison55- `./references/test-flakiness-mitigation.md` - Stability strategies5657### Accessibility & Security58- `./references/accessibility-testing.md` - WCAG, axe-core59- `./references/security-testing-overview.md` - OWASP Top 1060- `./references/security-checklists.md` - Auth, API, headers6162### API & Load63- `./references/api-testing.md` - Supertest, GraphQL64- `./references/load-testing-k6.md` - k6 patterns6566### Checklists67- `./references/pre-release-checklist.md` - Complete release checklist68- `./references/functional-testing-checklist.md` - Feature testing6970## Scripts7172### Initialize Playwright Project73```bash74node ./scripts/init-playwright.js [--ct] [--dir <path>]75```76Creates best-practice Playwright setup: config, fixtures, example tests.7778### Analyze Test Results79```bash80node ./scripts/analyze-test-results.js \81 --playwright test-results/results.json \82 --vitest coverage/vitest.json \83 --output markdown84```85Parses Playwright/Vitest/JUnit results into unified summary.8687## CI/CD Integration8889```yaml90jobs:91 test:92 steps:93 - run: pnpm run test:unit # Gate 1: Fast fail94 - run: pnpm run test:e2e # Gate 2: After unit pass95 - run: pnpm run test:a11y # Accessibility96 - run: npx lhci autorun # Performance97```