跳到正文
Skillpedia
测试40k · #7329

playwright-generate-test

它能做什么

这个工具可以为网站自动生成测试代码。你描述想要测试的内容,它就会生成代码,用来检查网站是否按预期工作。

适用场景

  • ✓想验证网站的新功能是否正常工作时。
  • ✓网站更新之后,需要确认它仍然能正常使用时。
  • ✓需要在不同浏览器中测试同一流程时。

技能链接

https://github.com/github/awesome-copilot/blob/main/skills/playwright-generate-test/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/github/awesome-copilot/blob/main/skills/playwright-generate-test/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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/test based 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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能