playwright
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.zipInstalls 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.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
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
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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| playwright (this skill) | 23 | 7mo | No flags | Intermediate |
| webapp-testing | 353 | 3mo | Review | Intermediate |
| ui-ux-expert-skill | 91 | 9mo | Review | Advanced |
| skill-creator | 128 | 3mo | Review | Advanced |
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.
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.
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.
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.
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.
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.