Playwright
Personal AI agent skills I use in development workflows.
npx -y skills add DobroslavRadosavljevic/skills --skill playwrightAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Build, review, debug, configure, migrate, or plan Playwright browser automation and E2E tests with current docs. Use for @playwright/test, playwright, playwright.config, locators, getByRole, assertions, fixtures, Page Object Model, storageState auth, network mocking, HAR, traces, UI Mode, codegen, CI sharding, Docker, APIRequestContext, experimental component testing, accessibility, screenshots, visual comparisons, and Playwright MCP or CLI agent tooling.
SKILL.md
4.3 KB, as published. Nobody here has run it
Playwright
Use this skill when work touches Playwright Test, browser automation, E2E tests, locators, fixtures, auth setup, network mocking, traces, CI, API testing alongside UI, or agent browser tooling built on Playwright.
Workflow
- Inspect the local Playwright surface before changing code:
- Package versions for
@playwright/test,playwright, optional@playwright/browser-*, experimental CT packages, and Node. - Config:
playwright.config.ts/.js,testDir, projects,useoptions,webServer, reporters, retries/workers. - Test layout: specs, setup projects, fixtures, POM classes,
playwright/.auth, snapshots, and CI workflows. - Runtime intent: E2E UI, API-only, auth reuse, network mocks, visual/a11y checks, component tests, or agent-driven exploration.
- Package versions for
- Refresh docs when the user asks for latest/current behavior, versions are unclear, or the work touches CI, CT, or agent tooling. Start from source-map.md.
- For install, Library vs Test, config, projects,
webServer, and CLI, use setup-core.md. - For locators, actions, auto-waiting, web-first assertions, and anti-patterns, use locators-assertions.md.
- For fixtures, POM, auth/
storageState, parallelism, and network/HAR mocking, use fixtures-auth-network.md. - For traces, UI Mode, debug, CI/sharding/Docker, API testing, CT, a11y/visuals, and agent tooling, use debugging-ci-advanced.md.
- Implement in the existing project style:
- Prefer
@playwright/testfor E2E. Use theplaywrightlibrary only for standalone scripts/automation without the Test Runner. - After changing Playwright package versions, reinstall matching browser binaries.
- Match local locator conventions, fixture patterns, and CI artifact settings unless they contradict official guidance.
- Prefer
Playwright Judgment
- Prefer user-facing locators:
getByRolefirst, then label/placeholder/text/alt/title, thengetByTestId. Avoid CSS/XPath unless justified. - Assert with web-first
await expect(...).toBeVisible()(and siblings). Neverexpect(await locator.isVisible()).toBe(true). - Trust auto-waiting. Do not ship
waitForTimeout/ sleep-based synchronization. - Keep tests isolated. Prefer setup-project
storageStateor worker-scoped accounts over shared mutable login in every test. - Mock third-party or uncontrollable network at
context/page.route; startwaitForResponsebefore the triggering action. - Local debug path: UI Mode → Trace Viewer for CI failures →
--debug/ Inspector for step-through. - CI defaults:
forbidOnly, retries,trace: 'on-first-retry',screenshot: 'only-on-failure', install with--with-depsor a version-matched Docker image, scale with shards not only workers. - Treat experimental CT (React/Vue) as optional and separate from E2E. Svelte CT package was removed.
- For coding agents writing tests in-repo, prefer Playwright CLI + skills when available; use Playwright MCP for live exploratory browser loops. Do not confuse harness browser tools with
@playwright/mcp.
Verification
Prefer the repo's existing checks. For meaningful Playwright work, include the relevant subset:
- Focused
bunx playwright testfor the changed specs/projects (--project, file path, or-gtitle). - UI Mode or headed run when locator/timing behavior is unclear.
- Trace or HTML report review for flake, actionability, or network failures.
- CI-shaped smoke when changing retries, shards, reporters, Docker tags, auth setup, or
webServer. - Snapshot update (
-u) only when visual baselines intentionally change, generated on the same OS/browser as CI when possible. - Typecheck for TypeScript configs, fixtures, and POM helpers when the project typechecks tests.