Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
oakoss avatar

Playwright

  • 376 installs
  • 14 repo stars
  • Updated March 2, 2026
  • oakoss/agent-skills

playwright is a Claude Code skill that builds Playwright end-to-end tests for authentication, navigation, and critical UI flows with fixtures and CI-ready headless runs for developers shipping web applications.

About

playwright is a Claude Code skill for authoring browser end-to-end tests with the Playwright test framework. It helps developers cover authentication flows, page navigation, and critical UI paths using fixtures, page objects, and headless configurations suitable for CI pipelines. The skill guides selector strategies, async waiting patterns, and test isolation so suites run reliably in GitHub Actions or similar runners. Reach for it when a web app needs automated regression coverage beyond unit tests or when auth-gated flows require repeatable browser verification before release.

  • E2E browser tests
  • Auth flows
  • Fixtures
  • Headless CI
  • Selector stability

Playwright by the numbers

  • 376 all-time installs (skills.sh)
  • +4 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #662 of 2,153 Testing & QA skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/oakoss/agent-skills --skill playwright

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs376
repo stars14
Last updatedMarch 2, 2026
Repositoryoakoss/agent-skills

How do you write Playwright E2E tests for auth flows?

Build Playwright E2E tests for auth, navigation, and critical UI flows with fixtures and CI-ready headless runs.

Who is it for?

Frontend and full-stack developers adding browser E2E coverage for auth, navigation, and release-critical UI paths.

Skip if: Backend-only API testing without a browser or teams standardized on Cypress or Selenium instead of Playwright.

When should I use this skill?

A developer asks to add Playwright tests, cover login flows, configure headless CI runs, or test critical navigation paths.

What you get

Playwright test files, reusable fixtures, and CI-ready headless test configuration for critical UI flows.

  • Playwright test suite
  • CI headless configuration

Files

SKILL.mdMarkdownGitHub ↗

Playwright

Overview

Playwright is a browser automation framework for Node.js and Python supporting Chromium, Firefox, and WebKit with a single API. It provides auto-waiting, web-first assertions, and full test isolation for reliable end-to-end testing.

When to use: Browser automation, web scraping, screenshot/PDF generation, API testing, configuring Playwright Test, troubleshooting Playwright errors, stealth mode and anti-bot bypass.

When NOT to use: Simple HTTP requests (use fetch), unit testing (use Vitest/Jest), serverless scraping at scale (consider Cloudflare Browser Rendering). For E2E test architecture (Page Object Models, CI sharding, test organization, authentication patterns), use the e2e-testing skill.

Quick Reference

PatternAPI / ConfigKey Points
Basic testtest('name', async ({ page }) => {})Auto-wait, web-first assertions, test isolation
Locatorpage.getByRole() / page.locator()Prefer role/label/text selectors over CSS
Assertionexpect(locator).toBeVisible()Auto-retrying, configurable timeout
API testingrequest fixture / apiRequestContextSend HTTP requests, validate responses
Aria snapshotexpect(locator).toMatchAriaSnapshot()Validate accessibility tree structure via YAML
Class assertionexpect(locator).toContainClass('active')Match individual CSS class names (v1.52+)
Visible filterlocator.filter({ visible: true })Match only visible elements (v1.51+)
Test steptest.step('name', async (step) => {})Timeout, skip, and attachments (v1.50+)
Stealth modeplaywright-extra + stealth pluginPatches 20+ detection vectors
Authenticated sessioncontext.cookies() + addCookies()Save/restore cookies and IndexedDB for persistence
Screenshotpage.screenshot({ fullPage: true })Wait for key elements to load first
PDF generationpage.pdf({ format: 'A4' })Chromium only, set printBackground: true
Clock APIpage.clockFreeze, fast-forward, or simulate time in tests
A11y assertionstoHaveAccessibleName, toHaveRoleNative assertions without axe-core dependency
Viewport assertionexpect(locator).toBeInViewport()Assert element is within the visible viewport
Changed tests only--only-changed=$GITHUB_BASE_REFRun only test files changed since base branch
Dockermcr.microsoft.com/playwright:v1.58.2-nobleUse --init --ipc=host flags
Debug methodspage.consoleMessages() / page.requests() (v1.56+)No event listeners needed
SpeedboardHTML reporter (v1.57+)Identifies slow tests and bottlenecks
Playwright Agentsnpx playwright init-agentsPlanner, generator, healer for LLM-driven testing
Flaky test detection--fail-on-flaky-tests (v1.50+)Exit code 1 on flaky tests in CI
Modify live responsesroute.fetch() + route.fulfill()Intercept real response, tweak JSON, return it
Soft assertionsexpect.soft(locator)Don't stop test on failure, report all at end
Retry blockexpect(async () => {}).toPass()Default timeout is 0 (forever) — always set one
Custom matchersexpect.extend() / mergeExpects()Define or combine custom assertion methods
Actionability matrixPer-action auto-wait checksclick: all 5 checks, fill: 3, focus/blur: none
Test modifierstest.fixme() / test.fail() / test.slow()fixme=skip+track, fail=assert failure, slow=3x
Parallel modestest.describe.configure({ mode: 'serial' })serial, parallel, or default per-describe block
Teardown projectsteardown option on setup projectsAuto-cleanup after all dependents finish

