跳到正文
Skillpedia
测试29k · #9473

coverage

它能做什么

这项技能让智能体列出应用的各个部分,并与你已有的测试进行比较。适合想知道哪里缺少测试的开发者和质量保证人员。

适用场景

  • ✓当你想知道哪些页面或功能没有测试时。
  • ✓当你在规划下一步测试、并希望对缺口进行排序的时候。
  • ✓当有人要求你提供测试覆盖率报告的时候。

技能链接

https://github.com/alirezarezvani/claude-skills/blob/main/engineering-team/playwright-pro/skills/coverage/SKILL.md

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“请告诉我我的应用中哪些部分还没有测试,先列出最重要的部分。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会映射你的路由、组件和 API 端点,然后读取现有测试文件,看它们覆盖了什么。它会生成一张已覆盖和缺失区域的表格,并按业务影响对缺口排序。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Analyze Test Coverage Gaps

Map all testable surfaces in the application and identify what's tested vs. what's missing.

Steps

1. Map Application Surface

Use the Explore subagent to catalog:

Routes/Pages:

  • Scan route definitions (Next.js app/, React Router config, Vue Router, etc.)
  • List all user-facing pages with their paths

Components:

  • Identify interactive components (forms, modals, dropdowns, tables)
  • Note components with complex state logic

API Endpoints:

  • Scan API route files or backend controllers
  • List all endpoints with their methods

User Flows:

  • Identify critical paths: auth, checkout, onboarding, core features
  • Map multi-step workflows

2. Map Existing Tests

Scan all *.spec.ts / *.spec.js files:

  • Extract which pages/routes are covered (by page.goto() calls)
  • Extract which components are tested (by locator usage)
  • Extract which API endpoints are mocked or hit
  • Count tests per area

3. Generate Coverage Matrix

## Coverage Matrix

| Area | Route | Tests | Status |
|---|---|---|---|
| Auth | /login | 5 | ✅ Covered |
| Auth | /register | 0 | ❌ Missing |
| Auth | /forgot-password | 0 | ❌ Missing |
| Dashboard | /dashboard | 3 | ⚠️ Partial (no error states) |
| Settings | /settings | 0 | ❌ Missing |
| Checkout | /checkout | 8 | ✅ Covered |

4. Prioritize Gaps

Rank uncovered areas by business impact:

  1. Critical — auth, payment, core features → test first
  2. High — user-facing CRUD, search, navigation
  3. Medium — settings, preferences, edge cases
  4. Low — static pages, about, terms

5. Suggest Test Plan

For each gap, recommend:

  • Number of tests needed
  • Which template from templates/ to use
  • Estimated effort (quick/medium/complex)
## Recommended Test Plan

### Priority 1: Critical
1. /register (4 tests) — use auth/registration template — quick
2. /forgot-password (3 tests) — use auth/password-reset template — quick

### Priority 2: High
3. /settings (4 tests) — use settings/ templates — medium
4. Dashboard error states (2 tests) — use dashboard/data-loading template — quick

6. Auto-Generate (Optional)

Ask user: "Generate tests for the top N gaps? [Yes/No/Pick specific]"

If yes, invoke /pw:generate for each gap with the recommended template.

Output

  • Coverage matrix (table format)
  • Coverage percentage estimate
  • Prioritized gap list with effort estimates
  • Option to auto-generate missing tests
常见问题

它也会编写缺失的测试吗?

不会。它只负责找出并排序缺口,编写测试是另一个步骤。

它能理解哪些类型的应用?

它会查看常见的路由设置,例如 Next.js、React Router 和 Vue Router,以及 Playwright 测试文件。

覆盖率表格显示什么?

每个区域都有一个状态,例如已覆盖、部分覆盖或缺失,并附有其测试的数量。

详情

作者的原始描述

Use when asked what's not tested or for test coverage gaps ('test coverage', 'coverage gaps', 'missing tests', 'what needs testing'). Maps untested pages and flows.

repo: alirezarezvani/claude-skills

热度

GitHub 星标
29k
排名
#9473
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能