选项
首页首页 Skill 开发者工具 test-scenarios

test-scenarios

phuryn/pm-skills phuryn/pm-skills

根据用户故事,创建包含测试目标、起始条件、用户角色、分步操作及预期结果的全面测试用例。

...展开全部
0
更新时间 2026-09-29

测试用例

根据用户故事创建包含测试目标、起始条件、用户角色、分步测试操作及预期结果的全面测试场景。

适用场景:编写质量保证(QA)测试用例、制定测试计划、定义验收测试场景,或验证用户故事的实现情况。

参数:

  • $PRODUCT: 产品或系统名称
  • $USER_STORY: 待测试的用户故事(标题和验收标准)
  • $CONTEXT: 其他测试背景或约束条件

分步流程

  1. 审查用户故事和验收标准
  2. 定义测试目标——需要验证的具体行为
  3. 建立起始条件——系统状态、数据设置、配置
  4. 确定用户角色——由谁执行测试操作
  5. 创建测试步骤——将交互过程分解为各个步骤
  6. 定义预期结果——每个步骤后的可观察结果
  7. 考虑边界情况——无效输入、边界条件
  8. 输出详细的测试场景——供质量保证团队执行

场景模板

测试场景:[清晰的场景名称]

测试目标:[本测试验证的内容]

初始条件:

  • [所需的系统状态]
  • [所需数据或配置]
  • [用户设置或权限]

用户角色:[由谁执行测试]

测试步骤:

  1. [第一个操作及其预期结果]
  2. [第二项操作及其可观察到的结果]
  3. [第三个操作及系统行为]
  4. [结束操作及最终状态]

预期结果:

  • [可观察结果 1]
  • [可观察结果 2]
  • [可观察结果 3]

测试场景示例

测试场景:在商品页面查看“最近浏览的商品”

测试目标:验证“最近浏览”区域显示正确,且不包含当前商品。

初始条件:

  • 用户已登录或已启用浏览器历史记录
  • 用户在当前会话中至少浏览过 2 件商品
  • 用户当前所在的商品页面与之前浏览过的商品不同

用户角色:在线购物者

测试步骤:

  1. 导航至任意商品页面 → 页面底部应显示包含之前浏览过的商品的“最近浏览”板块
  2. 滚动至页面底部 → “最近浏览”板块可见,并显示商品卡片
  3. 验证商品缩略图 → 图片、标题和价格显示正确
  4. 检查当前商品 → 当前商品不出现在“最近浏览”列表中
  5. 点击商品卡片 → 用户跳转至对应的商品页面

预期结果:

  • “最近浏览”区域仅在浏览过至少1件商品后才会显示
  • 该区域显示4至8张包含完整信息的产品卡片
  • 当前商品不包含在列表中
  • 每张卡片显示“X分钟/小时前浏览过”的时间戳
  • 点击商品卡片可跳转至对应的商品详情页
  • 性能:该板块加载时间不超过2秒

交付成果

  • 针对每个验收标准的全面测试用例
  • 与用户故事意图相符的清晰测试目标
  • 详细的分步测试操作
  • 每个步骤后可观察到的预期结果
  • 边界情况和错误场景的覆盖
  • 已准备就绪,可供质量保证团队执行并形成文档
在 GitHub 上查看
---
name: test-scenarios
description: Create comprehensive test scenarios from user stories with test objectives, starting conditions, user roles, step-by-step actions, and expected outcomes.
---
# Test Scenarios

Create comprehensive test scenarios from user stories with test objectives, starting conditions, user roles, step-by-step test actions, and expected outcomes.

**Use when:** Writing QA test cases, creating test plans, defining acceptance test scenarios, or validating user story implementations.

**Arguments:**
- `$PRODUCT`: The product or system name
- `$USER_STORY`: The user story to test (title and acceptance criteria)
- `$CONTEXT`: Additional testing context or constraints

## Step-by-Step Process

1. **Review the user story** and acceptance criteria
2. **Define test objectives** - What specific behavior to validate
3. **Establish starting conditions** - System state, data setup, configurations
4. **Identify user roles** - Who performs the test actions
5. **Create test steps** - Break down interactions step-by-step
6. **Define expected outcomes** - Observable results after each step
7. **Consider edge cases** - Invalid inputs, boundary conditions
8. **Output detailed test scenarios** - Ready for QA execution

## Scenario Template

**Test Scenario:** [Clear scenario name]

**Test Objective:** [What this test validates]

**Starting Conditions:**
- [System state required]
- [Data or configuration needed]
- [User setup or permissions]

**User Role:** [Who performs the test]

**Test Steps:**
1. [First action and its expected result]
2. [Second action and observable outcome]
3. [Third action and system behavior]
4. [Completion action and final state]

**Expected Outcomes:**
- [Observable result 1]
- [Observable result 2]
- [Observable result 3]

## Example Test Scenario

**Test Scenario:** View Recently Viewed Products on Product Page

**Test Objective:** Verify that the 'Recently viewed' section displays correctly and excludes the current product.

**Starting Conditions:**
- User is logged in or has browser history enabled
- User has viewed at least 2 products in the current session
- User is now on a product page different from previously viewed items

**User Role:** Online Shopper

**Test Steps:**
1. Navigate to any product page → Section should appear at bottom with previously viewed items
2. Scroll to bottom of page → "Recently viewed" section is visible with product cards
3. Verify product thumbnails → Images, titles, and prices are displayed correctly
4. Check current product → Current product is NOT in the recently viewed list
5. Click on a product card → User navigates to the corresponding product page

**Expected Outcomes:**
- Recently viewed section appears only after viewing at least 1 prior product
- Section displays 4-8 product cards with complete information
- Current product is excluded from the list
- Each card shows "Viewed X minutes/hours ago" timestamp
- Clicking cards navigates to correct product pages
- Performance: Section loads within 2 seconds

## Output Deliverables

- Comprehensive test scenarios for each acceptance criterion
- Clear test objectives aligned with user story intent
- Detailed step-by-step test actions
- Observable expected outcomes after each step
- Edge case and error scenario coverage
- Ready for QA team execution and documentation

所有文件

1 个文件

安装 test-scenarios

下载技能文件并将其解压到 .claude/skills/ 目录中。

下载ZIP

克隆仓库并复制技能文件到您的项目中。

git clone https://github.com/phuryn/pm-skills/tree/main/pm-execution/skills/test-scenarios # Copy SKILL.md to your .claude/skills/ directory

复制 复制
快速设置: 将技能文件夹复制到 .claude/skills/ Claude 会自动检测并使用该技能

相关技能

algorithmic-art
更新时间 2026-08-27
systematic-debugging
更新时间 2026-09-03
tech-debt-tracker
更新时间 2026-08-29
continual-learning
更新时间 2026-09-10
OR