end-to-end-testinglisted
Install: claude install-skill kouroshez/coding-os
# End-to-End Testing
End-to-end tests are the most valuable and the most expensive tests — they prove a real user journey works across the whole stack, and they break for unrelated reasons if written carelessly. The discipline: **few but critical** journeys, **semantic** locators, **zero hard sleeps**, and **isolated** data. A flaky end-to-end suite is worse than none — teams learn to ignore red.
> Lint Playwright specs for flakiness anti-patterns:
> `python3 scripts/lint_e2e.py tests/**/*.spec.ts`
## Cover journeys, not units (it's the tip of the pyramid)
End-to-end tests are slow and broad — reserve them for the handful of journeys
that, if broken, mean the product is down: sign up → log in, add to cart →
checkout, the core create→read→update path. Everything else (edge cases, error
states, validation) is cheaper and more reliable as unit/integration tests.
Which test type for a given change is owned by
[testing-strategy](../testing-strategy/SKILL.md) — this skill is how to write the
end-to-end ones well.
## Playwright — locators + auto-wait (web)
```typescript
// Wrong — brittle selector + a hard sleep = flaky and slow
await page.waitForTimeout(3000);
await page.click(".btn-primary.css-1x2y3z"); // generated class, breaks on rebuild
// Correct — semantic locator + auto-waiting assertion
await page.getByRole("button", { name: "Sign in" }).click(); // waits for actionable
await expect(page.getByText("Welcome")).toBeVisible(); // retries until true or t