Generated banner for Playwright Generate Test
Generated logo for Playwright Generate Test

Playwright Generate Test

GitHubOfficialOriginally contributed by @debs-obrien as prompts/playwright-generate-test.prompt.md; moved into a skill by pull request #761Distributed by GitHub

  • Skill
  • Workflow
  • Software development
  • MIT
  • No issues found

From the author

Generate a Playwright test based on a scenario using Playwright MCP
— the description by debs-obrien

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a structured workflow for generating Playwright TypeScript tests. It guides the agent through a multi-step process that involves interpreting a user-provided scenario, utilizing Playwright MCP tools to interact with the environment, saving the resulting test file to the designated directory, and performing iterative execution to ensure the test passes.

What it does

  • Prompts the user for a test scenario if one is not provided.
  • Executes step-by-step actions using Playwright MCP tools.
  • Generates TypeScript test code using the @playwright/test framework.
  • Saves the generated test file into the project's tests directory.
  • Runs the generated test to verify its functionality.
  • Iterates on the test code until it successfully passes.

When to use it

  • When you need to create new automated browser tests from a plain-language scenario.
  • When you want to ensure generated tests are functional and verified before finalization.
  • When working within a project that utilizes Playwright MCP for test automation.

Advantages

  • Ensures test code is validated through actual execution.
  • Reduces manual effort in writing and debugging boilerplate test code.
  • Maintains a consistent structure for test generation and storage.

Usage examples

“Generate a Playwright test for a user login scenario where the user enters valid credentials and is redirected to the dashboard.”
The agent will use Playwright MCP to navigate the login flow, generate the corresponding TypeScript test file, save it to the tests folder, and run it to confirm it passes.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/github/playwright-generate-test/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip playwright-generate-test.zip -d .agents/skills

Documentation by debs-obrien

Test Generation with Playwright MCP

Your goal is to generate a Playwright test based on the provided scenario after completing all prescribed steps.

Specific Instructions

  • You are given a scenario, and you need to generate a playwright test for it. If the user does not provide a scenario, you will ask them to provide one.

  • DO NOT generate test code prematurely or based solely on the scenario without completing all prescribed steps.

  • DO run steps one by one using the tools provided by the Playwright MCP.

  • Only after all steps are completed, emit a Playwright TypeScript test that uses @playwright/test based on message history

  • Save generated test file in the tests directory

  • Execute the test file and iterate until the test passes

Files

Requirements and compatibility

Written for: GitHub Copilot

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Originally contributed by
GitHub avatar of debs-obrien@debs-obrienas prompts/playwright-generate-test.prompt.mdmoved into a skill by pull request #761
Publisher
GitHub (Official)
Distributed by
GitHub
Source
github/awesome-copilot · skills/playwright-generate-test · commit 797337f
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced
Contributors
debs-obrien, derekclair, echarrod

AutoGineer is not affiliated with or endorsed by debs-obrien or GitHub.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download playwright-generate-test.zip