playwright-testing

Write stable Playwright E2E tests with web-first assertions and resilient selectors.

26|4|Updated Apr 9, 2026
One-click install
npx skills add https://github.com/marmelab/crm-builder --skill playwright-testing-marmelab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: playwright-testing
Source: https://github.com/marmelab/crm-builder/tree/main/claudeConfig/.claude/skills/playwright-testing
Command: npx skills add https://github.com/marmelab/crm-builder --skill playwright-testing-marmelab

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you avoid flaky, slow Playwright end-to-end tests by teaching patterns for stable assertions, resilient selectors, and deterministic networking.

Core Features & Use Cases

  • Web-first assertions: Use expect(locator) with auto-retry for visibility, text, counts, and enabled/disabled states instead of manual DOM checks.
  • User-visible locators: Prefer getByRole, getByLabel, getByText, and getByTestId as a fallback to reduce breakage during UI refactors.
  • Deterministic network testing: Mock responses with page.route() and validate real calls with page.waitForResponse() while preventing race conditions.
  • Maintainable test structure: Organize suites with test.describe, share setup with test.beforeEach, and reduce duplication with fixtures and page objects.
  • Practical configuration: Apply best-practice playwright.config.ts options like parallelization, CI-safe retries, tracing, screenshots-on-failure, and auth via storageState.

Quick Start

Use the playwright-testing skill to write a stable Playwright E2E suite for a web app’s critical user flows with role-based locators, web-first assertions, and mocked network routes.

Frequently Asked Questions about playwright-testing

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

FAQPage Schema
How do I stop Playwright E2E tests from being flaky and slow?

Playwright E2E tests become less flaky and slow when you use auto-retrying web-first assertions like expect(locator) and resilient user-centric locators such as getByRole instead of manual DOM checks.

What's the best way to mock network responses in Playwright tests?

Mocking network responses in Playwright tests is best done using page.route() to intercept requests and page.waitForResponse() to coordinate real calls, preventing race conditions and ensuring deterministic network testing.

How do I migrate Cypress or Selenium tests to Playwright?

Migrating Cypress or Selenium tests to Playwright requires adopting web-first assertions, user-visible locators like getByRole, and structured suites with test.describe, hooks, and fixtures to ensure deterministic UI verification.

Does Playwright support authenticated sessions for E2E testing?

Playwright supports authenticated sessions in E2E testing through the storageState configuration option, which saves and reuses login states across tests to streamline authenticated UI verification.

Why do my Playwright tests break during UI refactors?

Playwright tests break during UI refactors when relying on brittle CSS or XPath selectors instead of user-visible locators like getByRole, getByLabel, getByText, or getByTestId, which reduce breakage during structural changes.

How do I configure Playwright for CI pipelines?

Configuring Playwright for CI pipelines involves setting best-practice playwright.config.ts options for parallelization, CI-safe retries, tracing, and screenshots-on-failure to achieve reliable, production-oriented automated test execution.