Skip to content
Skills Library
Programming · Testing

playwright-e2e-testing

/playwright-e2e-testing

Write, fix, or review Playwright end-to-end tests, especially for Next.js apps - locators, auth via storageState, flaky waits, server-side fetch mocking, CI against a production build. Use for *.spec.ts / e2e/ / playwright.config changes or flaky browser tests. For unit and component tests use frontend-testing.

Repository
stackfit ↗
Licence
MIT
Last repository change
26.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 26.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Write, fix, or review Playwright end-to-end tests, especially for Next.js apps - locators, auth via storageState, flaky waits, server-side fetch mocking, CI against a production build. Use for *.spec.ts / e2e/ / playwright.config changes or flaky browser tests. For unit and component tests use frontend-testing.

Original author description

Write, fix, or review Playwright end-to-end tests, especially for Next.js apps - locators, auth via storageState, flaky waits, server-side fetch mocking, CI against a production build. Use for *.spec.ts / e2e/ / playwright.config changes or flaky browser tests. For unit and component tests use frontend-testing.

How it works

  1. Start from repository evidence
  2. Rules that prevent flaky tests
  3. Next.js specifics
  4. Run and debug
Original SKILL.md headings · 31 lines, 404 words
SKILL.md preview
---
name: playwright-e2e-testing
description: Write, fix, or review Playwright end-to-end tests, especially for Next.js apps - locators, auth via storageState, flaky waits, server-side fetch mocking, CI against a production build. Use for *.spec.ts / e2e/ / playwright.config changes or flaky browser tests. For unit and component tests use frontend-testing.
---

# Playwright E2E

## Start from repository evidence

1. Read `AGENTS.md` and the testing page linked from `docs/agent/index.md`.
2. Read `playwright.config.*` (`testDir`, `projects`, `webServer`, `use.baseURL`, `testIdAttribute`), existing fixtures, page objects, and the auth setup project.
3. Use the repo's package manager and scripts. Match existing file names, tags, and fixture style; do not introduce page objects or new fixtures if the suite does not use them.

## Rules that prevent flaky tests

- **Locators:** `getByRole` with `name`, then `getByLabel`, `getByText`, then `getByTestId` (respect a configured `testIdAttribute`). No CSS chains, XPath, or `.nth()` on unstable lists.
- **Waiting:** only web-first assertions (`await expect(locator).toBeVisible()`, `toHaveURL`, `toHaveText`). Never `waitForTimeout`. Avoid `waitForLoadState("networkidle")`: Next.js prefetching and streaming keep the network busy. After navigation use `await expect(page).toHaveURL(...)` or `page.waitForURL`.
- **Hydration:** a click on a server-rendered button before hydration can be lost. Assert the result of the interaction (a visible state change), not just that the click ran; if the suite has a hydration-ready helper, use it.
- **Server Actions / forms:** assert on the UI that the action produces (toast, updated row, redirect URL), not on internal network calls.
- **Isolation:** every test creates the data it needs (API or DB fixture) and can run in parallel and in any order. No dependence on a previous test.
- **Auth:** log in once in a setup project and save `storageState` per role; tests reuse it. Do not log in through the UI in every test.

## Next.js specifics

- **CI runs against a production build** (`next build` then `next start`) through `webServer`; `next dev` compiles routes on first hit and causes timeouts. Use `reuseExistingServer: !process.env.CI` locally.
- **`page.route` only intercepts browser requests.** Fetches made by Server Components, Route Handlers, or Server Actions run on the server and are not intercepted. Point the server at a test backend/database via env, or use the repo's existing server-side mocking (MSW in the server, or `next/experimental/testmode/playwright` if already set up).
- **Instant navigation / static shell guards** under Cache Components: use the `next-cache-components-optimizer` skill (`@next/playwright` `instant()`).
- **Visual snapshots:** fixed viewport, `animations: "disabled"`, mask dynamic regions (dates, avatars). Snapshots are per OS/browser; only update them on the platform CI uses.

## Run and debug

- Narrow first: `<pm> playwright test <file> -g "<title>" --project=chromium`.
- Flaky: `--repeat-each=10 --workers=1`, then `--trace on` and `playwright show-trace`.
- Report the exact command, pass/fail, and any test you could not run (for example missing env or seed data).

Versions

RepositoryScoreLicence
This page · amin0075/stackfit100MIT
amadeusitgroup/otter100BSD-3-Clause
fugazi/test-automation-skills-agents100MIT
JPeetz/agent-skills90MIT

Database snapshot: 13.11.2026 · package version 7cb39ab9ce3b (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100v1-e2e-testing
    Use when implementing or debugging browser end-to-end tests, especially Playwright or flaky tests. Triggers on "E2E test", "Playwright", or "flaky browser test".
  • 95frontend-playwright-testing
    Use this skill when the user says 'Playwright test', 'write an E2E test', 'component test with Playwright', 'flaky e2e', 'getByRole locator', 'Playwright auth setup', 'storageState', 'trace viewer', 'Playwright CI sharding'. It writes resilient Playwright end-to-end and…
  • 100web-testing
    Tests web applications in real browsers with Playwright end-to-end automation. Use when writing *.spec.ts files, playwright.config.ts or an e2e CI job, when a browser test is flaky or times out, when reusing login state or mocking the network, or when choosing component versus end-to-end tests.
  • 100playwright
    Playwright E2E testing framework. Covers browser automation, assertions, and test generation. Use for end-to-end testing. USE WHEN: user mentions "playwright", "e2e test", "browser test", "end-to-end", asks about "page.goto", "page.click", "locators", "cross-browser testing",…
  • 95qa-e2e-playwright
    Use this skill when the user says 'playwright', 'playwright test', 'playwright config', 'locators', 'storageState', 'trace viewer', 'playwright codegen', 'playwright sharding', 'playwright fixtures'. It writes and structures Playwright Test suites in TypeScript: config,…
  • 100e2e-playwright-testing
    End-to-end testing with Playwright for web applications. Use when writing E2E tests, browser automation, form submission testing, or user flow testing. Triggers on "playwright", "e2e test", "browser test", "end-to-end", "form flow testing", or test files in tests/e2e/.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.