Help us improve
Share bugs, ideas, or general feedback.
From velocitai
Runs pytest test suites with Allure reporting and structurally analyzes failures by type (locator, timeout, assertion, auth). Prompts for environment confirmation and offers fix workflow.
npx claudepluginhub danielsuo117/velocitai --plugin velocitaiHow this skill is triggered — by the user, by Claude, or both
Slash command
/velocitai:test-runnerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> **⚠️ 运行前必须向用户确认 `--env`**(见 [agent-behavior.md](../../rules/agent-behavior/agent-behavior.md) P0.2)。
Investigates and fixes failing Playwright E2E tests using captured action data, screenshots, DOM snapshots, network requests, and console output.
Generates and executes E2E tests from specs/Gherkin with auto-fix loop that fixes application code (not tests) via sub-agents.
Diagnoses failing E2E tests to determine if failure is a code bug or test issue. Use when user says "test or bug", "is this a test issue", "why is this test failing", "diagnose test failure", "debug e2e", or "analyze failing test".
Share bugs, ideas, or general feedback.
⚠️ 运行前必须向用户确认
--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)运行。
场景: 替换定位符后验证、调试单个页面回归点
# 对应角色
pytest tests/<role>/test_<role>_flow.py --env=<pre|prod> -v -k "test_xxx"
# 对应角色
pytest tests/<role>/test_<role>_home.py --env=<pre|prod> -v -k "test_<case_name>"
场景: 发版前验证、完整回归
# <角色A>全量
pytest tests/<roleA>/ --env=<pre|prod>
# <角色B>全量
pytest tests/<roleB>/ --env=<pre|prod>
# 全量
pytest 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 → 跳过
运行失败后,按以下分类诊断:
特征:
TimeoutError: Timeout 10000ms exceeded.
waiting for locator("text=<功能名>")
处理: 触发 locator-replacer skill,使用 agent-browser 访问真实页面重新抽取定位符(工具选型遵循 agent-behavior P0.4)。
特征:
TimeoutError: page.wait_for_load_state: Timeout 30000ms exceeded.
waiting for "networkidle"
处理:
DEFAULT_TIMEOUT(临时措施)特征:
AssertionError: <页面中文名>加载失败
assert False
处理:
PAGE_IDENTIFIER 定位符是否仍然有效特征:
AssertionError: Token 登录失败
处理:
config/settings.py 中的 token 是否有效--env 参数是否选对当失败需要深入排查时(定位符失效、页面结构变化等),建议进入 quick-debug 模式:通过 token 免登直接跳转到问题页面,避免从登录重走完整流程。
运行完成后,按以下格式输出摘要:
## 测试运行摘要
**运行模式:** 单个 story / 主流程全量
**环境:** pre / prod
**时间:** 2026-04-15 15:30
### 结果
| 状态 | 数量 |
|------|------|
| PASSED | X |
| FAILED | X |
| ERROR | X |
| SKIPPED | X |
### 失败详情(如有)
| 测试用例 | 失败类型 | 原因 | 建议操作 |
|----------|---------|------|---------|
| test_xxx | A: 定位符失效 | text=xxx 不唯一 | 使用 locator-replacer |
| test_yyy | D: 认证失败 | token 过期 | 更新 settings.py |