| name | test-automation-strategy |
| description | Design and implement effective test automation with proper pyramid, patterns, and CI/CD integration. Use when building automation frameworks or improving test efficiency. |
| category | testing-methodologies |
| priority | high |
| tokenEstimate | 1000 |
| agents | ["qe-test-generator","qe-test-executor","qe-coverage-analyzer","qe-flaky-test-hunter","qe-regression-risk-analyzer"] |
| implementation_status | optimized |
| optimization_version | 1 |
| last_optimized | "2025-12-02T00:00:00.000Z" |
| dependencies | [] |
| quick_reference_card | true |
| tags | ["automation","test-pyramid","page-object","first-principles","ci-cd","flaky-tests"] |
| trust_tier | 3 |
| validation | {"schema_path":"schemas/output.json","validator_path":"scripts/validate-config.json","eval_path":"evals/test-automation-strategy.yaml"} |
Test Automation Strategy
<default_to_action>
When designing or improving test automation:
- DETECT anti-patterns: Ice cream cone? Slow suite? Flaky tests?
- USE patterns: Page Object Model, Builder pattern, Factory pattern
- INTEGRATE in CI/CD: Every commit runs tests, fail fast
- MANAGE flaky tests: Quarantine, fix, or delete - never ignore
Quick Anti-Pattern Detection:
- Ice cream cone (many E2E, few unit) → Invert to pyramid
- Slow tests (> 10 min suite) → Parallelize, mock external deps
- Flaky tests → Fix timing, isolate data, or quarantine
- Brittle selectors → Use data-testid, semantic locators
</default_to_action>
Quick Reference Card
When to Use
- Building new automation framework
- Improving existing test efficiency
- Reducing flaky test burden
- Optimizing CI/CD pipeline speed
Anti-Patterns to Detect
| Problem | Symptom | Fix |
|---|
| Ice cream cone | 80% E2E, 10% unit | Invert pyramid |
| Slow suite | 30+ min CI | Parallelize, prune |
| Flaky tests | Random failures | Quarantine, fix timing |
| Coupled tests | Order-dependent | Isolate data |
| Brittle selectors | Break on CSS change | Use data-testid |
CI/CD Integration
name: Test Pipeline
on: [push, pull_request]
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci
-