Coverage

alirezarezvani/claude-skills/engineering-team/playwright-pro/skills/coverage

作者 alirezarezvani19392f7a0826无许可证27K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库5周前更新

Analyze test coverage gaps. Use when user says "test coverage", "what's not tested", "coverage gaps", "missing tests", "coverage report", or "what needs testing".

AI 生成的概览

将应用的可测试面与现有测试进行对照,找出覆盖缺口并给出按优先级排序的测试计划。

功能
该技能梳理应用的路由、组件、API 端点和用户流程,再扫描现有测试文件,确认实际被测试的部分。它会输出覆盖矩阵表格、覆盖率估算,以及按业务影响排序的缺口清单。它还可给出所需测试数量、模板建议和工作量估算,并可选地为最优先的缺口触发测试生成。
适用场景
当有人询问测试覆盖、哪些未测试、覆盖缺口、缺失测试或需要测试什么时使用。适合希望在补充测试前获得未覆盖路由、组件或端点结构化视图的团队。
运行要求
仅为说明性内容,不附带脚本。它依赖 Explore 子代理扫描代码库,并引用 templates/ 目录中的模板;可选的自动生成会调用 /pw:generate 命令。

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: Critical1. /register (4 tests) — use auth/registration template — quick2. /forgot-password (3 tests) — use auth/password-reset template — quick
### Priority 2: High3. /settings (4 tests) — use settings/ templates — medium4. 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

来源与署名

来源:alirezarezvani/claude-skills位于engineering-team/playwright-pro/skills/coverage提交19392f7

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架