---
name: playwright-generate-test-cb8be246eca4
description: "Use when a developer wants to create a Playwright end-to-end or browser test for a specific feature, flow, or scenario — when they say 'write a Playwright test for', 'generate a test for the login flow', 'add e2e tests for', or 'test this UI with Playwright'. Uses Playwright MCP tools to first interact with the real browser (not just guess at selectors), then generates a TypeScript spec using @playwright/test. Saves to tests/ directory with <feature>.spec.ts naming. Iterates until the test passes. Auto-loads when Playwright, e2e, browser test, or UI test is mentioned."
---

# 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, 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 the generated test file in the `tests/` directory following the naming convention `<feature>.spec.ts`.
- Execute the test file and iterate until the test passes.

---
Source attribution: SriSatyaLokesh
Original project: https://github.com/SriSatyaLokesh/copilot-team-workflow
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Dave AI.

## Upstream license notice

MIT License

Copyright (c) 2026 Gabriel Moreira

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Dave AI resource metadata

Creator / publisher: SriSatyaLokesh
Original project: https://github.com/SriSatyaLokesh/copilot-team-workflow
Attribution basis: Upstream repository explicitly recorded in package mirror path

Fields of work: Development & Engineering
Roles: Frontend Developer, Full-Stack Developer, QA / Test Engineer
Specialties: Testing
Tools: Playwright
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 9fb6fa4794fe623698fb3ee04a4e9976e1a274d2a88a35efd8852a398b3341a0
