One-click install
npx skills add https://github.com/ever-works/ever-works --skill playwright-best-practices-ever-works
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: playwright-best-practices
Source: https://github.com/ever-works/ever-works/tree/main/.agents/skills/playwright-best-practices
Command: npx skills add https://github.com/ever-works/ever-works --skill playwright-best-practices-ever-works

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to writing effective Playwright tests, covering best practices for various testing scenarios and helping developers ensure their tests are reliable and maintainable.

Core Features & Use Cases

  • Best Practices Guide: Offers detailed insights and recommendations for writing E2E, component, API, visual regression, accessibility, security, i18n, Electron, and browser extension tests.
  • Activity-Based References: Provides context-specific references for writing tests, debugging, and maintaining test suites based on the user's current activity.
  • Quick Decision Tree: A streamlined guide to choose the right testing approach for different scenarios.
  • Test Validation Loop: Outlines steps for writing and validating tests, ensuring they run successfully and consistently.
  • Framework-Specific Testing: Guidance on testing Angular, Vue, React, and Next.js applications.
  • Refactoring & Maintenance: Tips for improving existing tests and organizing test suites.
  • Infrastructure & Configuration: Instructions for setting up projects, configuring CI/CD pipelines, and optimizing performance.

Quick Start

Activate the 'playwright-best-practices' skill and describe your testing need (e.g., "I need help writing an E2E test for a login flow").

Frequently Asked Questions about playwright-best-practices

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

FAQPage Schema
What's the best way to write reliable Playwright E2E tests for a login flow?

Writing reliable Playwright E2E tests involves following established best practices for locators, authentication state, and assertions. This skill provides context-specific references and a test validation loop to ensure your login flow tests run consistently and remain maintainable.

How do I configure Playwright for visual regression and accessibility testing?

Configuring Playwright for visual regression and accessibility testing requires specific framework configurations and assertion libraries. This skill offers detailed guidance on implementing these test types, ensuring comprehensive coverage and reliable execution across different browsers.

Does Playwright support component testing for React, Vue, Angular, and Next.js frameworks?

Playwright supports component testing for React, Vue, Angular, and Next.js frameworks. This skill provides framework-specific testing guidance, helping you set up projects and write component tests that validate UI behavior effectively within your existing tech stack.

How do I debug and refactor an existing Playwright test suite to improve maintainability?

Debugging and refactoring an existing Playwright test suite requires analyzing flaky tests and reorganizing test logic. This skill provides activity-based references for maintenance, offering tips to improve test structure, optimize performance, and ensure consistent suite execution.

Can I use Playwright to test Electron apps and browser extensions?

Playwright can be used to test Electron apps and browser extensions through specialized configuration setups. This skill includes best practices for these specific testing scenarios, guiding you through the necessary infrastructure setup to validate desktop and extension environments.

How do I set up Playwright in a CI/CD pipeline for optimal test performance?

Setting up Playwright in a CI/CD pipeline involves configuring infrastructure for parallel execution and managing browser dependencies. This skill provides instructions for optimizing pipeline performance, configuring projects, and ensuring your tests execute efficiently in automated environments.