/test-execution
测试执行方法,包含测试框架检测、测试运行、结果解析
$ npx -y skills add echoVic/boss-skill --skill test-execution --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/test-execution
Context preview
The summary Claude sees to decide when to auto-load this skill.
测试执行方法,包含测试框架检测、测试运行、结果解析
SKILL.md
test-execution.SKILL.mdname: qa/test-execution
description: 测试执行方法,包含测试框架检测、测试运行、结果解析
version: 1.0.0
agent: qa
type: methodology
user-invocable: false
agent-invocable: true
dependencies:
- shared/tech-stack-detection
triggers:
- 需要执行测试时
- 需要验证测试覆盖率时
测试执行方法
强制要求:真实执行测试
**你必须真正执行测试,禁止生成 Mock 数据!**
测试执行流程
1. **检测项目类型和测试框架** 2. **根据项目类型执行测试** 3. **执行 E2E / 集成测试** 4. **解析测试输出**(总数、通过数、失败数、覆盖率)
测试框架检测
JavaScript/TypeScript
- Jest: `jest.config.js`, `"jest"` in package.json
- Vitest: `vitest.config.js`, `"vitest"` in package.json
- Playwright: `playwright.config.js`
- Cypress: `cypress.json`
Python
- pytest: `pytest.ini`, `"pytest"` in dependencies
- unittest: 内置
Go
- `*_test.go` 文件
测试命令
| 语言 | 单元测试 | E2E测试 | |------|----------|---------| | Node.js | `npm test` | `npx playwright test` | | Python | `pytest` | `pytest tests/e2e` | | Go | `go test ./...` | - |
Playwright E2E 执行细节
> **完整方法论**:详见 `Skill(skill: "qa/e2e-playwright")`
检测 Playwright 项目
检查以下标志确认项目使用 Playwright:
- `playwright.config.ts` 或 `playwright.config.js` 存在
- `package.json` 中包含 `@playwright/test` 依赖
- `e2e/` 或 `tests/e2e/` 目录存在
执行命令
# 安装浏览器(首次或 CI 环境)
npx playwright install --with-deps
# 运行全部 E2E 测试
npx playwright test
# 仅 critical 标签(门禁加速)
npx playwright test --grep @critical
# 指定浏览器
npx playwright test --project=chromium
# JSON 报告(门禁解析用)
npx playwright test --reporter=json
结果解析
Playwright JSON 报告关键字段:
| 字段 | 说明 | |------|------| | `stats.expected` | 通过的测试数 | | `stats.unexpected` | 失败的测试数 | | `stats.flaky` | 重试后通过的测试数 | | `stats.skipped` | 跳过的测试数 |
失败排查
# 查看 trace(失败时自动生成)
npx playwright show-trace <trace.zip路径>
# 打开 HTML 报告
npx playwright show-report
Read more
name: qa/test-execution description: 测试执行方法,包含测试框架检测、测试运行、结果解析 version: 1.0.0 agent: qa type: methodology user-invocable: false agent-invocable: true dependencies: - shared/tech-stack-detection triggers: - 需要执行测试时 - 需要验证测试覆盖率时
测试执行方法
强制要求:真实执行测试
**你必须真正执行测试,禁止生成 Mock 数据!**
测试执行流程
1. **检测项目类型和测试框架** 2. **根据项目类型执行测试** 3. **执行 E2E / 集成测试** 4. **解析测试输出**(总数、通过数、失败数、覆盖率)
测试框架检测
JavaScript/TypeScript
- Jest: `jest.config.js`, `"jest"` in package.json
- Vitest: `vitest.config.js`, `"vitest"` in package.json
- Playwright: `playwright.config.js`
- Cypress: `cypress.json`
Python
- pytest: `pytest.ini`, `"pytest"` in dependencies
- unittest: 内置
Go
- `*_test.go` 文件
测试命令
| 语言 | 单元测试 | E2E测试 | |------|----------|---------| | Node.js | `npm test` | `npx playwright test` | | Python | `pytest` | `pytest tests/e2e` | | Go | `go test ./...` | - |
Playwright E2E 执行细节
> **完整方法论**:详见 `Skill(skill: "qa/e2e-playwright")`
检测 Playwright 项目
检查以下标志确认项目使用 Playwright:
- `playwright.config.ts` 或 `playwright.config.js` 存在
- `package.json` 中包含 `@playwright/test` 依赖
- `e2e/` 或 `tests/e2e/` 目录存在
执行命令
# 安装浏览器(首次或 CI 环境) npx playwright install --with-deps # 运行全部 E2E 测试 npx playwright test # 仅 critical 标签(门禁加速) npx playwright test --grep @critical # 指定浏览器 npx playwright test --project=chromium # JSON 报告(门禁解析用) npx playwright test --reporter=json
结果解析
Playwright JSON 报告关键字段:
| 字段 | 说明 | |------|------| | `stats.expected` | 通过的测试数 | | `stats.unexpected` | 失败的测试数 | | `stats.flaky` | 重试后通过的测试数 | | `stats.skipped` | 跳过的测试数 |
失败排查
# 查看 trace(失败时自动生成) npx playwright show-trace <trace.zip路径> # 打开 HTML 报告 npx playwright show-report
Boss is an auditable agent-team workflow for coding agents. It turns one coding agent into a structured engineering team: PM, Architect, UI Designer, Tech Lead, Scrum Master, Frontend, Backend, QA, and DevOps.
Repo: echoVic/boss-skill
Other skills on boss.
- /architecture-design
系统架构设计方法论,包含架构模式选择、系统分层、目录结构设计
Open skill - /data-api-design
数据模型和API设计方法论,包含ERD设计、数据字典、RESTful API规范
Open skill - /tech-research
技术调研方法论,通过系统性调研和对比分析,为技术选型提供数据支持
Open skill - /api-development
后端API开发方法论,包括RESTful/GraphQL设计、请求验证、错误处理和安全实现
Open skill - /testing-guide
后端测试编写指南,包括单元测试、集成测试和E2E测试的编写方法和最佳实践
Open skill - /brainstorming
需求澄清 Skill。当用户只给了模糊描述时自动触发,通过业务提问把一句话翻译成完整需求,交给 Boss 流水线执行。 Triggers: '我想做一个', '帮我做', '有个想法', 'brainstorm', '帮我规划一下', '做个XX', 'I want to build' Does NOT trigger: - 需求已经完整(包含做什么 + 给谁用 + 核心场景) - 纯技术问题或 bug 修复 Output: .boss/<feature>/design-brief.md 需求设计简报
Open skill

