Playwright Regression Testing (TypeScript)
Strategy and best practices for automated regression testing of web applications using Playwright with TypeScript.
Activation: This skill is triggered when working with regression test strategy, test suite selection, test prioritization, CI/CD pipeline testing, flaky test management, test sharding, or optimizing test execution for web applications using Playwright.
When to Use This Skill
- Plan regression suites with risk-based and change-based test selection
- Organize tests into tiers (smoke, sanity, selective, full regression)
- Optimize execution with parallelization, sharding, and time-budget strategies
- Integrate with CI/CD using GitHub Actions pipelines
- Manage flaky tests with quarantine, retry policies, and root cause tracking
- Monitor suite health with execution time, flake rate, and detection metrics
- Select tests after changes using git diff analysis and impact mapping
Do NOT Use For
- Authoring a single UI spec or page-object model (use
playwright-e2e-testing).
- Driving a live browser interactively for debugging (use
playwright-cli).
- Selenium/Java regression suites (use
webapp-selenium-testing).
- API contract testing in isolation (use
api-testing).
Prerequisites
| Requirement |
Details |
| Node.js |
v18+ recommended |
| Playwright |
@playwright/test package |
| TypeScript |
typescript configured in project |
| Browsers |
Installed via npx playwright install |
| Git |
Required for change-based test selection |
| GitHub Actions |
Recommended CI/CD platform |
Quick Reference
Tiers: Smoke (<2min, every commit) → Sanity (<10min, every PR) → Selective (<30min, on merge) → Full (<60min, nightly/pre-release).
Key tags: @smoke, @sanity, @regression, @e2e, @api, @destructive — exactly one per test, never on describe() blocks. Domain-specific extensions (e.g., @a11y in accessibility skills) are allowed alongside, but only one execution tag per test.
CLI: npx playwright test --grep @smoke | --grep @regression | --grep-invert @destructive | --shard=1/4 | --last-failed
For full tier model, regression types table, and tag taxonomy, see references/regression-catalogs.md.
Red Flags
- Treating flaky tests as "fixed" by adding retries or
waitForTimeout — quarantine and root-cause instead.
- Running the full suite on every commit — use tiered selection (smoke on commit, full nightly).
- Quarantining tests silently with no tracking ticket — quarantine must be temporary and owned.
- No change-based selection — running everything regardless of what changed wastes CI budget.
- Ignoring suite-health metrics (rising duration, climbing flake rate) until they block releases.
References
| Document |
Content |
| Regression Strategy |
Tier model (smoke→full), regression types, triggers, directory layout, test tagging and tag taxonomy |
| Regression Selection |
Test selection (change-based, risk-based, historical, time-budget) and test naming conventions |
| Regression Best Practices |
Locator priority, web-first assertions, test independence, test.step() reporting, complete worked example test |
| CI/CD Integration |
GitHub Actions tiered pipeline, sharding, merge reports, Playwright config, performance optimization, CLI reference |
| Flaky Management |
Retry policies, quarantine strategies, detection checklist, suite health metrics, troubleshooting |
Verification
1---
2name: playwright-regression-testing
3description: 'Govern Playwright TypeScript regression suites across many tests. Use when asked to plan, select, tier, execute, or optimize suites with risk/change analysis, tags, CI/CD, sharding, flaky-test management, or suite-health metrics; not for authoring one UI spec. Keywords: regression strategy, smoke tests, test selection, CI pipeline, flaky tests, test sharding, impact analysis, git diff.'
4license: 'Complete terms in LICENSE.txt'
5metadata:
6 source: https://skillmd.com/skills/gabrielmoreira/playwright-regression-testing
7---
8
9# Playwright Regression Testing (TypeScript)
10
11Strategy and best practices for automated regression testing of web applications using Playwright with TypeScript.
12
13> **Activation:** This skill is triggered when working with regression test strategy, test suite selection, test prioritization, CI/CD pipeline testing, flaky test management, test sharding, or optimizing test execution for web applications using Playwright.
14
15## When to Use This Skill
16
17- **Plan regression suites** with risk-based and change-based test selection
18- **Organize tests** into tiers (smoke, sanity, selective, full regression)
19- **Optimize execution** with parallelization, sharding, and time-budget strategies
20- **Integrate with CI/CD** using GitHub Actions pipelines
21- **Manage flaky tests** with quarantine, retry policies, and root cause tracking
22- **Monitor suite health** with execution time, flake rate, and detection metrics
23- **Select tests after changes** using git diff analysis and impact mapping
24
25### Do NOT Use For
26
27- Authoring a single UI spec or page-object model (use `playwright-e2e-testing`).
28- Driving a live browser interactively for debugging (use `playwright-cli`).
29- Selenium/Java regression suites (use `webapp-selenium-testing`).
30- API contract testing in isolation (use `api-testing`).
31
32## Prerequisites
33
34| Requirement | Details |
35| -------------- | ---------------------------------------- |
36| Node.js | v18+ recommended |
37| Playwright | `@playwright/test` package |
38| TypeScript | `typescript` configured in project |
39| Browsers | Installed via `npx playwright install` |
40| Git | Required for change-based test selection |
41| GitHub Actions | Recommended CI/CD platform |
42
43---
44
45## Quick Reference
46
47**Tiers:** Smoke (<2min, every commit) → Sanity (<10min, every PR) → Selective (<30min, on merge) → Full (<60min, nightly/pre-release).
48
49**Key tags:** `@smoke`, `@sanity`, `@regression`, `@e2e`, `@api`, `@destructive` — exactly one per test, never on `describe()` blocks. Domain-specific extensions (e.g., `@a11y` in accessibility skills) are allowed alongside, but only one execution tag per test.
50
51**CLI:** `npx playwright test --grep @smoke` | `--grep @regression` | `--grep-invert @destructive` | `--shard=1/4` | `--last-failed`
52
53For full tier model, regression types table, and tag taxonomy, see [`references/regression-catalogs.md`](references/regression-catalogs.md).
54
55---
56
57## Red Flags
58
59- Treating flaky tests as "fixed" by adding retries or `waitForTimeout` — quarantine and root-cause instead.
60- Running the full suite on every commit — use tiered selection (smoke on commit, full nightly).
61- Quarantining tests silently with no tracking ticket — quarantine must be temporary and owned.
62- No change-based selection — running everything regardless of what changed wastes CI budget.
63- Ignoring suite-health metrics (rising duration, climbing flake rate) until they block releases.
64
65---
66
67## References
68
69| Document | Content |
70| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
71| [Regression Strategy](./references/regression-strategy.md) | Tier model (smoke→full), regression types, triggers, directory layout, test tagging and tag taxonomy |
72| [Regression Selection](./references/regression-selection.md) | Test selection (change-based, risk-based, historical, time-budget) and test naming conventions |
73| [Regression Best Practices](./references/regression-best-practices.md) | Locator priority, web-first assertions, test independence, `test.step()` reporting, complete worked example test |
74| [CI/CD Integration](./references/ci-cd-integration.md) | GitHub Actions tiered pipeline, sharding, merge reports, Playwright config, performance optimization, CLI reference |
75| [Flaky Management](./references/flaky-management.md) | Retry policies, quarantine strategies, detection checklist, suite health metrics, troubleshooting |
76
77---
78
79## Verification
80
81- [ ] **Smoke test subset identified** — Tagged `@smoke` tests run in under 2 minutes
82- [ ] **No test duplication** — Each scenario tested exactly once at the appropriate level
83- [ ] **Test isolation verified** — Running tests in random order produces same results as sequential
84- [ ] **Flaky test baseline established** — All tests pass 5/5 consecutive runs