Generate test cases from requirements, user stories, PRDs, or API docs. Output structured test cases in markdown tables or export to CSV/JSON. Supports equiv...
Generate structured, thorough test cases from various input sources.
✅ USE this skill when:
❌ DON'T use this skill when:
api-tester or manual executionapi-tester or coding toolsRead the provided input (requirements doc, user story, API spec, or verbal description). Identify:
Based on the analysis, apply appropriate techniques:
TechniqueWhen to ApplyEquivalence PartitioningMultiple input values with similar behaviorBoundary Value AnalysisNumeric ranges, string lengths, date rangesDecision TableComplex business rules with multiple conditionsState TransitionWorkflows with status changes (order, ticket, etc.)Error GuessingBased on common defect patternsPairwise/CombinatorialMultiple parameters with interactions
Output format (default markdown table):
markdown
| ID | Module | Priority | Precondition | Steps | Input Data | Expected Result | Type |
|----|--------|----------|--------------|-------|------------|-----------------|------|
| TC001 | Login | P0 | User registered | 1. Open login page 2. Enter credentials 3. Click login | user: admin, pass: Admin@123 | Login success, redirect to dashboard | Positive |
| TC002 | Login | P0 | User registered | 1. Open login page 2. Enter wrong password 3. Click login | user: admin, pass: wrong | Error: "Invalid credentials" | Negative |
Priority definitions:
Type categories:
After generating, provide a coverage summary:
text
📊 Test Coverage Summary
- Total cases: 25
- By priority: P0(8) P1(10) P2(5) P3(2)
- By type: Positive(10) Negative(8) Boundary(4) Security(2) Performance(1)
- Estimated gaps: [list any uncovered areas]
When user requests export:
bash
# Save as CSV — write to workspace
# ~/.openclaw/workspace/output/test_cases.csv
# Save as JSON (for TestLink/禅道 import)
# ~/.openclaw/workspace/output/test_cases.json
csv
所属模块,用例标题,前置条件,步骤,预期,优先级,用例类型,关键词
/登录模块,正常登录验证,用户已注册,1.打开登录页 2.输入正确账号密码 3.点击登录,登录成功跳转首页,1,功能测试,登录;正向
xml
<?xml version="1.0" encoding="UTF-8"?>
<testcases>
<testcase name="正常登录验证">
<summary>验证使用正确账号密码能成功登录</summary>
<preconditions>用户已注册</preconditions>
<steps>
<step>
<step_number>1</step_number>
<actions>打开登录页,输入正确账号密码,点击登录</actions>
<expectedresults>登录成功,跳转首页</expectedresults>
</step>
</steps>
<importance>2</importance>
<execution_type>1</execution_type>
</testcase>
</testcases>
<script>alert(1)</script>, ' OR 1=1--, emoji 🔍When multiple input parameters interact, use pairwise to reduce combinations:
text
参数A: [a1, a2, a3]
参数B: [b1, b2]
参数C: [c1, c2, c3]
全组合: 3×2×3 = 18 条
Pairwise: ~9 条(覆盖所有两两组合)
示例输出:
#参数A参数B参数C1a1b1c12a1b2c23a2b1c34a2b2c15a3b1c26a3b2c3...
适用场景:浏览器兼容性(浏览器×系统×分辨率)、表单多字段组合、配置项测试。
For workflow/status-driven features, map out state transitions:
text
[草稿] --提交--> [待审核] --通过--> [已发布]
| |--驳回--> [已驳回] --修改--> [草稿]
|--删除--> [已删除]
Generate test cases covering: