playwright-e2e-builder
What it does
This skill helps your AI agent build browser test suites with Playwright. It is for developers who want automated tests for key user flows such as sign-up or checkout.
When to use it
- βWhen you want Playwright set up from scratch in an existing project.
- βWhen you need end-to-end tests for important user flows like signup or checkout.
- βWhen you want Playwright tests to run in CI with sharding and retries.
Skill link
https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/playwright-e2e-builder/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βSet up Playwright tests for my signup and checkout flows and run them in GitHub Actions.β
5 new skills a week. 1 minute to read.
How it works
The agent first explores the project's framework, routes and login flow, and asks questions to plan. Then it builds the tests using the page object pattern and saved authentication state.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Playwright E2E Test Suite Builder
When to use
Use this skill when you need to:
- Set up Playwright from scratch in an existing project
- Build E2E tests for critical user flows (signup, checkout, dashboards)
- Implement Page Object Model for maintainable test architecture
- Configure authentication state persistence across tests
- Set up visual regression testing with screenshots
- Integrate Playwright into CI/CD with sharding and retries
Phase 1: Explore (Plan Mode)
Enter plan mode. Before writing any tests, explore the existing project:
Project structure
- Find the tech stack: is this React, Next.js, Vue, SvelteKit, or another framework?
- Check if Playwright is already installed (
playwright.config.ts,@playwright/testin package.json) - Look for existing test directories (
e2e/,tests/,__tests__/) - Check for existing E2E tests in Cypress, Selenium, or other frameworks (migration context)
- Find the dev server command and port (
npm run dev,next dev, etc.)
Application structure
- Identify the main routes/pages (look at router config, pages directory, or route files)
- Find authentication flow (login page URL, auth API endpoints, token storage)
- Check for test IDs in components (
data-testid,data-test,data-cyattributes) - Look for API routes that tests might need to seed data through
- Check
.envfiles for test-specific environment variables
CI/CD
- Check for existing CI config (
.github/workflows/,.gitlab-ci.yml,Jenkinsfile) - Look for Docker or docker-compose setup (useful for consistent test environments)
- Check if there's a staging/preview environment URL pattern
Phase 2: Interview (AskUserQuestion)
Use AskUserQuestion to clarify requirements. Ask in rounds.
Round 1: Scope and critical flows
Question: "What are the critical user flows to test?"
Header: "Flows"
multiSelect: true
Options:
- "Authentication (signup, login, logout, password reset)" β Core auth flows
- "Core CRUD (create, read, update, delete main resources)" β Primary data operations
- "Checkout/payments (cart, billing, confirmation)" β E-commerce or payment flows
- "Dashboard/admin (data views, filters, exports)" β Admin panel interactions
Question: "How many pages/routes does the application have approximately?"
Header: "App size"
Options:
- "Small (< 10 routes)" β Landing page, auth, a few feature pages
- "Medium (10-30 routes)" β Multiple feature areas, settings, profiles
- "Large (30+ routes)" β Complex app with many sections and user roles
Round 2: Authentication strategy for tests
Question: "How does your app handle authentication?"
Header: "Auth type"
Options:
- "Cookie/session based (Recommended)" β Server sets httpOnly cookies after login
- "JWT in localStorage" β Token stored in browser localStorage
- "OAuth/SSO (Google, GitHub, etc.)" β Third-party auth provider redirect flow
- "No auth (public app)" β No login required
Question: "How should tests authenticate?"
Header: "Test auth"
Options:
- "Login via UI once, reuse state (Recommended)" β storageState pattern: login in setup, share cookies across tests
- "API login in beforeEach" β Call auth API directly before each test, skip UI login
- "Seed auth token in fixtures" β Inject pre-generated tokens, no login flow needed
- "Test login UI every time" β Actually test the login form in each test suite
Round 3: Test data and environment
Question: "How should test data be managed?"
Header: "Test data"
Options:
- "API seeding in fixtures (Recommended)" β Call API endpoints to create/clean test data before each test
- "Database seeding (direct SQL)" β Run SQL scripts or ORM commands to populate test database
- "Shared test environment (pre-populated)" β Tests run against a persistent staging environment with existing data
- "Mock API responses" β Intercept network requests and return mock data
Question: "What environment do E2E tests run against?"
Header: "Environment"
Options:
- "Local dev server (Recommended)" β Start dev server before tests, run against localhost
- "Preview/staging URL" β Run against a deployed preview or staging environment
- "Docker Compose stack" β Full stack in containers, tests run outside or inside
Round 4: CI and parallelization
Question: "How should tests run in CI?"
Header: "CI"
Options:
- "GitHub Actions (Recommended)" β Native Playwright support with sharding
- "GitLab CI" β Docker-based ru
FAQ
Does it start writing tests right away?
No, it explores the project and plans first, asking questions before writing tests.
Does it cover visual testing?
Yes, it can set up visual regression testing with screenshots.
Can it run tests in parallel?
Yes, the planning covers parallelization and CI sharding.
Details
Original description by the author
Plan and build comprehensive Playwright E2E test suites with Page Object Model, authentication state persistence, custom fixtures, visual regression, and CI integration. Uses interview-driven planning to clarify critical user flows, auth strategy, test data approach, and parallelization before writing any tests.
Popularity
- GitHub stars
- 33k
- Ranking position
- #8787
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
owasp-security
33kTeaches your agent OWASP security guidance for web apps, APIs, mobile, containers and AI agents, so it can spot common weaknesses and suggest fixes.
agent-management
33kLets your agent create, list, hibernate, wake, rename and delete AI agents using the AI Maestro command line, managing each agent's lifecycle.
agent-messaging
33kLets your agent send, receive and reply to signed messages between AI agents, using the Agent Messaging Protocol, mostly on your own machine.
docs-search
33kLets your agent search auto-generated code documentation for function signatures, class definitions and comments, so it checks the real API before changing code.
Similar skills
test-driven-development
311kTeaches your agent to write a failing test first, watch it fail, then write the smallest code that passes, before building any feature or fix.
verification-before-completion
311kTeaches your agent to run real checks and read their output before claiming that a task, fix, or build is complete or passing.
migrate-to-shoehorn
310kReplaces risky type casts in your test files with the shoehorn library, so tests can use partial data and still pass type checks.