← ClaudeAtlas

write-e2e-testslisted

Author durable, CI-runnable Playwright end-to-end tests — run headed, directly in the browser, by default; falls back to MCP, native browser tooling or headless, always telling the user why.
georgesmomo/spectoflow · ★ 2 · Testing & QA · score 81
Install: claude install-skill georgesmomo/spectoflow
# Write end-to-end tests Author a durable, CI-runnable Playwright suite that exercises real user-visible flows — the committed artifact the project can re-run forever, distinct from one-off live/exploratory checks. ## When to use When the workflow reaches an Integration or End-to-end tests step for a flow that spans multiple pages, services, or a full user journey, and the result needs to live in the repo and run again in CI on every change — not just be eyeballed once. ## Method Practices below are current Playwright guidance (see References for exact source pages). 1. **Test user-visible behavior, not implementation.** Assert on what an end user actually sees and does — text, roles, visible state — never internal state or private methods. This keeps tests resilient to refactors. 2. **Locate elements the way a user would find them.** Prefer `page.getByRole()`, `getByText()`, `getByLabel()`, `getByTestId()` over CSS/XPath selectors — user-facing locators survive DOM churn that breaks structural selectors. Reserve `getByTestId()` for elements with no meaningful role/text. 3. **Use web-first assertions, never manual polling.** Write `await expect(locator).toBeVisible()`, `.toHaveText(...)`, etc. — these auto-retry until the condition holds or the timeout expires. Never use `page.waitForTimeout()` in a committed test: it is a fixed sleep, is explicitly documented as debug-only, and is the single biggest source of flakiness. If a wait is genuinely needed,