关于 qa-test-planner
qa-test-planner 面向 QA 工程师,可将功能需求整理为测试计划、手动用例、回归套件、设计检查和缺陷报告,并提供交互式脚本生成用例与报告。
主要功能
- 01创建测试计划和手动用例
- 02构建冒烟及回归测试套件
- 03对照 Figma 设计检查实现
- 04起草结构化缺陷报告
- 05交互式用例与缺陷脚本
适用场景
- 01为新功能规划测试
- 02编写结账流程的测试用例
- 03对照 Figma 设计检查页面
- 04记录可复现的缺陷
MCP 相关
Figma 验证流程说明可使用已配置的 Figma MCP 服务获取设计规格并进行比对。
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ softaworks/ agent-toolkit --skill qa-test-planner安装后在 Claude Code 中输入/qa-test-planner确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
README.mdreferences/bug_report_templates.mdfigma_validation.mdregression_testing.mdtest_case_templates.mdscripts/create_bug_report.shgenerate_test_cases.sh详细介绍
QA Test Planner
一套面向 QA 工程师的综合技能,用于创建测试计划、生成手动测试用例、构建回归测试套件、根据 Figma 验证设计,以及高效记录缺陷。
激活方式: 仅当按名称显式调用时才会触发此技能(例如
/qa-test-planner、qa-test-planner或use the skill qa-test-planner)。
快速开始
创建测试计划:
"Create a test plan for the user authentication feature"
生成测试用例:
"Generate manual test cases for the checkout flow"
构建回归套件:
"Build a regression test suite for the payment module"
根据 Figma 验证:
"Compare the login page against the Figma design at [URL]"
创建缺陷报告:
"Create a bug report for the form validation issue"
快速参考
| 任务 | 你将获得 | 时间 |
|---|---|---|
| 测试计划 | 策略、范围、排期、风险 | 10-15 分钟 |
| 测试用例 | 分步说明、预期结果 | 每个 5-10 分钟 |
| 回归套件 | 冒烟测试、关键路径、执行顺序 | 15-20 分钟 |
| Figma 验证 | 设计-实现对比、差异清单 | 10-15 分钟 |
| 缺陷报告 | 可复现步骤、环境、证据 | 5 分钟 |
工作原理
Your Request
│
▼
┌─────────────────────────────────────────────────────┐
│ 1. ANALYZE │
│ • Parse feature/requirement │
│ • Identify test types needed │
│ • Determine scope and priorities │
├─────────────────────────────────────────────────────┤
│ 2. GENERATE │
│ • Create structured deliverables │
│ • Apply templates and best practices │
│ • Include edge cases and variations │
├─────────────────────────────────────────────────────┤
│ 3. VALIDATE │
│ • Check completeness │
│ • Verify traceability │
│ • Ensure actionable steps │
└─────────────────────────────────────────────────────┘
│
▼
QA Deliverable Ready
命令
交互式脚本
| 脚本 | 用途 | 用法 |
|---|---|---|
./scripts/generate_test_cases.sh | 交互式创建测试用例 | 分步提示 |
./scripts/create_bug_report.sh | 生成缺陷报告 | 引导式输入收集 |
自然语言
| 请求 | 输出 |
|---|---|
| "Create test plan for {feature}" | 完整的测试计划文档 |
| "Generate {N} test cases for {feature}" | 带步骤的编号测试用例 |
| "Build smoke test suite" | 关键路径测试 |
| "Compare with Figma at {URL}" | 视觉验证清单 |
| "Document bug: {description}" | 结构化的缺陷报告 |
核心交付物
1. 测试计划
- 测试范围与目标
- 测试方法与策略
- 环境要求
- 进入/退出标准
- 风险评估
- 时间线与里程碑
2. 手动测试用例
- 分步说明
- 预期结果与实际结果
- 前置条件与设置
- 测试数据要求
- 优先级与严重程度
3. 回归套件
- 冒烟测试(15-30 分钟)
- 完整回归(2-4 小时)
- 定向回归(30-60 分钟)
- 执行顺序与依赖关系
4. Figma 验证
- 逐个组件对比
- 间距与排版检查
- 颜色与视觉一致性
- 交互状态验证
5. 缺陷报告
- 清晰的复现步骤
- 环境详情
- 证据(截图、日志)
- 严重程度与优先级
反模式
| 避免 | 原因 | 改为 |
|---|---|---|
| 模糊的测试步骤 | 无法复现 | 具体操作 + 预期结果 |
| 缺少前置条件 | 测试意外失败 | 记录所有设置要求 |
| 没有测试数据 | 测试人员受阻 | 提供示例数据或生成方式 |
| 笼统的缺陷标题 | 难以跟踪 | 具体:"[Feature] issue when [action]" |
| 跳过边界情况 | 遗漏关键缺陷 | 包含边界值、空值 |
验证清单
测试计划:
- 范围清晰定义(包含/不包含)
- 指定进入/退出标准
- 识别风险并给出缓解措施
- 时间线切合实际
测试用例:
- 每个步骤都有预期结果
- 记录前置条件
- 测试数据可用
- 已分配优先级
缺陷报告:
- 可复现步骤
- 记录环境
- 附上截图/证据
- 设置严重程度/优先级
参考资料
- 测试用例模板 - 所有测试类型的标准格式
- 缺陷报告模板 - 文档模板
- 回归测试指南 - 套件构建与执行
- Figma 验证指南 - 设计-实现验证
深入探讨:测试用例结构
标准测试用例格式
## TC-001: [Test Case Title]
**Priority:** High | Medium | Low
**Type:** Functional | UI | Integration | Regression
**Status:** Not Run | Pass | Fail | Blocked
### Objective
[What are we testing and why]
### Preconditions
- [Setup requirement 1]
- [Setup requirement 2]
- [Test data needed]
### Test Steps
1. [Action to perform]
**Expected:** [What should happen]
2. [Action to perform]
**Expected:** [What should happen]
3. [Action to perform]
**Expected:** [What should happen]
### Test Data
- Input: [Test data values]
- User: [Test account details]
- Configuration: [Environment settings]
### Post-conditions
- [System state after test]
- [Cleanup required]
### Notes
- [Edge cases to consider]
- [Related test cases]
- [Known issues]
测试类型
| 类型 | 关注点 | 示例 |
|---|---|---|
| 功能 | 业务逻辑 | 使用有效凭据登录 |
| UI/视觉 | 外观、布局 | 按钮与 Figma 设计一致 |
| 集成 | 组件交互 | API 向后端返回数据 |
| 回归 | 现有功能 | 之前的功能仍然正常 |
| 性能 | 速度、负载处理 | 页面在 3 秒内加载完成 |
| 安全 | 漏洞 | 防止 SQL 注入 |
深入探讨:测试计划模板
测试计划结构
# Test Plan: [Feature/Release Name]
## Executive Summary
- Feature/product being tested
- Testing objectives
- Key risks
- Timeline overview
## Test Scope
**In Scope:**
- Features to be tested
- Test types (functional, UI, performance)
- Platforms and environments
- User flows and scenarios
**Out of Scope:**
- Features not being tested
- Known limitations
- Third-party integrations (if applicable)
## Test Strategy
**Test Types:**
- Manual testing
- Exploratory testing
- Regression testing
- Integration testing
- User acceptance testing
**Test Approach:**
- Black box testing
- Positive and negative testing
- Boundary value analysis
- Equivalence partitioning
## Test Environment
- Operating systems
- Browsers and versions
- Devices (mobile, tablet, desktop)
- Test data requirements
- Backend/API environments
## Entry Criteria
- [ ] Requirements documented
- [ ] Designs finalized
- [ ] Test environment ready
- [ ] Test data prepared
- [ ] Build deployed
## Exit Criteria
- [ ] All high-priority test cases executed
- [ ] 90%+ test case pass rate
- [ ] All critical bugs fixed
- [ ] No open high-severity bugs
- [ ] Regression suite passed
## Risk Assessment
| Risk | Probability | Impact | Mitigation |
|------|-------------|--------|------------|
| [Risk 1] | H/M/L | H/M/L | [Mitigation] |
## Test Deliverables
- Test plan document
- Test cases
- Test execution reports
- Bug reports
- Test summary report
深入探讨:缺陷报告
缺陷报告模板
# BUG-[ID]: [Clear, specific title]
**Severity:** Critical | High | Medium | Low
**Priority:** P0 | P1 | P2 | P3
**Type:** Functional | UI | Performance | Security
**Status:** Open | In Progress | Fixed | Closed
## Environment
- **OS:** [Windows 11, macOS 14, etc.]
- **Browser:** [Chrome 120, Firefox 121, etc.]
- **Device:** [Desktop, iPhone 15, etc.]
- **Build:** [Version/commit]
- **URL:** [Page where bug occurs]
## Description
[Clear, concise description of the issue]
## Steps to Reproduce
1. [Specific step]
2. [Specific step]
3. [Specific step]
## Expected Behavior
[What should happen]
## Actual Behavior
[What actually happens]
## Visual Evidence
- Screenshot: [attached]
- Video: [link if applicable]
- Console errors: [paste errors]
## Impact
- **User Impact:** [How many users affected]
- **Frequency:** [Always, Sometimes, Rarely]
- **Workaround:** [If one exists]
## Additional Context
- Related to: [Feature/ticket]
- Regression: [Yes/No]
- Figma design: [Link if UI bug]
严重程度定义
| 级别 | 标准 | 示例 |
|---|---|---|
| 严重 (P0) | 系统崩溃、数据丢失、安全问题 | 支付失败、登录中断 |
| 高 (P1) | 主要功能损坏、无变通方案 | 搜索不可用 |
| 中 (P2) | 功能部分可用、存在变通方案 | 筛选缺少一个选项 |
| 低 (P3) | 外观问题、罕见边界情况 | 错别字、轻微对齐问题 |
深入探讨:Figma MCP 集成
设计验证工作流
前提条件:
- 已配置 Figma MCP 服务
- 具备 Figma 设计文件的访问权限
- 拥有组件/页面的 Figma URL
流程:
- 从 Figma 获取设计规格
"Get the button specifications from Figma file [URL]"
Response includes:
- Dimensions (width, height)
- Colors (background, text, border)
- Typography (font, size, weight)
- Spacing (padding, margin)
- Border radius
- States (default, hover, active, disabled)
- 对比实现
TC: Primary Button Visual Validation
1. Inspect primary button in browser dev tools
2. Compare against Figma specs:
- Dimensions: 120x40px
- Border-radius: 8px
- Background color: #0066FF
- Font: 16px Medium #FFFFFF
3. Document discrepancies
- 如果不一致,创建缺陷
BUG: Primary button color doesn't match design
Severity: Medium
Expected (Figma): #0066FF
Actual (Implementation): #0052CC
Screenshot: [attached]
Figma link: [specific component]
需要验证的内容
| 元素 | 检查内容 | 工具 |
|---|---|---|
| 颜色 | 十六进制值精确匹配 | 浏览器取色器 |
| 间距 | 内边距/外边距像素 | DevTools 计算样式 |
| 排版 | 字体、字号、字重 | DevTools 字体面板 |
| 布局 | 宽度、高度、位置 | DevTools 盒模型 |
| 状态 | 悬停、激活、聚焦 | 手动交互 |
| 响应式 | 断点行为 | DevTools 设备模式 |
示例查询
"Get button specifications from Figma design [URL]"
"Compare navigation menu implementation against Figma design"
"Extract spacing values for dashboard layout from Figma"
"List all color tokens used in Figma design system"
深入探讨:回归测试
套件结构
| 套件类型 | 时长 | 频率 | 覆盖范围 |
|---|---|---|---|
| 冒烟 | 15-30 分钟 | 每日 | 仅关键路径 |
| 定向 | 30-60 分钟 | 每次变更 | 受影响区域 |
| 完整 | 2-4 小时 | 每周/发布 | 全面覆盖 |
| 健全性 | 10-15 分钟 | 热修复后 | 快速验证 |
构建回归套件
第 1 步:识别关键路径
- 用户离不开哪些功能?
- 哪些功能产生收入?
- 哪些功能处理敏感数据?
- 哪些功能使用最频繁?
第 2 步:确定测试用例优先级
| 优先级 | 描述 | 必须运行 |
|---|---|---|
| P0 | 业务关键、安全 | 始终 |
| P1 | 主要功能、常见流程 | 每周及以上 |
| P2 | 次要功能、边界情况 | 发布时 |
第 3 步:执行顺序
- 先冒烟测试 - 如果失败,停止并修复构建
- 接下来 P0 测试 - 必须通过才能继续
- 然后 P1 再 P2 - 跟踪所有失败
- 探索性测试 - 发现意外问题
通过/失败标准
通过:
- 所有 P0 测试通过
- 90%+ P1 测试通过
- 无未解决的严重缺陷
失败(阻止发布):
- 任何 P0 测试失败
- 发现严重缺陷
- 安全漏洞
- 数据丢失场景
有条件通过:
- P1 失败但有变通方案
- 已知问题已记录
- 修复计划已到位
深入探讨:测试执行跟踪
测试运行报告模板
# Test Run: [Release Version]
**Date:** 2024-01-15
**Build:** v2.5.0-rc1
**Tester:** [Name]
**Environment:** Staging
## Summary
- Total Test Cases: 150
- Executed: 145
- Passed: 130
- Failed: 10
- Blocked: 5
- Not Run: 5
- Pass Rate: 90%
## Test Cases by Priority
| Priority | Total | Pass | Fail | Blocked |
|----------|-------|------|------|---------|
| P0 (Critical) | 25 | 23 | 2 | 0 |
| P1 (High) | 50 | 45 | 3 | 2 |
| P2 (Medium) | 50 | 45 | 3 | 2 |
| P3 (Low) | 25 | 17 | 2 | 1 |
## Critical Failures
- TC-045: Payment processing fails
- Bug: BUG-234
- Status: Open
## Blocked Tests
- TC-112: Dashboard widget (API endpoint down)
## Risks
- 2 critical bugs blocking release
- Payment integration needs attention
## Next Steps
- Retest after BUG-234 fix
- Complete remaining 5 test cases
- Run full regression before sign-off
覆盖率跟踪
## Coverage Matrix
| Feature | Requirements | Test Cases | Status | Gaps |
|---------|--------------|------------|--------|------|
| Login | 8 | 12 | Complete | None |
| Checkout | 15 | 10 | Partial | Payment errors |
| Dashboard | 12 | 15 | Complete | None |
QA 流程工作流
阶段 1:规划
- 审查需求和设计
- 创建测试计划
- 识别测试场景
- 估算工作量和时间线
- 搭建测试环境
阶段 2:测试设计
- 编写测试用例
- 与团队审查测试用例
- 准备测试数据
- 构建回归套件
- 获取 Figma 设计访问权限
阶段 3:执行
- 执行测试用例
- 记录缺陷并提供清晰的复现步骤
- 对照 Figma 进行验证(UI 测试)
- 跟踪测试进度
- 沟通阻塞问题
阶段 4:报告
- 汇总测试结果
- 分析覆盖率
- 记录风险
- 提供 go/no-go 建议
- 归档测试产物
最佳实践
测试用例编写
应该:
- 具体且无歧义
- 为每个步骤包含预期结果
- 每个测试用例只测试一件事
- 使用一致的命名规范
- 保持测试用例可维护
不应该:
- 假设已具备相关知识
- 让测试用例过于冗长
- 跳过前置条件
- 忘记边界情况
- 让预期结果含糊不清
缺陷报告
应该:
- 提供清晰的复现步骤
- 包含截图/视频
- 明确具体环境细节
- 描述对用户的影响
- 为 UI 缺陷链接到 Figma
不应该:
- 在没有复现步骤的情况下报告
- 使用含糊的描述
- 跳过环境细节
- 忘记分配优先级
- 重复报告已有缺陷
回归测试
应该:
- 尽可能自动化重复性测试
- 定期维护回归测试套件
- 优先覆盖关键路径
- 频繁运行冒烟测试
- 每次发布后更新测试套件
不应该:
- 在发布前跳过回归测试
- 让测试套件变得过时
- 每次都测试所有内容
- 忽略失败的回归测试
示例
示例:登录流程测试用例
## TC-LOGIN-001: Valid User Login
**Priority:** P0 (Critical)
**Type:** Functional
**Estimated Time:** 2 minutes
### Objective
Verify users can successfully login with valid credentials
### Preconditions
- User account exists ([email protected] / Test123!)
- User is not already logged in
- Browser cookies cleared
### Test Steps
1. Navigate to https://app.example.com/login
**Expected:** Login page displays with email and password fields
2. Enter email: [email protected]
**Expected:** Email field accepts input
3. Enter password: Test123!
**Expected:** Password field shows masked characters
4. Click "Login" button
**Expected:**
- Loading indicator appears
- User redirected to /dashboard
- Welcome message shown: "Welcome back, Test User"
- Avatar/profile image displayed in header
### Post-conditions
- User session created
- Auth token stored
- Analytics event logged
### Edge Cases to Consider
- TC-LOGIN-002: Invalid password
- TC-LOGIN-003: Non-existent email
- TC-LOGIN-004: SQL injection attempt
- TC-LOGIN-005: Very long password
示例:响应式设计测试用例
## TC-UI-045: Mobile Navigation Menu
**Priority:** P1 (High)
**Type:** UI/Responsive
**Devices:** Mobile (iPhone, Android)
### Objective
Verify navigation menu works correctly on mobile devices
### Preconditions
- Access from mobile device or responsive mode
- Viewport width: 375px (iPhone SE) to 428px (iPhone Pro Max)
### Test Steps
1. Open homepage on mobile device
**Expected:** Hamburger menu icon visible (top-right)
2. Tap hamburger icon
**Expected:**
- Menu slides in from right
- Overlay appears over content
- Close (X) button visible
3. Tap menu item
**Expected:** Navigate to section, menu closes
4. Compare against Figma mobile design [link]
**Expected:**
- Menu width: 280px
- Slide animation: 300ms ease-out
- Overlay opacity: 0.5, color #000000
- Font size: 16px, line-height 24px
### Breakpoints to Test
- 375px (iPhone SE)
- 390px (iPhone 14)
- 428px (iPhone 14 Pro Max)
- 360px (Galaxy S21)
“测试表明缺陷的存在,而非缺陷的缺失。” - Edsger Dijkstra
“质量不是一种行为,而是一种习惯。” - Aristotle
评论
支持 Markdown