playwright-testing

Implements end-to-end web application tests with Playwright using Page Objects and cross-browser projects.

Updated Jan 16, 2026
One-click install
npx skills add https://github.com/dudqks0319-cpu/antigravity-skills --skill playwright-testing-dudqks0319-cpu
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: playwright-testing
Source: https://github.com/dudqks0319-cpu/antigravity-skills/tree/main/playwright-testing
Command: npx skills add https://github.com/dudqks0319-cpu/antigravity-skills --skill playwright-testing-dudqks0319-cpu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @playwright/test, @faker-js/faker.

What problem does it solve? Writing reliable end-to-end tests for web applications is difficult: brittle selectors break on UI changes, tests flake due to timing issues, and setting up authentication, CI pipelines, and cross-browser coverage requires deep Playwright knowledge. ## Core Features & Use Cases - Page Object Model & Locator Strategy: Provides base page classes, page implementations, and a priority-ordered locator strategy (role-based, text, test IDs) to keep tests resilient. - Auth, Mocking & Assertions: Covers global auth setup with stored storage state, API mocking via route interception, web-first auto-waiting assertions, and visual screenshot testing. - CI/CD & Dead Link Detection: Includes GitHub Actions workflows, trace-based debugging, and mandatory dead link and broken image detection tests for deployments. - Use Case: A team shipping a Next.js app uses this Skill to scaffold an e2e/ directory with login and checkout flow tests, run them across Chromium, Firefox, WebKit, and mobile viewports in GitHub Actions, and block deploys when dead links are found. ## Quick Start Set up Playwright end-to-end tests for my web app with a login page object, an auth setup project, and a GitHub Actions workflow that runs the tests on Chromium.

Frequently Asked Questions about playwright-testing

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

FAQPage Schema
How do I write end-to-end tests with Playwright?▼

Install @playwright/test, configure playwright.config.ts with projects for each browser, and write tests using role-based locators like page.getByRole. Organize tests with the Page Object Model so selectors and actions live in reusable page classes.

What is the best locator strategy in Playwright?▼

Use role-based locators such as getByRole and getByLabel first, since they mirror how users interact with the page and resist UI changes. Use getByTestId for stable explicit hooks, and avoid CSS selectors and XPath, which are brittle.

How do I handle authentication in Playwright tests?▼

Create a setup project that logs in once and saves the browser state with storageState to a file. Other projects declare a dependency on the setup project and reuse the stored state, so each test starts already authenticated.

Can Playwright run tests in CI with GitHub Actions?▼

Yes. A workflow installs dependencies, runs npx playwright install --with-deps, then executes npx playwright test with environment secrets for base URL and credentials. Upload the playwright-report artifact on failure for debugging.

Why are my Playwright tests flaky?▼

Flakiness usually comes from hardcoded waits like waitForTimeout, shared state between tests, or brittle CSS selectors. Replace manual waits with auto-waiting web-first assertions, isolate each test, and use role-based locators.

How do I detect dead links on my website with Playwright?▼

Collect all anchor href attributes on each page, request each URL with the APIRequestContext, and assert every response returns an OK status. A crawler variant can follow internal links to check the entire site, and a scheduled CI workflow runs it weekly.