test-scenarios
phuryn/pm-skills
根據使用者故事,建立包含測試目標、起始條件、使用者角色、逐步操作步驟及預期結果的完整測試情境。
...展開全部測試情境
根據使用者故事建立完整的測試情境,內容包含測試目標、起始條件、使用者角色、逐步測試步驟及預期結果。
適用情境:撰寫 QA 測試案例、建立測試計畫、定義驗收測試情境,或驗證使用者故事的實作成果。
參數:
$PRODUCT:產品或系統名稱$USER_STORY:待測試的使用者故事(標題與驗收準則)$CONTEXT: 額外的測試背景或限制條件
逐步流程
- 檢視使用者故事與驗收準則
- 定義測試目標——需驗證的具體行為
- 建立起始條件 — 系統狀態、資料設定、配置
- 識別使用者角色 — 誰執行測試操作
- 建立測試步驟 — 將互動流程逐一分解
- 定義預期結果 — 每個步驟完成後可觀察到的結果
- 考量邊界案例 —— 無效輸入、邊界條件
- 產出詳細的測試情境 - 準備好供品質保證團隊執行
測試情境範本
測試情境:[清晰的情境名稱]
測試目標:[此測試驗證的內容]
起始條件:
- [所需的系統狀態]
- [所需資料或設定]
- [使用者設定或權限]
使用者角色:[由誰執行此測試]
測試步驟:
- [第一個操作及其預期結果]
- [第二項操作及其可觀察到的結果]
- [第三個操作及其系統行為]
- [完成動作與最終狀態]
預期結果:
- [可觀察結果 1]
- [可觀察結果 2]
- [可觀察結果 3]
測試情境範例
測試情境:在產品頁面檢視「最近瀏覽過的商品」
測試目標:驗證「最近瀏覽」區塊是否顯示正確,且不包含當前商品。
起始條件:
- 使用者已登入或已啟用瀏覽器瀏覽紀錄
- 使用者在當前會話中已瀏覽至少 2 項商品
- 使用者目前所在的商品頁面與先前瀏覽過的商品不同
使用者角色:線上購物者
測試步驟:
- 導航至任意商品頁面 → 頁面底部應顯示包含先前瀏覽商品的區塊
- 捲動至頁面底部 → 可看見「最近瀏覽」區塊及商品卡片
- 驗證商品縮圖 → 圖片、標題和價格均顯示正確
- 檢查當前商品 → 當前商品不應出現在「最近瀏覽」清單中
- 點擊商品卡片 → 使用者將導向對應的商品頁面
預期結果:
- 「最近瀏覽」區塊僅在先前瀏覽過至少 1 項商品後才會顯示
- 該區塊顯示 4 至 8 張包含完整資訊的產品卡片
- 當前產品不包含在清單中
- 每張卡片均顯示「X 分鐘/小時前瀏覽過」的時間戳記
- 點擊商品卡片可導航至正確的商品頁面
- 效能:區塊載入時間在 2 秒內
交付成果
- 針對每個驗收標準的全面測試情境
- 清晰且符合使用者故事意圖的測試目標
- 詳細的分步測試操作
- 每個步驟後可觀察到的預期結果
- 邊界案例與錯誤情境的涵蓋範圍
- 已準備就緒,可供品質保證團隊執行與建檔
---
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
複製





首頁
