Agent Skills › DanielSuo117/velocitai › test-runner

test-runner

GitHub

运行 pytest 测试并生成 Allure 报告,支持单用例调试或全量回归。自动分析失败原因并提供结构化结果摘要,强调运行前需确认环境参数。

skills/test-runner/SKILL.md DanielSuo117/velocitai

Trigger Scenarios

运行测试 跑测试 run test pytest 失败分析 allure

Install

npx skills add DanielSuo117/velocitai --skill test-runner -g -y
More Options

Use without installing

npx skills use DanielSuo117/velocitai@test-runner

指定 Agent (Claude Code)

npx skills add DanielSuo117/velocitai --skill test-runner -a claude-code -g -y

安装 repo 全部 skill

npx skills add DanielSuo117/velocitai --all -g -y

预览 repo 内 skill

npx skills add DanielSuo117/velocitai --list

SKILL.md

Frontmatter
{
    "name": "test-runner",
    "description": "运行 pytest + 结构化分析失败原因。触发:运行测试、跑测试、run test、pytest、失败分析、allure。"
}

Test Runner — 运行测试与结果分析

⚠️ 运行前必须向用户确认 --env(见 agent-behavior.md P0.2)。 即使 config/settings.py::DEFAULT_ENV="prod"、即使下方示例写 --env=<pre|prod>(示例 ≠ 默认值),仍必须问用户。

运行前准备

# 确认虚拟环境已激活
source .venv/bin/activate

# 确认依赖已安装
pip list | grep -E "playwright|pytest|allure"

运行模式

所有测试均基于真实环境(URL + token)运行。

模式 1: 单个 story(调试 / 定位符验证)

场景: 替换定位符后验证、调试单个页面回归点

# 对应角色
pytest framework/tests/<role>/test_<role>_flow.py --env=<pre|prod> -v -k "test_xxx"
# 对应角色
pytest framework/tests/<role>/test_<role>_home.py --env=<pre|prod> -v -k "test_<case_name>"

模式 2: 按角色 / 全量回归

场景: 发版前验证、完整回归

# <角色A>全量
pytest framework/tests/<roleA>/ --env=<pre|prod>
# <角色B>全量
pytest framework/tests/<roleB>/ --env=<pre|prod>
# 全量
pytest framework/tests/ --env=<pre|prod>

查看 Allure 报告

# 启动报告服务器查看(运行完测试后直接可用)
allure serve reports/allure-results

# 生成静态报告(可部署)
allure generate reports/allure-results -o reports/allure-report --clean

结果分析

pytest 输出解读

tests/test_xxx.py::TestXxx::test_method PASSED    → 通过
tests/test_xxx.py::TestXxx::test_method FAILED    → 失败(需分析)
tests/test_xxx.py::TestXxx::test_method ERROR     → fixture/setup 异常
tests/test_xxx.py::TestXxx::test_method SKIPPED   → 跳过

失败分类与处理

拿到失败输出后按症状查表,对号入座 → references/failure-triage.md

结果摘要模板

向用户汇报运行结果时套用 → references/report-template.md

Version History

  • f4b02f4 Current 2026-09-22 06:55

    重构 skill 结构,将失败分类对照表与摘要模板移至 references 目录以实现渐进式披露,精简正文内容。

  • 6d28887 2026-07-05 20:21

Same Skill Collection

skills/add-regression-point/SKILL.md
skills/architecture/SKILL.md
skills/browser-config/SKILL.md
skills/case-round-trip/SKILL.md
skills/gen-page-test/SKILL.md
skills/locator-replacer/SKILL.md
skills/page-load-assertion/SKILL.md
skills/quick-debug/SKILL.md
skills/save-verify-strategy/SKILL.md
skills/selector-self-heal/SKILL.md
zh/skills/add-regression-point/SKILL.md
zh/skills/architecture/SKILL.md
zh/skills/browser-config/SKILL.md
zh/skills/case-round-trip/SKILL.md
zh/skills/gen-page-test/SKILL.md
zh/skills/locator-replacer/SKILL.md
zh/skills/page-load-assertion/SKILL.md
zh/skills/quick-debug/SKILL.md
zh/skills/save-verify-strategy/SKILL.md
zh/skills/test-runner/SKILL.md
en/skills/SKILL.md
skills/code-review-graph/SKILL.md
skills/SKILL.md
skills/wait-strategy/SKILL.md
zh/skills/code-review-graph/SKILL.md
zh/skills/SKILL.md
zh/skills/wait-strategy/SKILL.md

Metadata

Files
0
Version
f4b02f4
Hash
acc9f322
Indexed
2026-07-05 20:21

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-29 06:31
浙ICP备14020137号-1