with one click
testcase-format
测试用例工程化处理 - 负责转换为模板结构、调用脚本生成 Excel、更新索引,与 Python scripts 对接
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
测试用例工程化处理 - 负责转换为模板结构、调用脚本生成 Excel、更新索引,与 Python scripts 对接
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
QA 项目内置知识库管理能力(基于 llm-wiki 框架)。 触发条件:用户明确提到"知识库"、"wiki"、"消化素材"、"查询知识"、"知识结晶"等, 或通过 `/qa` 命令选择「知识库管理」选项。
解析 Axure RP 导出的 HTML - 提取页面结构、元件、注释和交互说明,供测试用例生成使用
读取 Figma 设计稿数据 - 提取文案、组件结构、设计标注和交互说明,供测试用例生成使用
从需求文档/PRD/页面/接口说明生成结构化测试用例 - 负责需求解析、模块识别、平台拆分、测试点设计、输出结构化用例
Fetch any URL and convert to markdown using Chrome CDP. Saves the rendered HTML snapshot alongside the markdown, uses an upgraded Defuddle pipeline with better web-component handling and YouTube transcript extraction, and automatically falls back to the pre-Defuddle HTML-to-Markdown pipeline when needed. If local browser capture fails entirely, it can fall back to the hosted defuddle.md API. Supports two modes - auto-capture on page load, or wait for user signal (for pages requiring login). Use when user wants to save a webpage as markdown.
仅分析需求质量与测试风险,不生成完整测试用例 - 负责模块拆分、风险识别、输出测试点清单与分析报告
| name | testcase-format |
| description | 测试用例工程化处理 - 负责转换为模板结构、调用脚本生成 Excel、更新索引,与 Python scripts 对接 |
触发时机:
必须在用户明确选择导出方式后才能执行:
约束:
knowledge/wiki/topics/ 创建或更新功能主题页,关联领域知识和已生成用例snapshot_testcase.py 保存用例内容快照到 outputs/snapshots/testcase-generate 负责)testcase-analyze 负责)testcase-augment 负责)testcase-i18n 负责)使用 templates/testcase_template.xlsx 模板和 xlsx_fill_testcase_template.py 脚本:
python3 engine/scripts/xlsx_fill_testcase_template.py \
rows.json output.xlsx --template templates/testcase_template.xlsx
rows.json 格式:
[
{
"平台": "客户端",
"模块": "功能入口",
"功能点": "侧边栏入口",
"前置条件(测试点)": "1、已启用活动",
"操作步骤": "1、进入页面",
"预期结果": "入口展示正常",
"测试结果": "",
"备注": "【功能测试】"
}
]
meta.json 格式(可选):
{
"测试平台": "账服、客户端",
"参考档": "需求文档 v2"
}
| 要求 | 说明 |
|---|---|
| 列顺序 | 与目标模板保持一致 |
| 多行字段 | 必须写入真实换行符 |
| 自动换行 | 前置条件 、操作步骤 、预期结果 必须开启 wrap text |
| 固定区 | 不得被覆盖、删除或上移 |
| 表头行 | 位置不得改变 |
| 数据区 | 从模板指定起始行连续写入 |
| 默认留空字段 | 若无用户输入,必须保持为空 |
以下字段若用户未明确提供内容,默认必须保留为空:
测试平台系统&版本文档编写人参考档测试日期最后更新当用户要求"补充已有用例"时,使用 xlsx_append_and_highlight.py 脚本:
python3 engine/scripts/xlsx_append_and_highlight.py \
existing.xlsx new_rows.json output.xlsx --highlight
规则:
id,仅更新 updated_at使用 upsert_testcase_index.py 自动生成或更新索引条目:
python3 engine/scripts/upsert_testcase_index.py \
outputs/generated/module.xlsx
索引条目字段:
| 字段 | 说明 |
|---|---|
id | 唯一标识 |
group_key | 分组键 |
title | 标题 |
module | 模块 |
module_ids | 模块 ID 列表 |
topic | 主题 |
platform_scope | 平台范围 |
format | 文件格式 |
rel_path | 相对路径 |
template | 使用的模板 |
source_refs | 来源引用 |
tags | 标签 |
status | 状态 |
created_at | 创建时间 |
updated_at | 更新时间 |
| 脚本 | 用途 |
|---|---|
xlsx_fill_testcase_template.py | 填充 Excel 模板 |
xlsx_append_and_highlight.py | 追加用例并标黄 |
upsert_testcase_index.py | 新增/更新索引 |
validate_testcase_index.py | 校验测试用例索引 |
validate_i18n_index.py | 校验多语言索引 |
cleanup_testcase_store.py | 清理过期文件 |
diff_testcase_indexes.py | 比较索引差异 |
export_testcase_report.py | 生成覆盖率报告 |
# 索引校验
python3 engine/scripts/validate_testcase_index.py \
outputs/testcase-index.json
# 清理过期文件(先 dry-run)
python3 engine/scripts/cleanup_testcase_store.py --dry-run
# 索引差异比较
python3 engine/scripts/diff_testcase_indexes.py \
old-index.json new-index.json
# 覆盖率报告
python3 engine/scripts/export_testcase_report.py \
outputs/testcase-index.json --output report.md
outputs/generated/<模块>/<用例名称>.xlsx
例:outputs/generated/认证中心/用户登录功能优化.xlsx
outputs/i18n/<模块>/<模块>-<功能>.json
例:outputs/i18n/HeroSkill/HeroSkill-SkillUpgrade.json
测试用例已导出:
文件路径:outputs/generated/<模块>/<用例名称>.xlsx
用例数量:XX 条
- 账服:XX 条
- 客户端:XX 条
索引已更新:outputs/testcase-index.json
主题页已创建/更新:knowledge/wiki/topics/<功能名称>.md
快照已保存:outputs/snapshots/<模块>/<用例名称>/<timestamp>.json
触发条件:
主题页格式:
# <功能名称>
## 领域知识
参考:[[<模块名称>]]
## 已生成测试用例
| 文件名 | 模块 | 用例数 | 平台 | 生成时间 |
|--------|------|--------|------|----------|
| <文件名>.xlsx | <模块> | XX 条 | 客户端、账服 | YYYY-MM-DD |
## 测试点摘要
- <测试点 1>
- <测试点 2>
- ...
更新规则:
触发条件:
快照生成命令:
python3 engine/scripts/snapshot_testcase.py \
outputs/generated/<模块>/<用例名称>.xlsx \
--output-dir outputs/snapshots/<模块>/<用例名称>/
快照用途:
主题页中的快照引用:
## 测试点摘要
> 数据来源:快照文件 `outputs/snapshots/<模块>/<用例名称>/<timestamp>.json`
> 最后同步时间:2026-04-14 19:17
主题页支持按子文件夹组织,便于管理和查找。
子文件夹配置:
knowledge/wiki/topics/submodule-config.json{ "模块名": { "用例名称": "子文件夹名", ... }, ... }示例配置:
{
"运营活动": {
"复充返利活动": "充值优惠",
"幸运卡片": "游戏优惠",
"锦标赛": "锦标赛"
}
}
主题页路径:
knowledge/wiki/topics/<用例名称>.mdknowledge/wiki/topics/<模块>/<子文件夹>/<用例名称>.md同步命令:
# 使用配置文件
python3 engine/scripts/sync_testcase_snapshot.py \
outputs/generated/运营活动/复充返利活动.xlsx
# 手动指定子文件夹
python3 engine/scripts/sync_testcase_snapshot.py \
outputs/generated/运营活动/复充返利活动.xlsx \
--submodule 充值优惠
用例已追加:
原文件:outputs/generated/<模块>/<用例名称>.xlsx
新增用例:XX 条
- 新增行已标黄标识
- 索引已更新 updated_at
../../references/test-design/output-template.md - 输出模板../../references/engineering/testcase-store.md - 工作区索引约定testcase-generate - 从需求生成测试用例testcase-augment - 补充已有用例testcase-i18n - 多语言 JSON 校验