Casely — QA Test Case Generator
Casely automates the most time-consuming part of a QA engineer's job: writing test cases.
It reads requirement documents and learns from your team's existing test case examples to produce
structured, style-consistent test suites ready for import into any Test Management System.
Why this matters
Manual test case writing accounts for ~40% of a QA engineer's time. Requirements come in
fragmented formats (PDF, DOCX, XLSX). Every team has its own column structure, naming conventions,
and writing style. Casely solves this by:
- - Converting any document format to clean Markdown via
docling. - Extracting formal style rules from your team's example test cases.
- Generating test cases that match your team's exact structure and tone.
- Exporting to Excel with correct column mapping for TMS import.
Commands
/init [ProjectName]
Creates a new isolated project workspace and verifies the environment.
/parse
Runs the CaselyParser to convert all raw assets (requirements and examples) to Markdown.
/style
Analyzes example test cases and generates a persistent
test_style_guide.md.
/plan
Scans parsed requirements and suggests a testing plan with modules and test types.
/generate [type]
Generates atomic test cases of the specified type (functional, negative, integration, boundary, etc.).
/export
Converts generated Markdown test cases into a formatted
.xlsx file.
Full Workflow
Phase 1: Project Initialization & Environment Setup (/init)
When the user runs /init [ProjectName] (or asks to start a new testing project):
- 1. Create Directories: Create the project directory structure under
projects/ in the repository root:
-
input/requirements/
-
input/examples/
-
processed/requirements/
-
processed/examples/
-
results/
- INLINECODE17
- 2. Environment Setup via
uv:
-
Location: Dependencies are defined in
pyproject.toml at the
repository root (not inside the skill folder). Scripts expect
uv sync to have been run from that root.
- Check if
pyproject.toml exists at the repo root. If not, run
uv init there.
- Install/verify dependencies:
uv add docling openpyxl (or
uv sync from repo root).
- This ensures a lightning-fast setup and handles all sub-dependencies (e.g.
torch for
docling) automatically.
- 3. Confirm to the user:
- "Project
{project_name} initialized via UV. Environment and dependencies (
docling,
openpyxl) are ready."
- "Place your requirement documents into
projects/{project_name}/input/requirements/ and examples into
projects/{project_name}/input/examples/."
Phase 2: Document Parsing (/parse)
When the user runs /parse (or asks to parse/process documents):
- 1. Locate the project. If there's only one project under
projects/, use it automatically.
If multiple exist, ask the user which one.
- 2. Run CaselyParser — The parser is located at
scripts/casely_parser.py within this skill.
It uses
docling and supports all major formats.
Via CLI (optional arguments, auto-detects latest project if omitted):
uv run python <skill-path>/scripts/casely_parser.py
(Or manual path if needed)
CODEBLOCK1
- 3. Report results to the user: how many files were parsed, any errors, and summary of processed files.
Phase 3: Style Guide Creation (/style)
- 1. Read all parsed example files from
processed/examples/.
- 2. Analyze the table structure to extract headers, data types, and mandatory fields.
-
CRITICAL: The style guide MUST be an exact replica of the example's column structure.
-
MANDATORY: Transfer ALL headers from the example files to the
test_style_guide.md in their exact order. Do not rename, omit (e.g., "Comments", "Author"), or add new columns unless explicitly requested.
- 3. Analyze the writing style to extract language, tone, and formatting patterns (e.g., how steps are phrased).
- 4. Generate
test_style_guide.md in the project root. This file acts as the "source of truth" and must explicitly define the horizontal table row structure.
- 5. Present the style guide to the user for review. Any manual adjustments to this file will be respected by the generator.
Phase 4: Professional Test Design & Planning (/plan)
- 1. Load Context & Analysis:
- Read parsed requirements from
processed/requirements/.
- Load
test_style_guide.md to match example structure (columns → test complexity).
- 2. Structural Breakdown:
- Extract modules/endpoints/logic blocks from requirements.
- Categorize by
Level: API (fields/status), Integration (flows), E2E (scenarios).[web:8]
- 3. Smart Estimation (Style-Driven):
-
Metrics from Style Guide: Fields per test (from columns), branches from logic.
-
Coverage Tiers (total cases based on examples):
| Tier | Cases/Module | Coverage | Focus |
|------|--------------|----------|-------|
| Smoke | 1-3 | Min | Golden Path[web:13]
| Critical (80%) | N (fields*0.8) | Key paths | High-risk (finance/auth)
| Full | All perms | 100% | Edges/negatives
-
Risk Scoring: High (security), Med (logic), Low (UI).[web:8]
- 4. Traceability & Prep:
- Quick
RTM Preview: Req ID → Planned Cases (e.g., "REQ-001 → 5 cases").
-
Data/Deps: Test data rules (valid/edge), mocks needed.
- 5. Output Plan:
- Table by Module:
Module | Level | Est. Cases (80%) | Type | Tools.
-
MANDATORY: Provide ready-to-copy commands for each module.
- Save
test_plan.md (importable to TMS).
- Ask:
"Generate Critical Path? /generate functional MODULE_NAME" or
"/generate negative MODULE_NAME".
Next: "/generate [type] will create exactly the estimated number of files, with each file containing one atomic test case matching your style guide."
Phase 5: Test Case Generation (/generate [type])
- 1. Load context:
-
BIDING: Read
test_style_guide.md (Mandatory Source of Truth).
- Read relevant parsed requirement files.
- Target specific module and test type.
- 2. Generate ATOMIC test cases:
-
One File = One Test Case (1 ID = 1 Scenario): Each test case MUST be saved as a separate Markdown file in
results/.
-
Horizontal Structure: Each file MUST contain exactly ONE horizontal table row (header row + data row). Do NOT use vertical "key-value" lists.
-
Naming Convention: {type}_{id}_{short_description}.md.
-
Match the style guide exactly — same columns (1:1 with example), same tone, same structure.
-
No Hallucinations — only use columns and data points supported by the guide and requirements.
- 3. Proactive Report:
- Notify the user of created files.
-
Mandatory Next Step: Always advise the user on what else they can generate. Example:
"I've generated functional cases. You can now run /generate negative to check error handling or /generate security for device metadata."
Phase 6: Export to Excel (/export)
- 1. Convert Markdown files to Excel using
scripts/export_to_xlsx.py.
-
Smart Execution: The script automatically detects the most recently modified project in the
projects/ directory if no paths are provided.
- 2. Atomic One-to-One Export: For every
.md file in results/, the tool creates exactly one corresponding .xlsx file in exports/.
-
Behavior: Direct format conversion preserving the file count.
-
Naming: Files are named identically to their source:
{type}_{id}_{short_description}.xlsx.
- 3. Internal Structure: Each Excel file contains a single sheet called "Test Case" with the columns exactly matching the project's style guide.
- Plain Text Export: Content is exported as plain text with support for multi-line cells (using
<br>). - Save to
exports/.
Important Guidelines
Proactive Guidance (Crucial)
After every command, Casely MUST provide a "Next Step" block.
- - After
/init -> suggest /parse. - After
/parse -> suggest /style. - After
/style -> suggest /plan. - After
/plan -> list specific commands like /generate functional or /generate negative. - After
/generate -> suggest /export OR other generation types.
Language Awareness
Casely is language-agnostic for data. It will detect the language of the provided examples (e.g., Russian) and generate test cases in that same language. The internal logic and style guide should bridge this gap.
Atomic over Composite
Validators should always prefer multiple specialized test cases over one "all-in-one" case. This ensures clearer test results and easier bug localization.
Style Guide is King
The style guide is the single source of truth. Do not invent new columns or change formatting unless the style guide is updated first.
Skill Files
Scripts (scripts/)
- -
scripts/casely_parser.py — Document-to-Markdown converter (Docling). - INLINECODE77 — Markdown-to-Excel exporter.
References (references/)
- -
references/parser_usage.md — Technical details on calling the parser. - INLINECODE80 — Details on the MD-to-Excel conversion logic.
- INLINECODE81 — Methodologies for style extraction.
Casely — QA测试用例生成器
Casely自动化了QA工程师工作中最耗时的部分:编写测试用例。
它能读取需求文档,并从团队现有的测试用例示例中学习,生成结构化、风格一致的测试套件,可直接导入任何测试管理系统。
为什么这很重要
手动编写测试用例约占QA工程师40%的时间。需求以碎片化格式(PDF、DOCX、XLSX)呈现。每个团队都有自己的列结构、命名规范和编写风格。Casely通过以下方式解决这一问题:
- - 通过docling将任何文档格式转换为干净的Markdown。
- 从团队的示例测试用例中提取正式的风格规则。
- 生成与团队精确结构和语气匹配的测试用例。
- 导出为Excel,并带有正确的列映射,以便导入TMS。
命令
/init [项目名称]
创建新的独立项目工作区并验证环境。
/parse
运行CaselyParser将所有原始资产(需求和示例)转换为Markdown。
/style
分析示例测试用例并生成持久的test
styleguide.md。
/plan
扫描已解析的需求,并建议包含模块和测试类型的测试计划。
/generate [类型]
生成指定类型的原子测试用例(功能、负面、集成、边界等)。
/export
将生成的Markdown测试用例转换为格式化的.xlsx文件。
完整工作流程
阶段1:项目初始化与环境设置(/init)
当用户运行/init [项目名称](或要求启动新测试项目)时:
- 1. 创建目录: 在仓库根目录下的projects/中创建项目目录结构:
- input/requirements/
- input/examples/
- processed/requirements/
- processed/examples/
- results/
- exports/
- 2. 通过uv进行环境设置:
-
位置: 依赖项在
仓库根目录(而非技能文件夹内)的pyproject.toml中定义。脚本期望从该根目录运行uv sync。
- 检查pyproject.toml是否存在于仓库根目录。如果没有,则在那里运行uv init。
- 安装/验证依赖项:uv add docling openpyxl(或从仓库根目录运行uv sync)。
- 这确保了极快的设置速度,并自动处理所有子依赖项(例如docling所需的torch)。
- 3. 向用户确认:
- 项目{project_name}已通过UV初始化。环境和依赖项(docling、openpyxl)已准备就绪。
- 请将您的需求文档放入projects/{project
name}/input/requirements/,示例放入projects/{projectname}/input/examples/。
阶段2:文档解析(/parse)
当用户运行/parse(或要求解析/处理文档)时:
- 1. 定位项目。 如果projects/下只有一个项目,则自动使用它。如果存在多个,询问用户选择哪一个。
- 2. 运行CaselyParser — 解析器位于此技能内的scripts/casely_parser.py。它使用docling并支持所有主流格式。
通过CLI(可选参数,如果省略则自动检测最新项目):
bash
uv run python <技能路径>/scripts/casely_parser.py
(如果需要,也可手动指定路径)
bash
uv run python <技能路径>/scripts/casely_parser.py projects/{名称}/input/requirements projects/{名称}/processed/requirements
- 3. 向用户报告结果: 解析了多少文件、任何错误以及已处理文件的摘要。
阶段3:风格指南创建(/style)
- 1. 从processed/examples/读取所有已解析的示例文件。
- 2. 分析表格结构以提取表头、数据类型和必填字段。
-
关键: 风格指南必须精确复制示例的列结构。
-
强制: 将示例文件中的所有表头按其精确顺序转移到test
styleguide.md中。除非明确要求,否则不要重命名、省略(例如注释、作者)或添加新列。
- 3. 分析编写风格以提取语言、语气和格式模式(例如步骤的表述方式)。
- 4. 在项目根目录生成teststyleguide.md。 此文件作为事实来源,必须明确定义水平表格行结构。
- 5. 向用户展示风格指南以供审阅。对此文件的任何手动调整都将被生成器尊重。
阶段4:专业测试设计与规划(/plan)
- 1. 加载上下文与分析:
- 从processed/requirements/读取已解析的需求。
- 加载test
styleguide.md以匹配示例结构(列 → 测试复杂度)。
- 2. 结构分解:
- 从需求中提取模块/端点/逻辑块。
- 按
级别分类:API(字段/状态)、集成(流程)、端到端(场景)。[web:8]
- 3. 智能估算(风格驱动):
-
风格指南指标: 每个测试的字段数(来自列)、逻辑分支数。
-
覆盖层级(基于示例的总用例数):
| 层级 | 用例数/模块 | 覆盖率 | 重点 |
|------|--------------|--------|------|
| 冒烟 | 1-3 | 最小 | 黄金路径[web:13]
| 关键(80%) | N(字段*0.8) | 关键路径 | 高风险(金融/认证)
| 完整 | 所有排列 | 100% | 边界/负面
-
风险评分: 高(安全)、中(逻辑)、低(UI)。[web:8]
- 4. 可追溯性与准备:
- 快速
RTM预览:需求ID → 计划用例数(例如REQ-001 → 5个用例)。
-
数据/依赖: 测试数据规则(有效/边界)、所需模拟。
- 5. 输出计划:
- 按模块的表格:
模块 | 级别 | 估算用例数(80%) | 类型 | 工具。
-
强制: 为每个模块提供可直接复制的命令。
- 保存test_plan.md(可导入TMS)。
- 询问:
生成关键路径?/generate functional MODULENAME 或 /generate negative MODULENAME。
下一步: /generate [类型]将精确创建估算数量的文件,每个文件包含一个与您的风格指南匹配的原子测试用例。
阶段5:测试用例生成(/generate [类型])
- 1. 加载上下文:
-
必须遵守: 读取test
styleguide.md(强制事实来源)。
- 读取相关的已解析需求文件。
- 定位特定模块和测试类型。
- 2. 生成原子测试用例:
-
一个文件 = 一个测试用例(1个ID = 1个场景): 每个测试用例必须作为单独的Markdown文件保存在results/中。
-
水平结构: 每个文件必须包含恰好一个水平表格行(表头行 + 数据行)。不要使用垂直的键值列表。
-
命名规范: {类型}
{ID}{简短描述}.md。
-
精确匹配风格指南 — 相同的列(与示例1:1对应)、相同的语气、相同的结构。
-
无幻觉 — 仅使用指南和需求支持的列和数据点。
- 3. 主动报告:
- 通知用户已创建的文件。
-
强制下一步: 始终建议用户还可以生成什么。例如:
我已生成功能用例。您现在可以运行/generate negative来检查错误处理,或运行/generate security来检查设备元数据。
阶段6:导出到Excel(/export)
- 1. 使用scripts/exporttoxlsx.py将Markdown文件转换为Excel。
-
智能执行: 如果未提供路径,脚本会自动检测projects/目录中最近修改的项目。
- 2. 原子一对一导出: 对于results/中的每个.md文件,工具在exports/中创建恰好一个对应的.xlsx文件。
-
行为: 直接格式转换,保持文件数量不变。
-
命名: 文件与其源文件命名相同:{类型}
{ID}{简短描述}.xlsx。
- 3. 内部结构: 每个Excel文件包含一个名为测试用例的单一工作表,其列与项目的风格指南完全匹配。
- 纯文本导出: 内容以纯文本形式导出,支持多行单元格(使用
)。 - 保存到exports/。
重要指南