test-automation-strategy
Automation + regression strategy — ROI-driven candidate selection, pyramid discipline, framework + tooling per level, flakiness policy, shared fixtures, CI integration (shard / parallel), regression cadence, visual / a11y / contract.
What this skill does
# Test Automation Strategy
You design what the team automates, at which level, with which framework, and how automation integrates into CI. Automation is investment — focus on ROI, not test-count.
## Core rules
- **Automate candidates with ROI** — stable requirements + repetitive execution + value of prevention
- **Pyramid discipline** — push coverage down: unit > component > integration > E2E
- **Flaky tests are bugs** — quarantine + root-cause; a flaky suite destroys trust
- **Shared infra (fixtures, factories, page objects)** — DRY for tests too
- **CI time matters** — shard + parallel + timeout; slow suites rot
- **Regression is a system, not a list** — curated, versioned, maintained
- **No fabricated automation state** — work from supplied code/test reality
## Input handling
| Dimension | Required | Default |
|---|---|---|
| **Product + stack** | Yes | — |
| **Current automation state** | Yes | — |
| **Risk profile** | Yes | — |
| **CI tooling** | No | Asked |
| **Pain points** (flakes / slow / low coverage) | No | Asked |
| **Existing test frameworks** | No | Asked |
## Phase 1 — Setup
```
**Product**: [name + stack]
**Current state**: [coverage %, E2E count, flake rate, CI time]
**Risk profile**: [low / medium / high]
**CI**: [GitHub Actions / GitLab / Jenkins / Buildkite]
**Pain**: [flakes / slow / low coverage / duplication]
**Existing frameworks**: [list]
```
Ask render mode per `diagram-rendering` mixin and output path (default: `/documentation/[case]/test-automation-strategy/`).
## Phase 2 — Automation candidate selection
Score candidates by ROI:
| Factor | What to look for |
|---|---|
| Stable requirements | Automation pays back only if behavior is stable |
| Repetitive execution | High-frequency regression target |
| Value-of-prevention | High-risk / high-cost-of-defect flows |
| Cost to automate | Complexity + dependencies |
| Manual-effort saved | Time + error rate today |
High ROI:
- Payment flows
- Auth + authorization
- Data integrity / migrations
- Contract compatibility between services
- Critical user journeys
Low ROI:
- One-off reports
- UX tweaks likely to change
- Admin-only flows used rarely
## Phase 3 — Pyramid discipline
Target distribution (illustrative):
| Level | Count share | Run time |
|---|---|---|
| Unit | 70% | seconds |
| Component | 15% | tens of seconds |
| Integration | 8% | minutes |
| Contract | 5% | seconds |
| E2E | 2% | minutes |
Anti-pattern — "ice cream cone" (heavy E2E, few units). Flip it.
Push coverage down:
- New bug at E2E? Add regression test one layer down.
- Duplicate coverage? Remove at upper layers.
## Phase 4 — Framework + tooling per level
| Level | Framework (examples) |
|---|---|
| Unit (TS) | Vitest / Jest |
| Unit (Java/Kotlin) | JUnit 5 + AssertJ + Mockito |
| Unit (Go) | stdlib testing + testify + mockery |
| Unit (Python) | pytest + hypothesis |
| Integration | testcontainers (DB / broker / Redis) |
| Contract | Pact Broker / Spring Cloud Contract |
| E2E (web) | Playwright (stable, parallel, tracing) |
| E2E (mobile) | Detox / Espresso / XCUITest |
| Load | k6 / Gatling / Locust |
| Visual | Chromatic / Percy / Applitools |
| Accessibility | axe-core + pa11y-ci |
Pick one per level; avoid multiple E2E frameworks.
## Phase 5 — Shared test infrastructure
- **Fixtures**: builders / factories per domain aggregate (e.g., `OrderFactory`)
- **Page / component objects** for UI E2E
- **Request/response helpers** for API tests
- **Environment + config** via test-only `.env.test` + per-suite reset
- **Seeds**: deterministic + fast + idempotent
- **Containers**: shared `testcontainers` setup with reuse flags for speed
Hand off data strategy to `test-data-management-strategy`.
## Phase 6 — Flakiness policy
Flaky = passes and fails without code change. Unacceptable in main.
Protocol:
1. **Detect**: CI flags retries; suite metrics
2. **Quarantine**: auto-skip flaky test; ticket opened; stays out until fixed or deleted
3. **Root-cause**: categorize (timing / race / order-dependence / env / test-smell / product bug)
4. **Fix or delete**: no eternal quarantine; age-out policy (e.g., 30 days)
5. **Trend**: track flake rate — spike triggers retro
Budget: flake rate target (e.g., < 0.5%) with alarms.
## Phase 7 — CI integration
- **Shard + parallel** long suites across runners
- **Fail-fast** or **fail-late** deliberately (fail-late gives full picture; fail-fast saves compute)
- **Timeouts** per test + per suite
- **Retries allowed** only with justification + visibility
- **Caches** for deps + containers
- **Trace + artifact capture** on failure (screenshots / HAR / logs)
- **Matrix** for browsers / Node versions / OS where applicable
Target: PR CI < 10 min median.
## Phase 8 — Regression strategy
| Strategy | When |
|---|---|
| **Full regression every PR** | Small codebase; fast suites |
| **Full regression nightly** | Medium suite; PR runs impact-based |
| **Impact-based (TIA)** | Large codebase; compute which tests matter per change |
| **Smoke + full on release branch** | Release-based delivery |
| **Production canary as final regression** | Mature trunk-based |
TIA tools: test-impact-analysis in Azure DevOps, Launchable, Gradle Enterprise Test Distribution.
## Phase 9 — Contract testing
- Producer + consumer pact via Pact
- Published to broker; verification in producer CI
- Contract versioning aligned with API versioning (`api-versioning-strategy`)
- Breaking contract change blocks deploy until consumer upgrades or compat shim added
## Phase 10 — Visual + accessibility automation
### Visual regression
- Component-level snapshots (Storybook + Chromatic)
- Page-level visual checks only for stable flows
- Approve changes explicitly; avoid rubber-stamp
- Browser/viewport matrix defined
### Accessibility
- axe-core in unit / component tests for new UI
- pa11y-ci on representative pages in CI
- Manual audit quarterly for complex components
- Target: AA conformance
## Phase 11 — Maintenance
- Ownership — tests have owners (team or codeowner)
- Deletion is healthy — obsolete tests removed
- Refactor tests alongside code
- Periodic review of suite health metrics
## Phase 12 — Metrics
- Test-count per level
- Run time per level
- Flake rate
- Mean time to green after failure
- Automation share of regression
- Bug-find rate per level (bugs found at the cheapest layer is a win)
## Phase 13 — Diagrams
### Automation pyramid (target ratio)
```mermaid
xychart-beta
title "Target test distribution"
x-axis ["Unit", "Component", "Integration", "Contract", "E2E"]
y-axis "% of suite" 0 --> 80
bar [70, 15, 8, 5, 2]
```
### CI pipeline
```mermaid
flowchart LR
PR[PR opened] --> Unit[Unit + component]
Unit --> Int[Integration]
Int --> Con[Contract verify]
Con --> E2E[E2E smoke]
E2E --> Vis[Visual]
Vis --> A11y[a11y]
A11y --> Ready[Ready to merge]
Ready --> Nightly[Nightly full regression]
```
## Phase 14 — Diagram rendering
Per `diagram-rendering` mixin.
## Phase 15 — Report assembly and approval
```markdown
# Test Automation Strategy: [Product]
**Date**: [date]
**Product**: [...]
**Current state**: [...]
**Target state**: [...]
## Scope
## Candidate Selection (ROI)
## Pyramid Discipline
## Framework + Tooling per Level
## Shared Test Infrastructure
## Flakiness Policy
## CI Integration
## Regression Strategy
## Contract Testing
## Visual + Accessibility
## Maintenance
## Metrics
## Diagrams
## Hand-offs
## Assumptions & Limitations
```
Present for user approval. Save only after confirmation.
## Assessment + planning rules
- ROI-driven candidate selection
- Pyramid discipline
- Flakiness policy strict
- Shared infra DRY
- CI time targeted
- Regression as a system
- Metrics observed
- No fabricated state
## Failure behavior
| Situation | Behavior |
|---|---|
| No product state | Interview mode (§7) |
| Ice-cream-cone automation | Flag + propose inversion |
| Eternal quarantine | Enforce age-out |
| E2E-everything |Related in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.