review by alirezarezvani/claude-skills
npx skills add https://github.com/alirezarezvani/claude-skills --skill review系统性地审查 Playwright 测试文件,查找反模式、遗漏的最佳实践和覆盖率缺口。
$ARGUMENTS 可以是:
testDir 中的所有测试playwright.config.ts 以获取项目设置*.spec.ts / *.spec.js 文件从此技能目录加载 anti-patterns.md。检查所有 20 种反模式。
关键问题(必须修复):
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
waitForTimeout()expect(await ...))baseURLawait警告问题(应该修复):
8. 测试超过 50 行(考虑拆分)
9. 使用未命名的常量作为魔法字符串
10. 缺少错误/边界情况测试
11. 对定位器能完成的操作使用 page.evaluate()
12. test.describe() 嵌套超过 2 层
13. 通用的测试名称("should work"、"test 1")
建议问题(考虑):
14. 对于拥有 5 个以上定位器的页面,没有使用页面对象
15. 使用内联测试数据而非工厂/夹具
16. 缺少可访问性断言
17. 对 UI 密集的页面没有视觉回归测试
18. 未检查控制台错误断言
19. 使用网络空闲等待而非特定断言
20. 缺少 test.describe() 分组
基于以下标准评分 1-10:
对于每个文件:
## <文件名> — 评分: X/10
### 关键问题
- 第 15 行: `waitForTimeout(2000)` → 使用 `expect(locator).toBeVisible()`
- 第 28 行: CSS 选择器 `.btn-submit` → `getByRole('button', { name: 'Submit' })`
### 警告问题
- 第 42 行: 测试名称 "test login" → "should redirect to dashboard after login"
### 建议
- 考虑添加错误情况:使用无效凭证时会发生什么?
如果审查整个测试套件:
/batch对于每个关键问题,提供修正后的代码。询问用户:"应用这些修复吗?[是/否]"
如果选择是,使用 Edit 工具应用所有修复。
每周安装量
50
仓库
GitHub 星标数
2.8K
首次出现
4 天前
安全审计
安装于
codex47
kimi-cli46
gemini-cli46
claude-code46
amp46
cline46
Systematically review Playwright test files for anti-patterns, missed best practices, and coverage gaps.
$ARGUMENTS can be:
testDirplaywright.config.ts for project settings*.spec.ts / *.spec.js files in scopeLoad anti-patterns.md from this skill directory. Check for all 20 anti-patterns.
Critical (must fix):
waitForTimeout() usageexpect(await ...))baseURLawait on Playwright callsWarning (should fix): 8. Tests longer than 50 lines (consider splitting) 9. Magic strings without named constants 10. Missing error/edge case tests 11. page.evaluate() for things locators can do 12. Nested test.describe() more than 2 levels deep 13. Generic test names ("should work", "test 1")
Info (consider): 14. No page objects for pages with 5+ locators 15. Inline test data instead of factory/fixture 16. Missing accessibility assertions 17. No visual regression tests for UI-heavy pages 18. Console error assertions not checked 19. Network idle waits instead of specific assertions 20. Missing test.describe() grouping
Rate 1-10 based on:
For each file:
## <filename> — Score: X/10
### Critical
- Line 15: `waitForTimeout(2000)` → use `expect(locator).toBeVisible()`
- Line 28: CSS selector `.btn-submit` → `getByRole('button', { name: 'Submit' })`
### Warning
- Line 42: Test name "test login" → "should redirect to dashboard after login"
### Suggestions
- Consider adding error case: what happens with invalid credentials?
If reviewing an entire test suite:
/batch for very large suitesFor each critical issue, provide the corrected code. Ask user: "Apply these fixes? [Yes/No]"
If yes, apply all fixes using Edit tool.
Weekly Installs
50
Repository
GitHub Stars
2.8K
First Seen
4 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex47
kimi-cli46
gemini-cli46
claude-code46
amp46
cline46
xdrop 文件传输脚本:Bun 环境下安全上传下载工具,支持加密分享
20,700 周安装
macOS磁盘清理工具 - 安全智能分析回收存储空间 | macOS Cleaner
257 周安装
PPT模板创建器:将PowerPoint模板转化为可复用技能,自动化演示文稿生成
257 周安装
商务邮件草拟助手:AI智能生成专业邮件模板,提升办公沟通效率
257 周安装
Docassemble 表单构建器技能 - 创建智能动态问卷与文档生成工具
257 周安装
Fastify TypeScript 生产级后端框架指南:高性能 Node.js Web 开发与 JSON 模式验证
257 周安装
AI 演示文稿生成器 | 一键创建专业幻灯片,支持 Marp 格式输出
257 周安装