Playwright-Generate-Test
Playwright-Generate-Test是一款testing方向的AI技能,核心价值是Generate a Playwright test based on a scenario using Playwright MCP,可用于解决开发者在testing领域的实际问题,帮助用户提升效率、自动化重复任务或优化工作流。
Generate a Playwright test based on a scenario using Playwright MCP
mkdir -p ./skills/playwright-generate-test && curl -sfL https://raw.githubusercontent.com/github/awesome-copilot/main/skills/playwright-generate-test/SKILL.md -o ./skills/playwright-generate-test/SKILL.md Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).
Skill Content
# 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
🎯 Best For
- QA engineers
- Developers writing unit tests
- Developers scaffolding new projects
- Prototype builders
- Claude users
💡 Use Cases
- Generating test cases for edge conditions
- Writing integration test suites
- Bootstrapping React components
- Creating API route handlers
📖 How to Use This Skill
- 1
Install the Skill
Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.
- 2
Load into Your AI Assistant
Open Claude or GitHub Copilot and reference the skill. Paste the SKILL.md content or use the system prompt tab.
- 3
Apply Playwright-Generate-Test to Your Work
Provide context for your task — paste source material, describe your audience, or share existing work to guide the AI.
- 4
Review and Refine
Edit the AI output for accuracy, tone, and completeness. Add human insight where the AI lacks context.
❓ Frequently Asked Questions
Does this generate test mocks?
Many testing skills include mock generation. Check the install command and skill content for details.
Can I customize the generated output?
Yes — modify the skill's prompt instructions to match your project conventions and coding style.
How do I install Playwright-Generate-Test?
Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/playwright-generate-test/SKILL.md, ready to use.
Can I customize this skill for my team?
Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.
⚠️ Common Mistakes to Avoid
Not testing edge cases
AI tends to generate happy-path tests. Manually review for boundary conditions.
Using generated code without understanding
Understand what generated code does before shipping it to production.
Not reading the full skill
Skills contain important context and edge cases beyond the quick start.