writing-tests

Enforce Playwright testing patterns with selectors, POMs, and AAA structure.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/anthony-fdez/claude-skills --skill writing-tests-anthony-fdez
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-tests
Source: https://github.com/anthony-fdez/claude-skills/tree/main/.claude/skills/writing-tests
Command: npx skills add https://github.com/anthony-fdez/claude-skills --skill writing-tests-anthony-fdez

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive framework and best practices for writing reliable, maintainable, and efficient end-to-end tests using Playwright, ensuring application quality and stability.

Core Features & Use Cases

  • Standardized Test Structure: Enforces the AAA pattern for clear and organized tests.
  • Selector Prioritization: Guides users to use data-test attributes, roles, and text content for resilient selectors, avoiding brittle CSS selectors.
  • Page Object Model (POM): Promotes the use of POMs to encapsulate page interactions, improving code reusability and maintainability.
  • Test Configuration & Tagging: Supports environment-specific commands and test categorization (e.g., @smoke, @regression).
  • Mock Data & Helpers: Facilitates the use of mock data and helper functions for isolated and repeatable test execution.
  • Debugging Tools: Outlines strategies for debugging, including headed mode, debug mode, trace viewer, and slow-motion execution.

Quick Start

Use the writing-tests skill to create a new Playwright test file for the login page, following the AAA pattern and using data-test attributes for selectors.

Frequently Asked Questions about writing-tests

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

FAQPage Schema
How do I structure Playwright E2E tests for better readability?

Use the AAA pattern to structure Playwright E2E tests, separating Arrange, Act, and Assert steps for clear organization. This standardized structure keeps test suites readable and maintainable as they scale.

What is the best selector strategy for resilient Playwright tests?

Prioritize data-test attributes, roles, and text content for resilient Playwright selectors. This strategy avoids brittle CSS selectors, ensuring end-to-end tests remain stable despite underlying DOM structure changes.

How do I use the Page Object Model in Playwright test development?

Implement the Page Object Model (POM) to encapsulate page interactions and element selectors within dedicated classes. This pattern maximizes code reusability and improves test maintainability across large Playwright suites.

Can I categorize Playwright tests using tags like smoke or regression?

Yes, you can categorize Playwright tests using tags like @smoke and @regression. This test configuration supports environment-specific commands, allowing you to filter and execute targeted test categories during CI.

What tools are available for debugging failing Playwright tests?

Debug failing Playwright tests using built-in strategies like headed mode, debug mode, trace viewer, and slow-motion execution. These debugging tools help isolate failures and inspect test execution step by step.