playwright

Define standards and best practices for Playwright E2E testing in TypeScript.

2|Updated Aug 8, 2024
One-click install
npx skills add https://github.com/walid-mos/mac-config --skill playwright-walid-mos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: playwright
Source: https://github.com/walid-mos/mac-config/tree/main/claude/.claude/skills/playwright
Command: npx skills add https://github.com/walid-mos/mac-config --skill playwright-walid-mos

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill establishes best practices for writing robust end-to-end tests that verify real user interactions and visual correctness in a browser environment, ensuring application quality.

Core Features & Use Cases

  • Component-Level E2E: Verifies visual appearance and browser-specific interactions of individual UI components.
  • Journey-Level E2E: Tests complete user workflows across multiple pages, like login or checkout processes.
  • Use Case: Ensure your application's login form looks and behaves correctly across different browsers and that the entire user signup flow is seamless from start to finish.

Quick Start

Use the playwright skill to write an end-to-end test for the user login journey.

Frequently Asked Questions about playwright

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

FAQPage Schema
How do I write E2E tests for user journeys using Playwright?

To write E2E tests for user journeys, implement the Page Object Model with TypeScript to verify multi-page workflows like login or checkout. This approach establishes standards for selector priority and assertion patterns to ensure reliable browser automation.

What is the best way to handle visual regression testing in TypeScript?

Visual regression testing in TypeScript verifies the visual appearance and browser-specific interactions of individual UI components. Establishing component-level E2E testing standards ensures visual correctness across different browsers without relying solely on functional assertions.

Does this Playwright testing standard support network mocking for E2E tests?

Yes, this Playwright testing standard supports network mocking to isolate tests from external dependencies. By mocking network requests, you ensure reliable browser automation and stable CI/CD configurations for your end-to-end test suites.

Can I use Page Object Model patterns for component-level testing?

Yes, you can use the Page Object Model pattern for component-level testing to structure selector priority and assertion patterns. This implementation standardizes both component-level visual regression and full user journey verification across multiple pages.

Why should I standardize selector priority in Playwright browser automation?

Standardizing selector priority in Playwright browser automation prevents flaky tests by targeting robust element locators. This standard, combined with strict assertion patterns and CI/CD configurations, guarantees reliable E2E test execution across different browser environments.

What are the limitations of journey-level E2E testing across multiple pages?

Journey-level E2E testing across multiple pages can become slow and brittle if selector priority and network mocking are not properly configured. To mitigate these limitations, maintain strict CI/CD configurations and use the Page Object Model to isolate journey steps.