# Playwright generate test

> Playwright generate test is an open-source agent skill for browser automation. Has the agent drive a browser via Playwright MCP and write a passing Playwright test. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/github/awesome-copilot/tree/main/skills/playwright-generate-test
- **Repository:** https://github.com/github/awesome-copilot
- **GitHub stars:** 41,707
- **License:** MIT
- **Skill name:** playwright-generate-test
- **Collection:** https://github.com/github/awesome-copilot
- **Categories:** [browser automation](https://ai-powered.com/categories/browser-automation), [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-30

## About

This skill guides the agent through turning a plain-language test scenario into a Playwright test in TypeScript. Rather than writing code straight from the scenario, the agent is told to first run each step in a live browser using the tools exposed by the Playwright MCP server, then emit a test built from what it observed.

Once the steps are completed, the agent saves the generated spec into a tests directory, runs it, and keeps iterating until the test passes. The output targets the @playwright/test package. If no scenario is given, the agent asks the user to supply one before starting.

The skill is a single instruction file with no bundled scripts or reference files. It expects a Playwright MCP server to be available to the agent, a project where a tests directory can be used, and the ability to execute the test file.

## When your agent uses it

> Generate a Playwright test based on a scenario using Playwright MCP

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/github/awesome-copilot/tree/HEAD/skills/playwright-generate-test)
- [License: MIT](https://github.com/github/awesome-copilot/tree/HEAD/skills/playwright-generate-test)

## Features

- **Scenario-driven test generation:** Turns a described user scenario into a Playwright TypeScript test file.
- **Step-by-step browser exploration:** Has the agent perform each step in a browser through Playwright MCP before writing any code.
- **Test file placement:** Saves the generated spec into a tests directory of the project.
- **Run and fix loop:** Executes the test and iterates until it passes.
- **Uses @playwright/test:** Produces tests written against the official @playwright/test package.

## Good for

- Generate an end-to-end test for a login flow
- Turn a checkout scenario into a Playwright test
- Create a regression test for a form submission
- Write a browser test for a navigation path and run it until it passes

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/playwright-generate-test` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/github/awesome-copilot.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/playwright-generate-test &&
cp -R "$tmp/skills/playwright-generate-test" ~/.claude/skills/playwright-generate-test &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/playwright-generate-test` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/playwright-generate-test` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/github/awesome-copilot.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/playwright-generate-test &&
cp -R "$tmp/skills/playwright-generate-test" ~/.agents/skills/playwright-generate-test &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/playwright-generate-test` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/playwright-generate-test` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/github/awesome-copilot.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/playwright-generate-test &&
cp -R "$tmp/skills/playwright-generate-test" ~/.cursor/skills/playwright-generate-test &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/playwright-generate-test` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/github/awesome-copilot.git --path skills/playwright-generate-test
```

Or copy the folder to `~/.gemini/skills/playwright-generate-test` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/playwright-generate-test`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/github/awesome-copilot.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/playwright-generate-test &&
cp -R "$tmp/skills/playwright-generate-test" ~/.copilot/skills/playwright-generate-test &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/playwright-generate-test` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/github/awesome-copilot.git
```

Then copy `awesome-copilot/skills/playwright-generate-test` into your agent's skills folder as `playwright-generate-test`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does Playwright generate test need to work?

It relies on the Playwright MCP tools to drive a browser, a project with a tests directory, and the ability to execute the generated test file.

### Does Playwright generate test generate test code right away?

No. The instructions tell the agent to complete all prescribed browser steps one by one first, and only then emit the Playwright TypeScript test.

### What language and framework is the output?

The output is a Playwright test in TypeScript that uses @playwright/test.

### What happens if I don't give a scenario?

The agent is instructed to ask you to provide a scenario before generating anything.

### How do I install Playwright generate test in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/playwright-generate-test to use it in all your projects, or to .claude/skills/playwright-generate-test in one project.

### Does Playwright generate test run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Playwright generate test?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Playwright generate test?

The closest alternatives to Playwright generate test are Playwright skill, Webapp testing, Playwright explore website, Webapp testing and Azure microsoft playwright testing ts.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Playwright skill](https://ai-powered.com/skills/playwright-skill): Playwright skill is an open-source agent skill for browser automation.
- [Webapp testing](https://ai-powered.com/skills/webapp-testing-github): Webapp testing is an open-source agent skill for browser automation.
- [Playwright explore website](https://ai-powered.com/skills/playwright-explore-website): Playwright explore website is an open-source agent skill for browser automation.
- [Webapp testing](https://ai-powered.com/skills/webapp-testing): Webapp testing is an open-source agent skill for browser automation.
- [Azure microsoft playwright testing ts](https://ai-powered.com/skills/azure-microsoft-playwright-testing-ts): Azure microsoft playwright testing ts is an open-source agent skill for browser automation.
- [Playwright](https://ai-powered.com/skills/playwright): Playwright is a free agent skill for browser automation.
- [E2E testing](https://ai-powered.com/skills/e2e-testing): E2E testing is an open-source agent skill for developer tools.
- [Playwright interactive](https://ai-powered.com/skills/playwright-interactive): Playwright interactive is a free agent skill for browser automation.

---
Source: https://ai-powered.com/skills/playwright-generate-test
