playwright-e2e-review
БесплатноБез исполняемых скриптовНе проверенAudit Playwright E2E tests in the gc.platform suite (tests/playwright) against the four hard rules — no mocks, Page Object Model, work-by-fixture, one folder…
от fmflurry★ 173 звезды на GitHubОб этом скилле
Playwright E2E Review — gc.platform
Audit Playwright test code against the suite's four hard rules (from tests/playwright/CLAUDE.md) and its strict-TypeScript bar. This skill is read-only: produce findings the author can act on, don't patch. If the user wants the fixes applied, hand the findings to the playwright-e2e-authoring skill or make the edits in a separate, explicit step.
Path convention: All paths in this document are relative to tests/playwright/ (the test suite root).
When to activate
- Reviewing new or changed
.spec.ts,*.page.ts, or*.fixture.tsfiles. - A pre-merge / pre-commit check of E2E test changes.
- "Does this follow the Playwright conventions?" / "audit these tests".
Scope the review
Default to the changed files when there's a diff, otherwise the path the user names:
cd tests/playwright
git diff --name-only main...HEAD -- tests support # changed test files
Read each file fully before judging — context matters (e.g. a page.locator('tbody tr') inside a POM is allowed; the same inside a spec is not).
The checklist
Rule 1 — No mocks (Important)
The suite's entire value is that it hits the real stack. Any simulation is an Important finding.
grep -rnE "page\.route|context\.route|waitForTimeout|mockServiceWorker|msw|sinon|nock|page\.fulfill" tests support --include='*.ts'
(Or use the harness Grep tool.)
page.route()/context.route()/route.fulfill()→ network interception. Forbidden.page.waitForTimeout(...)or any arbitrary sleep → flaky and banned; replace with a web-first assertion on the awaited state.- MSW / sinon / nock / stub libraries, hardcoded response fixtures, fake data files → forbidden.
Admitted exception: A single page.route() with times: 1 is allowed only to force a failure shape the real stack cannot produce deterministically (e.g. a 401, or .abort()), scoped to one URL pattern, carrying a JSDoc justification. Link to ../playwright-e2e-authoring/references/spec.md#admitted-exceptions for examples and constraints. If the route stubs business data, simulates success, or widens beyond one request — Important.
Rule 2 — Page Object Model (Important)
grep -rnE "(page|authenticatedPage)\.(locator|getBy|click|fill|goto)\(" tests --include='*.spec.ts'
(Or use the harness Grep tool.)
- A spec calling
page.locator(...)/page.getByRole(...)/page.click(...)(or the same onauthenticatedPage) directly → DOM access leaked out of a POM. Move it into a POM method. - A spec that destructures
authenticatedPageto touch the DOM directly (rather than calling POM methods) is the same violation. - Every screen referenced by a spec should have a POM under
tests/<module>/pages/that extendsBasePage(support/pages/base.page.ts). - Inside POMs: flag fragile selectors (raw CSS/XPath, index-based
nth(...)) where agetByRole/getByLabel/getByTestIdwould work.page.locator('tbody tr')filtered by text is acceptable for structural collections.
False negatives (grep won't catch): Locators obtained via a destructured page stored in a variable (e.g. const { getByRole } = page; getByRole(...)), or obtained via context.newPage() inline in the test. Read the file to verify. False positive: page.goto in a public-route beforeEach is allowed (part of test setup, not implementation detail).
Rule 3 — Work by fixture (Important)
grep -rnE "from '@playwright/test'" tests --include='*.spec.ts' # specs must NOT import from here
grep -rnE "new \w+Page\(" tests --include='*.spec.ts' # POMs must come from fixtures
(Or use the harness Grep tool.)
- A spec importing
test/expectfrom@playwright/testinstead of its module fixture (./fixtures/<module>.fixture) → loses fixtures. Fix the import. new SomePage(...)inside a spec → POM instantiated by hand instead of injected. Provide it as a fixture key.- A module fixture should extend
base(public routes) orauth(authenticated routes) and re-exportexpect. - Authenticated-route POMs should be bound to
authenticatedPage, not a freshpage. - Admitted exceptions: Importing
BrowserContexttypes from@playwright/testis allowed for multi-context tests (Nit: the justification must be present). Hand-instantiating a POM withtest.use({ storageState: undefined })is allowed for alternate-tenant tests. Link to../playwright-e2e-authoring/references/spec.md#admitted-exceptionsfor constraints. - Orphan POMs: Each POM class under
tests/<module>/pages/must be exposed by a key in the module fixture. Flag any POMs that are imported nowhere (Nit).
Rule 4 — Per application module (Nit)
- Test folder
tests/<module>/must mirror a realfrontend/src/app/modules/<module>. Flag mismatched or invented module names. - POM, fixtures, and specs for a module stay colocated under that folder; cross-module helpers belong in
support/
Установить playwright-e2e-review в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл playwright-e2e-review?
Audit Playwright E2E tests in the gc.platform suite (tests/playwright) against the four hard rules — no mocks, Page Object Model, work-by-fixture, one folder per frontend feature module — plus strict-TypeScript quality. Use whenever the user wants to review, check, audit, or "make sure it follows the conventions" for `.spec.ts` / POM / fixture files, before merging or committing E2E test changes, or asks "does this respect the Playwright rules?". Read-only: reports findings by tag (Important or Nit) with file:line and a concrete fix — it does not edit files.
Как установить скилл playwright-e2e-review?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл playwright-e2e-review запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic