playwright-generate-test
它能做什么
这个工具可以为网站自动生成测试代码。你描述想要测试的内容,它就会生成代码,用来检查网站是否按预期工作。
适用场景
- ✓想验证网站的新功能是否正常工作时。
- ✓网站更新之后,需要确认它仍然能正常使用时。
- ✓需要在不同浏览器中测试同一流程时。
技能链接
https://github.com/github/awesome-copilot/blob/main/skills/playwright-generate-test/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“生成一个测试,验证我能把商品加入购物车并完成购买。”
每周 5 个新技能,1 分钟读完。
工作原理
工具会借助 Playwright MCP 这个系统,按照你的指令一步步执行。它先观察网站,模拟你的操作,然后才编写测试代码。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
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/testbased on message history - Save generated test file in the tests directory
- Execute the test file and iterate until the test passes
常见问题
什么是 Playwright?
Playwright 是一款工具,可以帮你创建并运行网站的自动化测试。
什么是自动化测试?
自动化测试是一段脚本,它会模拟用户与网站的交互,检查一切是否正常,不需要人工一步步去点。
如果我没有提供测试场景会怎样?
工具会请你描述想要在网站上测试的内容。
详情
作者的原始描述
Generate a Playwright test based on a scenario using Playwright MCP
repo: github/awesome-copilot
热度
- GitHub 星标
- 40k
- 排名
- #7329
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
acquire-codebase-knowledge
40k帮你的智能体理解并编写现有代码项目的文档。它有助于新成员快速上手,或者快速了解项目架构。
acreadiness-assess
40k让你的智能体评估一个项目对 AI 的准备程度,并生成报告。它有助于了解项目在使用 AI 工具方面的准备情况。
acreadiness-generate-instructions
40k帮你的智能体根据评估结果编写 AI 工具的指令文件。它有助于改善 AI 与代码的交互方式,并弥补已发现的不足。
acreadiness-policy
40k让你的智能体协助制定或应用 AI 项目评估的政策。它有助于规范项目的评估方式,并确保合规。