Quality E2E Testing
Purpose
Comprehensive end-to-end testing capabilities for robust applications. Includes Playwright, chaos engineering, and more.
Core Principles
- Determinism over speed.
- Isolate test states.
- Network layer is fully controlled.
- Assume nothing, test everything.
- Chaos engineering uncovers hidden limits.
Agent Protocol
- Triggers: e2e test request
- Input Context Required: application url, auth state
- Output Artifact: test report
- Response Formats:
{ "status": "pass", "coverage": "90%" }
Decision Matrix
[E2E Request]
|
v
Is local? ---> (Yes) -> Run headless Playwright
|
(No) -> Run in container
Detailed Architectural Overview
[Browser] <--> [Playwright] <--> [Test Runner]
Lifecycle:
Init -> Setup State -> Execute -> Teardown
Workflow Steps
Phase 1: Setup
- Init browser
- Load state
- Route mock
- Wait ready
Phase 2: Execution
- Navigate
- Interact
- Assert
- Cleanup
Phase 3: Chaos
- Drop packets
- Throttle CPU
- Assert recovery
- Analyze
Phase 4: Reporting
- Collect traces
- Generate HTML
- Upload artifacts
- Alert
Phase 5: Cleanup
- Close browser
- Clean state
- Notify
- End
Phase 6: Analysis
- Parse logs
- Find flakiness
- Update metrics
- Store
Extended Troubleshooting Guide
| Symptom | Primary Cause | Mitigation Action |
|---|---|---|
| Timeout | Network slow | Increase timeout |
| Flaky | Async race | Use waitForSelector |
| No Auth | Bad token | Refresh session |
| Crash | OOM | Increase memory limit |
| Element not found | DOM changed | Update locators |
| Blank page | JS error | Check console logs |
Complete Execution Scenario
Start -> Mock -> Test -> Success -> End
Rules and Guidelines
- No arbitrary waits.
- Always mock external APIs.
- Keep tests isolated.
- Clean up after each test.
- Use page object model.
Reference Guides
- Playwright Mocking
- Chaos Engineering
- Network Throttling
- Flaky Test Mitigation
- Visual Regression
- A11Y Testing
- Test Data
- CI CD
Handoff
See ci-integration for pipelines.