Common Mistakes

MistakeCorrect Pattern
Using CSS selectors over role selectorsPrefer getByRole, getByLabel, getByText for resilience
Not closing browserAlways await browser.close() in finally block
Using setTimeout for waitsUse locator auto-wait or waitForLoadState
page.pause() left in CI codeGuard with if (!process.env.CI) — hangs CI indefinitely
Clicking without waitingUse locator().click() with built-in auto-wait
Shared state between testsEach test gets fresh context via fixtures
Testing implementation detailsAssert user-visible behavior, not DOM structure
Hardcoded waits for dynamic contentWait for selector appearance or content stabilization
Missing await on assertionsAll expect() assertions return promises — must be awaited
Same user agent for all scrapingRotate user agents for high-volume scraping
Using setTimeout for time-dependent testsUse page.clock API to freeze/fast-forward time
Installing axe-core for simple a11y checksUse native toHaveAccessibleName/toHaveRole assertions
Using toPass() without explicit timeoutAlways pass { timeout: 10_000 } — default is 0 (forever)
Service worker silently blocking page.route()Set serviceWorkers: 'block' in context config when using MSW
Using fill() for autocomplete/debounce inputsUse pressSequentially() with optional delay for per-keystroke handling
storageState losing sessionStoragestorageState only saves cookies + localStorage — inject sessionStorage via addInitScript()

Delegation

  • Selector troubleshooting: Use Explore agent
  • Test pattern review: Use Task agent
  • Code review: Delegate to code-reviewer agent
For E2E test architecture, Page Object Model patterns, CI sharding strategies, authentication flows, visual regression workflows, or test organization, use the e2e-testing skill.

References

  • Quick start and installation
  • E2E testing patterns and assertions
  • Selector strategies and best practices
  • Configuration and Docker deployment
  • Docker and CI
  • Debug methods and performance analysis
  • Common automation patterns
  • Stealth mode and anti-bot bypass
  • Known issues and solutions
  • Site-specific blocking and bypasses
  • Troubleshooting common problems
  • Network testing, mocking, and API patterns
  • Input patterns, actionability, and test modifiers
  • Advanced assertions, polling, custom matchers, and annotations
  • Advanced topics: MCP, AI agents, parallel contexts

Related skills

FAQ

What flows does the playwright skill cover?

The playwright skill covers authentication, navigation, and critical UI flows. It helps developers write Playwright tests with fixtures and headless CI configuration for repeatable browser regression.

Is the playwright skill CI-ready?

The playwright skill configures headless Playwright runs suitable for CI pipelines. It emphasizes fixtures and isolation patterns so tests pass reliably in automated build environments.

Testing & QAtestingfrontend

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.