playwright

Write stable Playwright 1.60+ end-to-end browser tests with locators and web-first assertions.

15|2|Updated May 23, 2026
One-click install
npx skills add https://github.com/VKirill/antigravity-for-claude-code --skill playwright-vkirill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: playwright
Source: https://github.com/VKirill/antigravity-for-claude-code/tree/main/skills/playwright
Command: npx skills add https://github.com/VKirill/antigravity-for-claude-code --skill playwright-vkirill

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents flaky end-to-end browser tests by guiding you to write Playwright E2E suites that use robust locators, web-first assertions, and production-grade configuration instead of brittle waits.

Core Features & Use Cases

  • Locator-first test writing: prioritize getByRole, then label/text/test-id strategies to make selectors resilient to UI refactors.
  • Stable synchronization: avoid waitForTimeout by relying on Playwright auto-waits and assertion retries (e.g., expect(...).toBeVisible()).
  • Production E2E readiness: support fixtures and storageState auth, network mocking/HAR replay, trace viewer debugging, sharding, and visual/ARIA snapshots for CI confidence.

Quick Start

Ask Claude Code: "Write a Playwright 1.60 E2E test for a login flow using getByRole/getByLabel, storageState auth, and assertions that never use waitForTimeout—include any needed reference guidance and CI-ready config notes."

Frequently Asked Questions about playwright

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write reliable Playwright E2E tests that do not break during UI refactors?

Reliable Playwright E2E tests prioritize resilient locators using getByRole, getByLabel, and test-id strategies instead of brittle CSS or XPath selectors. This approach ensures tests remain stable during UI styling changes and structural refactors while maintaining accurate element targeting.

How do I fix flaky Playwright tests caused by waitForTimeout and timing issues?

Flaky Playwright tests caused by waitForTimeout can be fixed by relying on Playwright's built-in auto-waits and web-first assertion retries, such as expect(...).toBeVisible(). These mechanisms automatically wait for elements to reach actionable states, eliminating arbitrary timeouts and timing-related test failures.

How do I reuse authentication state across multiple Playwright tests?

Playwright reuses authentication state across tests using storageState fixtures within the @playwright/test framework. This approach logs in once, saves the authenticated browser state, and injects it into subsequent tests, avoiding repetitive login flows and significantly reducing test execution time.

Can I run cross-browser E2E tests in parallel CI pipelines using Playwright?

Playwright supports cross-browser E2E testing in parallel CI pipelines through configurable browser projects and sharded execution. This enables distributing test suites across multiple CI machines and browser engines like Chromium, Firefox, and WebKit for faster, production-grade feedback.

What is the best way to mock network requests and API responses in Playwright?

The best way to mock network requests in Playwright is using the route API and HAR file replay for network mocking. This intercepts and fulfills network requests with predefined responses, allowing tests to run deterministically against complex API behaviors without relying on live backend services.

How do I debug a failing Playwright test in CI without a local browser?

Failing Playwright tests in CI can be debugged using Playwright's trace viewer and trace debugging capabilities. By enabling tracing in your configuration, you capture a detailed post-mortem timeline of test execution, including DOM snapshots, network logs, and console output for remote analysis.