Instructions for building robust Playwright tests by prioritizing helper functions and stable selectors.

Install

mkdir -p .claude/skills/playwright && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/424" && unzip -o skill.zip -d .claude/skills/playwright && rm skill.zip

Installs to .claude/skills/playwright

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

How to make good playwright (e2e) tests for this project.
57 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Refactor common test code into shared helper files
  • Implement consistent test ID attributes for element selection
  • Execute end-to-end test suites
  • Use shared helper functions for test stability

How it works

The skill enforces coding standards that prioritize stable element selection via test IDs and modular helper functions over brittle, manual wait strategies.

Inputs & outputs

You give it
Test scenario requirements
You get back
End-to-end test code

When to use playwright

  • Creating new end-to-end test suites
  • Refactoring legacy test code for stability
  • Implementing consistent data-test-id patterns

About this skill

Skill Instructions

  • Always look for opportunities to refactor common code to the playwright_helpers.ts file.
  • Never use explicit timeouts to wait for things to happen. If you can't get it to work without that, get the user's permission and then record that permission in a comment.
  • Never match elements using fragile things like matching on labels, matching on prompts, etc. Add test ID attributes as needed.
  • Use inexpensive_model_for_testing from playwright_helpers unless instructed by the user to use a different one. If they agree, record the user's permission as a comment.
  • You MUST NOT use mocks.

When not to use it

  • When using explicit timeouts to wait for elements
  • When using fragile selectors like labels or prompts

Prerequisites

playwright_helpers.ts

Limitations

  • Mocks are strictly prohibited
  • Explicit timeouts require explicit user permission and documentation

How it compares

It mandates a structured, maintainable approach to testing rather than writing ad-hoc, fragile test scripts.

Compared to similar skills

playwright side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
playwright (this skill)237moNo flagsIntermediate
webapp-testing3533moReviewIntermediate
ui-ux-expert-skill919moReviewAdvanced
skill-creator1283moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

webapp-testing

anthropics

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

353585

ui-ux-expert-skill

fercracix33

Technical workflow for implementing accessible React user interfaces with shadcn/ui, Tailwind CSS, and TanStack Query. Includes 6-phase process with mandatory Style Guide compliance, Context7 best practices consultation, Chrome DevTools validation, and WCAG 2.1 AA accessibility standards. Use after Test Agent, Implementer, and Supabase agents complete their work.

91244

skill-creator

anthropics

Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.

128200

python-testing-patterns

wshobson

Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing testing best practices.

77204

dependency-upgrade

wshobson

Manage major dependency version upgrades with compatibility analysis, staged rollout, and comprehensive testing. Use when upgrading framework versions, updating major dependencies, or managing breaking changes in libraries.

26240

playwright-mcp

sfc-gh-dflippo

Browser testing, web scraping, and UI validation using Playwright MCP. Use this skill when you need to test Streamlit apps, validate web interfaces, test responsive design, check accessibility, or automate browser interactions through MCP tools.

33197

Search skills

Search the agent skills registry