Skip to content
Back to skills

Playwright Generate Test

ASecurity

Generate Playwright TypeScript tests based on a scenario using Playwright MCP for real browser interaction. Use when the user wants to create an end-to-end test, generate a test from a user story, or automate a test scenario with Playwright.

  • 5 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 11, 2026
ai-agentstypescriptgo

Works with

  • cli
  • mcp

Security analysis

A100/100

Scanned September 11, 2026

npx -y skills add atc-net/atc-agentic-toolkit --skill playwright-generate-test --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Playwright Generate Test?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Playwright Generate Test
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/atc-net-playwright-generate-test/badge)](https://www.skillsdirectory.com/skills/atc-net-playwright-generate-test)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: playwright-generate-test
description: Generate Playwright TypeScript tests based on a scenario using Playwright MCP for real browser interaction. Use when the user wants to create an end-to-end test, generate a test from a user story, or automate a test scenario with Playwright.
---

# Test Generation with Playwright MCP

Generate a Playwright TypeScript test by first interacting with the real application via the Playwright MCP server, then producing a verified test file.

## Workflow

1. **Get the scenario** — If not provided, ask the user to describe the test scenario (URL, steps, expected outcomes)
2. **Navigate to the application** — Use `browser_navigate` to load the target page
3. **Execute the scenario step by step** — Walk through each interaction using MCP tools:
   - `browser_click` for clicks
   - `browser_type` for text input
   - `browser_select_option` for dropdowns
   - `browser_snapshot` to observe state between steps
4. **Capture locators and assertions** — Note the actual locators and expected states observed during execution
5. **Generate the test** — Write a Playwright TypeScript test using `@playwright/test` based on the real interactions observed:

```typescript
import { test, expect } from '@playwright/test';

test('descriptive test name', async ({ page }) => {
  await page.goto('URL');
  // Steps based on actual MCP interactions
});
```

6. **Save the test** — Write the file to the project's tests directory
7. **Run and iterate** — Execute the test and fix any failures until it passes

## Guidelines

- Never generate test code before completing the MCP interaction steps
- Use stable locators observed during exploration (`data-testid` > `getByRole` > `getByText`)
- Add meaningful assertions after key interactions
- Keep tests focused on a single user flow
- Use descriptive test names that explain the scenario

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.