Skip to content
Back to skills

Quality E2e Testing

ASecurity

Use when the user asks about end to end tests with Playwright or Cypress, e2e strategy, which flows to cover, flaky e2e tests, quarantine, test data, mocking the backend or gating CI. Produces journey tiers, environment and data plan, flake policy and suite setup. Not for visual baselines (use quality-visual-testing) or API contracts (use quality-contract-testing).

  • 46 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 27, 2026
ai-agentstypescriptrustgodockertestingapidatabasefrontendbackend

Works with

  • cursor
  • api

Security analysis

A100/100

Pro scans all 16 files and shows the line behind each finding

Scanned November 27, 2026

npx -y skills add j4flmao/agent-skills --skill quality-e2e-testing --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Quality E2e Testing?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Quality E2e Testing
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/j4flmao-quality-e2e-testing/badge)](https://www.skillsdirectory.com/skills/j4flmao-quality-e2e-testing)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: quality-e2e-testing
description: >
  Use when the user asks about end to end tests with Playwright or Cypress, e2e strategy, which flows to cover, flaky e2e tests, quarantine, test data, mocking the backend or gating CI. Produces journey
  tiers, environment and data plan, flake policy and suite setup. Not for visual baselines (use quality-visual-testing) or API contracts (use quality-contract-testing).
version: "3.0.0"
author: "j4flmao"
license: "MIT"
last_verified: "2026-11-17"
compatibility:
  claude-code: true
  cursor: true
  codex: true
  windsurf: true
tags: [quality, testing, e2e, playwright, flakiness, ci]
---

# Quality E2E Testing Strategy

## Purpose
Use end-to-end tests where only they can give confidence — critical user journeys across the real stack — and keep them deterministic, fast enough to gate merges, and trusted. Everything that can be verified lower in the pyramid (unit, integration, contract) is tested there instead.

## Agent Protocol

### Trigger
"e2e strategy", "what to cover with e2e", "flaky tests", "quarantine", "e2e test data", "mock vs real backend", "e2e CI gate", "slow e2e suite", "network throttling test", "a11y in e2e".

### Input Context
- Architecture (SPA/SSR, services, third parties) and environments available.
- Current suite size, duration, flake rate, and what failures escaped to production.
- Release process (trunk-based, release trains) and who owns the suite.

### Output Artifact
E2E strategy: journey inventory, environment/data plan, flakiness policy, CI gating rules.

### Response Format
```
Journeys (tier 1 = gate): {journey -> why e2e}
Environment: {ephemeral preview | shared staging | prod smoke}
Data: {API seeding per test | snapshot restore} ; third parties: {mocked at network | sandbox}
Flake policy: {retry=1 in CI, quarantine after N flaky runs, owner + SLA}
CI: {PR: tier 1 sharded <= X min; nightly: full + cross-browser}
Metrics: {flake rate, duration P50/P90, escaped defects}
```

## What Belongs in E2E

| Test it E2E | Test it lower |
|-------------|---------------|
| Sign-up/login, checkout/payment, core create-edit-share flow | Validation rules, formatting, edge cases (unit) |
| Flows crossing several services and the browser | Service-to-service schemas (contract tests) |
| Auth/session/cookie behaviour, redirects | DB queries and repositories (integration) |
| Critical regressions that escaped before | Visual details (visual tests) |

Rank journeys by business impact × change frequency; tier 1 (gating) usually fits in 10–30 tests.

## Environment & Data

| Option | Pros | Cons |
|--------|------|------|
| Ephemeral per-PR environment | Isolated, realistic | Infra cost, startup time |
| Shared staging | Cheap | Data collisions, drift, other teams' deploys |
| Local stack (docker compose) in CI | Deterministic | Less realistic infra |
| Production smoke (read-only or test tenant) | Real config | Must never mutate real data |

Rules:
- Each test creates the data it needs via API/fixtures with unique identifiers; never depend on another test's data.
- Third parties (payments, email, SMS) via sandbox accounts or network-level mocks; keep one nightly run against sandboxes to catch contract drift.
- Reset or isolate by tenant/user rather than wiping shared databases mid-run.

## Network Control
- Stub third-party and non-deterministic endpoints (`page.route` in Playwright, `cy.intercept` in Cypress).
- Test degraded conditions deliberately: slow responses (delay in route handler), offline (`context.setOffline(true)`), error codes (500/429) to verify user-facing error states.
- CPU/network throttling via Chrome DevTools Protocol works only in Chromium; treat it as a Chromium-only check.

## Accessibility Checks in E2E

```typescript
import { test, expect } from '@playwright/test';
import AxeBuilder from '@axe-core/playwright';

test('checkout page has no detectable WCAG A/AA violations', async ({ page }) => {
  await page.goto('/checkout');
  const results = await new AxeBuilder({ page }).withTags(['wcag2a', 'wcag2aa']).analyze();
  expect(results.violations).toEqual([]);
});
```
Automated scans catch only part of accessibility issues; keep manual keyboard/screen-reader checks for key flows.

## Flakiness Policy

| Practice | Rule |
|----------|------|
| Retries | At most 1–2 in CI, never locally; every "passed on retry" is recorded as flaky |
| Quarantine | Test flaky N times in a window → tagged `@quarantine`, excluded from the gate, ticket with owner and fix SLA |
| Root causes | Hard waits, shared data, order dependence, animation timing, unmocked third parties, clock/timezone |
| Evidence | Traces/videos/screenshots on failure uploaded as CI artifacts |
| Budget | Track flake rate per test; a quarantined test that is not fixed by SLA is deleted or rewritten lower in the pyramid |

Common fixes: web-first assertions instead of sleeps; wait for the specific network response (`page.waitForResponse`); disable animations in test builds; freeze time (`page.clock` in Playwright) for date-dependent UI.

## CI Gating

```
PR / merge queue:  tier-1 journeys, 1 browser, sharded, target ≤ ~15 min, blocks merge
Main post-merge:   full suite, main browsers
Nightly:           full suite × browsers/devices + third-party sandboxes + a11y scans
Post-deploy:       production smoke (read-only / test tenant), triggers rollback alert
```

## Metrics
- Suite duration (P50/P90) and queue time.
- Flake rate = runs passing only on retry ÷ total runs, per test.
- Escaped defects: production bugs in flows that have E2E coverage (indicates weak assertions).
- Coverage of tier-1 journey inventory (not line coverage).

## Anti-Patterns

| Anti-pattern | Fix |
|--------------|-----|
| E2E for every edge case | Push down to unit/integration |
| Shared staging data | Per-test seeded data |
| Unlimited retries hiding flakes | Retry ≤ 2 + quarantine with owner |
| Real third-party calls in gating runs | Network mocks; sandboxes nightly |
| Suite too slow to gate | Tier journeys, shard, move rest to nightly |
| Nobody owns failures | Owning team per journey |

## Checklist
- [ ] Journey inventory with tiers and owners
- [ ] Data isolation strategy documented
- [ ] Third parties mocked in gating runs
- [ ] Flake policy (retry, quarantine, SLA) enforced in CI
- [ ] Artifacts (trace/video) on failure
- [ ] Metrics dashboard: duration, flake rate, escaped defects

## References
- `references/playwright-mocking.md` — network mocking patterns
- `references/flaky-test-mitigation.md` — flake root causes and fixes
- `references/visual-regression.md` — screenshot assertions in E2E
- `references/ci-cd-integration.md` — pipelines, sharding, artifacts
- `references/anti-patterns.md` — E2E anti-patterns

Implementation lives in the merged references: Playwright config, setup-project auth and locators in `references/merged-frontend-playwright-testing.md`; page objects, sharded CI and API seeding in `references/merged-e2e-testing.md`; core concepts and sharding matrix in `references/merged-qa-e2e-playwright.md`. Default tool for new suites: Playwright (Chromium, Firefox, WebKit); Cypress when the team already runs it.

### Merged Material
Content folded in from overlapping skills and notes.

- `references/merged-frontend-playwright-testing.md` — E2E & Component Testing with Playwright (merged from `frontend/e2e-testing`)
- `references/merged-qa-e2e-playwright.md` — E2E Testing with Playwright (merged from `quality-assurance/testing-strategies/e2e-playwright`)
- `references/merged-e2e-testing.md` — Quality E2E Testing (merged from `quality/e2e-testing`)
- `references/cypress-guide.md` — Cypress Guide
- `references/e2e-testing-advanced.md` — E2E Testing Advanced Topics
- `references/e2e-testing-fundamentals.md` — E2E Testing Fundamentals
- `references/flakiness-management.md` — E2E Test Flakiness Management
- `references/framework-selection.md` — Framework Selection
- `references/playwright-guide.md` — Playwright Guide
- `references/test-patterns.md` — Test Patterns

Files in this skill

  • SKILL.md7.9 KB
  • references/anti-patterns.md1005 B
  • references/ci-cd-integration.md6.9 KB
  • references/cypress-guide.md6 KB
  • references/e2e-testing-advanced.md5.2 KB
  • references/e2e-testing-fundamentals.md7.6 KB
  • references/flakiness-management.md2.1 KB
  • references/flaky-test-mitigation.md1 KB
  • references/framework-selection.md2.2 KB
  • references/merged-e2e-testing.md15.3 KB
  • references/merged-frontend-playwright-testing.md6.4 KB
  • references/merged-qa-e2e-playwright.md4.6 KB
  • references/playwright-guide.md6.3 KB
  • references/playwright-mocking.md1.1 KB
  • references/test-patterns.md2.7 KB
  • references/visual-regression.md1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.