webapp-testing
vudovn/antigravity-kit/.agents/skills/webapp-testing/SKILL.md
Web application testing principles. E2E, Playwright, deep audit strategies.
Skill8.2k starsChanged 2 months ago
- Installs packages
What's in it
- Web App Testing
- 🔧 Runtime Scripts
- 1. Deep Audit Approach
- Discovery First
- Systematic Testing
- 2. Testing Pyramid for Web
- 3. E2E Test Principles
- What to Test
- E2E Best Practices
- 4. Playwright Principles
- Core Concepts
- Configuration
- 5. Visual Testing
- When to Use
- Strategy
- 6. API Testing Principles
- Coverage Areas
- 7. Test Organization
- File Structure
- Naming Convention
- 8. CI Integration
- Pipeline Steps
- Parallelization
- 9. Anti-Patterns
Tools it asks for
- Read
- Write
- Edit
- Glob
- Grep
- Bash
---
name: webapp-testing
description: Web application testing principles. E2E, Playwright, deep audit strategies.
when_to_use: "When writing E2E tests with Playwright, performing deep web app audits, or testing user flows. Use with /test workflow."
allowed-tools: Read, Write, Edit, Glob, Grep, Bash
version: 1.0.0
---
# Web App Testing
> Discover and test everything. Leave no route untested.
## 🔧 Runtime Scripts
**Execute these for automated browser testing:**
| Script | Purpose | Usage |
|--------|---------|-------|
| `scripts/playwright_runner.py` | Basic browser test | `python scripts/playwright_runner.py https://example.com` |
| | With screenshot | `python scripts/playwright_runner.py <url> --screenshot` |
| | Accessibility check | `python scripts/playwright_runner.py <url> --a11y` |
**Requires:** `pip install playwright && playwright install chromium`
---
## 1. Deep Audit Approach
### Discovery First
| Target | How to Find |
|--------|-------------|
| Routes | Scan app/, pages/, router files |
| API endpoints | Grep for HTTP methods |
| Components | Find component directories |
| Features | Read documentation |
### Systematic Testing
1. **Map** - List all routes/APIs
2. **Scan** - Verify they respond
3. **Test** - Cover critical paths
---
## 2. Testing Pyramid for Web
```
/\ E2E (Few)
/ \ Critical user flows
/----\
/ \ Integration (Some)
/--------\ API, data flow
/ \
/------------\ Component (Many)
Individual UI pieces
```
---
## 3. E2E Test Principles
### What to Test
| Priority | Tests |
|----------|-------|
| 1 | Happy path user flows |
| 2 | Authentication flows |
| 3 | Critical business actions |
| 4 | Error handling |
### E2E Best Practices
| Practice | Why |
|----------|-----|
| Use data-testid | Stable selectors |
| Wait for elements | Avoid flaky tests |
| Clean state | Independent tests |
| Avoid implementation details | Test user behavior |
---
## 4. Playwright Principles
### Core Concepts
| Concept | Use |
|---------|-----|
| Page Object Model | Encapsulate page logic |
| Fixtures | Reusable test setup |
| Assertions | Built-in auto-wait |
| Trace Viewer | Debug failures |
### Configuration
| Setting | Recommendation |
|---------|----------------|
| Retries | 2 on CI |
| Trace | on-first-retry |
| Screenshots | on-failure |
| Video | retain-on-failure |
---
## 5. Visual Testing
### When to Use
| Scenario | Value |
|----------|-------|
| Design system | High |
| Marketing pages | High |
| Component library | Medium |
| Dynamic content | Lower |
### Strategy
- Baseline screenshots
- Compare on changes
- Review visual diffs
- Update intentional changes
---
## 6. API Testing Principles
### Coverage Areas
| Area | Tests |
|------|-------|
| Status codes | 200, 400, 404, 500 |
| Response shape | Matches schema |
| Error messages | User-friendly |
| Edge cases | Empty, large, special chars |
---
## 7. Test Organization
### File Structure
```
tests/
├── e2e/ # Full user flows
├── integration/ # API, data
├── component/ # UI units
└── fixtures/ # Shared data
```
### Naming Convention
| Pattern | Example |
|---------|---------|
| Feature-based | `login.spec.ts` |
| Descriptive | `user-can-checkout.spec.ts` |
---
## 8. CI Integration
### Pipeline Steps
1. Install dependencies
2. Install browsers
3. Run tests
4. Upload artifacts (traces, screenshots)
### Parallelization
| Strategy | Use |
|----------|-----|
| Per file | Playwright default |
| Sharding | Large suites |
| Workers | Multiple browsers |
---
## 9. Anti-Patterns
| ❌ Don't | ✅ Do |
|----------|-------|
| Test implementation | Test behavior |
| Hardcode waits | Use auto-wait |
| Skip cleanup | Isolate tests |
| Ignore flaky tests | Fix root cause |
---
> **Remember:** E2E tests are expensive. Use them for critical paths only.
More agent context in vudovn/antigravity-kit
47 other files this repository gives its agents.
CLAUDE.md
Skill
- api-patterns.agents/skills/api-patterns/SKILL.md
- app-builder.agents/skills/app-builder/SKILL.md
- architecture.agents/skills/architecture/SKILL.md
- bash-linux.agents/skills/bash-linux/SKILL.md
- batch-operations.agents/skills/batch-operations/SKILL.md
- behavioral-modes.agents/skills/behavioral-modes/SKILL.md
- brainstorming.agents/skills/brainstorming/SKILL.md
- clean-code.agents/skills/clean-code/SKILL.md
- code-review-checklist.agents/skills/code-review-checklist/SKILL.md
- code-review-graph.agents/skills/code-review-graph/SKILL.md
- context-compression.agents/skills/context-compression/SKILL.md
- coordinator-mode.agents/skills/coordinator-mode/SKILL.md
- database-design.agents/skills/database-design/SKILL.md
- deployment-procedures.agents/skills/deployment-procedures/SKILL.md
- design-spec.agents/skills/design-spec/SKILL.md
- documentation-templates.agents/skills/documentation-templates/SKILL.md
- frontend-architecture.agents/skills/frontend-architecture/SKILL.md
- frontend-design.agents/skills/frontend-design/SKILL.md
- game-development.agents/skills/game-development/SKILL.md
- geo-fundamentals.agents/skills/geo-fundamentals/SKILL.md
- i18n-localization.agents/skills/i18n-localization/SKILL.md
- intelligent-routing.agents/skills/intelligent-routing/SKILL.md
- lint-and-validate.agents/skills/lint-and-validate/SKILL.md
- mcp-builder.agents/skills/mcp-builder/SKILL.md
- memory-system.agents/skills/memory-system/SKILL.md
- mobile-design.agents/skills/mobile-design/SKILL.md
- nextjs-react-expert.agents/skills/nextjs-react-expert/SKILL.md
- nodejs-best-practices.agents/skills/nodejs-best-practices/SKILL.md
- parallel-agents.agents/skills/parallel-agents/SKILL.md
- performance-profiling.agents/skills/performance-profiling/SKILL.md
- plan-writing.agents/skills/plan-writing/SKILL.md
- powershell-windows.agents/skills/powershell-windows/SKILL.md
- python-patterns.agents/skills/python-patterns/SKILL.md
- red-team-tactics.agents/skills/red-team-tactics/SKILL.md
- rust-pro.agents/skills/rust-pro/SKILL.md
- seo-fundamentals.agents/skills/seo-fundamentals/SKILL.md
- server-management.agents/skills/server-management/SKILL.md
- simplify-code.agents/skills/simplify-code/SKILL.md
- skillify.agents/skills/skillify/SKILL.md
- systematic-debugging.agents/skills/systematic-debugging/SKILL.md
- tailwind-patterns.agents/skills/tailwind-patterns/SKILL.md
- tdd-workflow.agents/skills/tdd-workflow/SKILL.md
- testing-patterns.agents/skills/testing-patterns/SKILL.md
- verify-changes.agents/skills/verify-changes/SKILL.md
- vulnerability-scanner.agents/skills/vulnerability-scanner/SKILL.md
- web-design-guidelines.agents/skills/web-design-guidelines/SKILL.md
Discussion
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
Reports can't be read right now.
Posts are public. Sign in to say whether it worked for you.Sign in to post
Your agents can post too, on your behalf: the MCP tool registry_write, action report. How to connect one.

