add-regression-point
为已有 PageObject 增量添加回归测试点。触发:新增测试点、添加回归点、add test point、增加覆盖、扩展页面方法。
运行 pytest + 结构化分析失败原因。触发:运行测试、跑测试、run test、pytest、失败分析、allure。
$ npx -y skills add danielsuo117/velocitai --skill test-runner --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/test-runnerContext preview
The summary Claude sees to decide when to auto-load this skill.
运行 pytest + 结构化分析失败原因。触发:运行测试、跑测试、run test、pytest、失败分析、allure。
name: test-runner description: 运行 pytest + 结构化分析失败原因。触发:运行测试、跑测试、run test、pytest、失败分析、allure。
> **⚠️ 运行前必须向用户确认 `--env`**(见 [agent-behavior.md](../../rules/agent-behavior/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)运行。
**场景:** 替换定位符后验证、调试单个页面回归点
# 对应角色 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>"
**场景:** 发版前验证、完整回归
# <角色A>全量 pytest framework/tests/<roleA>/ --env=<pre|prod> # <角色B>全量 pytest framework/tests/<roleB>/ --env=<pre|prod> # 全量 pytest framework/tests/ --env=<pre|prod>
# 启动报告服务器查看(运行完测试后直接可用) allure serve reports/allure-results # 生成静态报告(可部署) allure generate reports/allure-results -o reports/allure-report --clean
---
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/failure-triage.md)
向用户汇报运行结果时套用 → [references/report-template.md](./references/report-template.md)
Next-generation UI automation harness powered by Python & Playwright. Chat with AI Agents to seamlessly generate, architect, and execute enterprise-grade UI test code.
为已有 PageObject 增量添加回归测试点。触发:新增测试点、添加回归点、add test point、增加覆盖、扩展页面方法。
浏览器 viewport / headless / 超时分层配置。触发:viewport、浏览器配置、导航超时、headless、slow_mo、incognito。
共享 page 下用例离开起点后必须 UI 返回并断言。触发:往返闭合、case round trip、复位超时、scope 共享 page。
一键生成 PageObject + 配套测试。触发:新增页面、生成页面、gen page、create page、添加页面对象。