About ui-test-playwright
A skill for designing Playwright UI automation tests, suited to projects already using the tooling or seeking an actionable test plan. It stresses stable locators, business-state assertions, isolation of parallel test data, and retaining failure evidence.
Key features
- 01Follow the project’s Playwright setup and entry point
- 02Prefer stable semantic locators
- 03Assert business state with auto-retrying checks
- 04Isolate accounts and data across parallel tests
- 05Retain failure traces, screenshots, and logs
Use cases
- 01Design UI tests for a Playwright project
- 02Plan order or accounting state checks
- 03Review data isolation for parallel tests
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ naodeng/ awesome-qa-skills --skill ui-test-playwrightAfter installing, type/ui-test-playwrightin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
README.mdagents/openai.yamlevals/eval.yamlevals/cases/basic-script-artifact.yamlbasic-success.yamldomain-method-regression.yamledge-incomplete-input.yamledge-scope-boundary.yamlevals/fixtures/check_domain_decisions.pycheck-domain-decisions.shdomain-oracle.jsonevals/fixtures/checkout-app/checkout.spec.cjsindex.htmlplaywright.config.cjsREADME.mdreceipt.htmlserver.mjsevals/fixtures/scripts/check_playwright_output.shexamples/sample-context.mdoutput-templates/template-markdown.mdprompts/ui-test-playwright.mdreferences/domain-decision-example.mdframework-spec.mdsetup-and-ci.mdscripts/run-tests.shDetails
From the project READMEPlaywright UI 自动化测试
English version: see the matching English skill.
何时使用
- 需要输出面向 Playwright UI 自动化测试工作流的测试方案或自动化设计。
- 项目已经使用相关工具,或希望得到可直接落地的工具专项方案。
输出格式选项
默认使用 Markdown。除非请求明确要求其他格式,不额外扩展输出格式。
如何使用
- 打开
prompts/ui-test-playwright.md,将其作为主提示词。 - 补充真实项目上下文:范围、环境、约束、风险、依赖和期望交付物。
- 如果输入不完整,先返回可用的第一版,并标出缺失信息和假设。
参考文件
-
校准领域结果、正确对照或证据缺口时,读取 references/domain-decision-example.md 的脱敏输入、逐项预期与复算依据。
-
prompts/ui-test-playwright.md:本技能主提示词。 -
references/framework-spec.md:工具专项结构和覆盖说明。 -
references/setup-and-ci.md:安装、执行和 CI 说明。 -
examples/sample-context.md:示例请求上下文。 -
scripts/run-tests.sh:轻量本地执行入口。
领域执行要点
- 固定项目Playwright/Node/browser版本、projects/fixtures与配置;沿用真实入口,记录测试ID、commit、worker/project和环境,未兼容配置先诊断不擅自换框架。
- 优先role/name/testid等稳定语义定位,执行后以auto-retrying assertion核对订单/账务/状态与主体;页面标题/URL只满足相应导航义务,不能替代付款成功。
- 每worker独立browser context、storage state/账号与业务键,禁止共享会冲突的数据;同浏览器不同context仍须核对服务端账号隔离,teardown逆依赖清理。
- 用错误业务状态和并行A/B对照验证断言敏感性;失败保留trace/screenshot/日志与非0 runner/CI,retry首失败仍可见。生成资产、实际browser运行与业务验收分别报告。
常见误区
- 不要在范围模糊且缺少上下文时直接给泛泛方案。
- 不要把所有模块和场景视为同等重要。
- 不要跳过假设和缺失信息说明。
最佳实践
-
从 prompt 文件开始,只补充真正影响结果的上下文。
-
输出保持风险驱动,并能直接用于执行或评审。
-
信息不完整时,先给可用版本,再标清缺口。
-
验证生成资产的业务断言、失败传播或隔离时,读取 evals/fixtures/checkout-app/README.md,使用本地good/bug/timeout对照;仅在明确运行时执行。