测试用例表编写

v1.0.0

Use when creating or editing software test case tables in Excel format, adding test cases to existing tables, or ensuring format consistency with test case t...

0· 76·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for lky115/test1221413623463462451414.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "测试用例表编写" (lky115/test1221413623463462451414) from ClawHub.
Skill page: https://clawhub.ai/lky115/test1221413623463462451414
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install test1221413623463462451414

ClawHub CLI

Package manager switcher

npx clawhub@latest install test1221413623463462451414
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description describe creating and editing Excel test-case tables; SKILL.md contains Python examples using openpyxl to create, format, and append rows to an .xlsx file — all aligned with the stated purpose.
Instruction Scope
Runtime instructions are limited to reading/writing Excel files, applying formatting, and simple in-file operations (checking existence, appending rows, deduplication). They do not reference other system credentials, unrelated files, network endpoints, or broad data collection.
Install Mechanism
No install spec (instruction-only), which lowers risk; however the SKILL.md examples import openpyxl but the skill metadata does not declare or provide an installation step for that dependency. This is an omission (operational, not malicious) to be aware of.
Credentials
The skill requests no environment variables, credentials, or config paths. The operations shown only require filesystem access to Excel files, which is appropriate for this functionality.
Persistence & Privilege
always is false and the skill is user-invocable. It does not request persistent presence or system-wide configuration changes. Autonomous invocation is allowed by default but is not combined with other risky privileges here.
Assessment
This skill appears coherent and limited to creating/editing Excel test-case tables. Before installing or running it: 1) be aware the example code will read/write files in the current working directory and may overwrite '测试用例表.xlsx' — back up important files; 2) ensure the agent environment has the openpyxl Python package (the SKILL.md imports it but the skill provides no install step); 3) confirm you are comfortable allowing the agent to perform local file I/O (no network or credential access is requested). If you need automatic dependency installation or stricter file path handling, request those additions before use.

Like a lobster shell, security has layers — review code before you run it.

latestvk974cw1jgtw5nbfzg4jgxs8hms84y0xg
76downloads
0stars
1versions
Updated 1w ago
v1.0.0
MIT-0

测试用例表管理

Overview

用于创建和管理软件回归测试用例表的Excel文件,确保格式一致性和规范化的测试用例文档。

When to Use

  • 用户要求创建测试用例表
  • 需要向现有测试用例表添加新的测试用例
  • 需要调整测试用例表格式使其符合模版
  • 需要清理重复数据或重新格式化表格

Standard Table Structure

表头(14列):

字段名列宽
A序号13.0
B用例ID37.125
C所属模块17.125
D用例标题75.375
E优先级12.125
F前置条件95.625
G测试步骤50.625
H预期结果60.75
I实际结果68.375
J状态11.5
K缺陷ID13.0
L测试者13.0
M执行日期15.625
N备注13.0

Format Specifications

表头格式

  • 字体:粗体,大小11
  • 背景:黄色(FFFFFF00)
  • 对齐:水平居中、垂直居中
  • 边框:细线边框

数据行格式

  • 行高:105
  • 对齐:自动换行(wrap_text=True)、垂直顶部对齐
  • 边框:细线边框
  • 内容:多行文本使用换行符分隔步骤

用例ID命名规范

格式:项目名_模块_序号 示例:TPClawHub_Login_001

优先级标准

  • P0:核心功能,必须通过
  • P1:重要功能,应该通过
  • P2:次要功能,可选通过

Implementation

创建新表

from openpyxl import Workbook
from openpyxl.styles import Font, PatternFill, Alignment, Border, Side

wb = Workbook()
sheet = wb.active
sheet.title = "测试用例表"

headers = ['序号', '用例ID', '所属模块', '用例标题', '优先级', '前置条件',
           '测试步骤', '预期结果', '实际结果', '状态', '缺陷ID', '测试者', '执行日期', '备注']

for col, header in enumerate(headers, 1):
    cell = sheet.cell(row=1, column=col, value=header)
    cell.font = Font(bold=True, size=11)
    cell.fill = PatternFill(start_color='FFFFFF00', end_color='FFFFFF00', fill_type='solid')
    cell.alignment = Alignment(horizontal='center', vertical='center')

column_widths = {'A':13, 'B':37, 'C':17, 'D':75, 'E':12, 'F':95, 'G':50, 'H':60, 'I':68, 'J':11, 'K':13, 'L':13, 'M':15, 'N':13}
for col, width in column_widths.items():
    sheet.column_dimensions[col].width = width

wb.save('测试用例表.xlsx')

添加测试用例

from openpyxl import load_workbook
from openpyxl.styles import Alignment, Border, Side

wb = load_workbook('测试用例表.xlsx')
sheet = wb.active

# 找到最后一行
last_row = 2
for row in range(2, sheet.max_row + 1):
    if sheet.cell(row=row, column=2).value:
        last_row = row

new_case = ['序号', '用例ID', '所属模块', '用例标题', '优先级',
            '前置条件', '测试步骤', '预期结果', '', '', '', '', '', '备注']

thin_border = Border(left=Side(style='thin'), right=Side(style='thin'),
                     top=Side(style='thin'), bottom=Side(style='thin'))
data_alignment = Alignment(wrap_text=True, vertical='top')

for col_idx, val in enumerate(new_case, 1):
    cell = sheet.cell(row=last_row + 1, column=col_idx)
    cell.value = val
    cell.alignment = data_alignment
    cell.border = thin_border
sheet.row_dimensions[last_row + 1].height = 105

wb.save('测试用例表.xlsx')

Common Mistakes

问题解决方案
格式丢失使用完整样式对象重新应用格式
文件占用提示用户关闭Excel后再操作
重复数据遍历用例ID去重后重写
列宽不匹配按标准列宽表重新设置

Workflow

digraph testcase_workflow {
    "用户请求" [shape=box];
    "检查文件是否存在" [shape=diamond];
    "读取模版格式" [shape=box];
    "创建新表" [shape=box];
    "添加用例" [shape=box];
    "应用格式" [shape=box];
    "保存文件" [shape=box];
    "验证结果" [shape=box];

    "用户请求" -> "检查文件是否存在";
    "检查文件是否存在" -> "读取模版格式" [label="存在"];
    "检查文件是否存在" -> "创建新表" [label="不存在"];
    "读取模版格式" -> "添加用例";
    "创建新表" -> "添加用例";
    "添加用例" -> "应用格式";
    "应用格式" -> "保存文件";
    "保存文件" -> "验证结果";
}

Comments

Loading comments...