Skip to content

Generate Playwright Tests

Writes end-to-end Playwright browser tests for a feature, page, or component in your project.

Stars
29,149
Licence
MIT
Files
2 files

What it does

When you ask the agent to write tests for a login flow, page, or component, it reads your project's Playwright setup and existing tests, then writes browser tests that follow modern Playwright practices, such as finding elements by role or label and using auto-retrying assertions. It can also create page objects, fixtures, and test data files to match your project, then run the new test and report the result.

Great for

  • Developers who already use Playwright and want faster first drafts of end-to-end tests
  • Teams wanting new tests to follow consistent conventions from existing test files
  • Anyone turning a user story or feature description into a runnable test

Skip it if

  • Projects that do not use Playwright (the skill assumes Playwright config and conventions), since results will be unreliable
  • Non-developers without a working test environment, because it runs commands and needs a local app to test against
  • Users expecting tests to be correct without review: generated tests can assert the wrong behavior, and the skill tells the agent to fix tests rather than the app when they fail

Try asking

  • “write tests for the user can log in with email and password”
  • “generate tests for the checkout flow”
  • “test this component: src/components/UserProfile.tsx”
  • “add tests for the search page with filters”
Step-by-step guide: how to use Generate Playwright TestsInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 2 original files, the MIT licence and an attribution note.

    generate.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip generate.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip generate.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Point it at a specific user story or component path so the agent can read the relevant source code.
  • Review generated tests before committing, especially assertions, since the agent may misread expected behavior.
  • Make sure your app is running locally and configured in playwright.config.ts so the verification step can succeed.

What's inside

  • patterns.md
  • SKILL.md

Redistributed unmodified from alirezarezvani/claude-skills under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.