umbraco-skill-test-runner
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSkill Test Runner
Skill Test Runner
Runs all tests from skill examples (unit, mocked, E2E) and outputs a JSON report.
运行技能示例中的所有测试(单元测试、模拟测试、E2E测试)并输出JSON报告。
Usage
使用方法
bash
cd .claude/skills/umbraco-skill-test-runner/scripts
npm install --silent
npx tsx run-tests.tsbash
cd .claude/skills/umbraco-skill-test-runner/scripts
npm install --silent
npx tsx run-tests.tsTest Types
测试类型
| Type | Description | Runner |
|---|---|---|
| Unit | Component tests with | Web Test Runner |
| Mocked | Integration tests against mocked backoffice | Playwright |
| E2E | Full end-to-end against real Umbraco | Playwright |
| 类型 | 描述 | 运行器 |
|---|---|---|
| 单元测试 | 使用 | Web Test Runner |
| 模拟测试 | 针对模拟后台的集成测试 | Playwright |
| E2E | 针对真实Umbraco的完整端到端测试 | Playwright |
Environment Variables
环境变量
| Variable | Default | Description |
|---|---|---|
| - | Admin email for E2E authentication |
| - | Admin password for E2E authentication |
| | Umbraco instance URL |
| 变量 | 默认值 | 描述 |
|---|---|---|
| - | E2E认证使用的管理员邮箱 |
| - | E2E认证使用的管理员密码 |
| | Umbraco实例地址 |
Auto-Start Umbraco
自动启动Umbraco
If E2E tests are needed and Umbraco is not running, the script will automatically:
- Start Umbraco from using
./Umbraco-CMS.Skills/dotnet run - Wait for the instance to be ready
- Run E2E tests
- Stop Umbraco when done (if it was started by the script)
如果需要运行E2E测试且Umbraco未启动,脚本将自动执行以下操作:
- 使用从
dotnet run启动Umbraco./Umbraco-CMS.Skills/ - 等待实例就绪
- 运行E2E测试
- 测试完成后停止Umbraco(如果是由脚本启动的)
Output
输出结果
Generates in the project root with structure:
test-report.jsonjson
{
"timestamp": "2024-12-26T12:00:00Z",
"umbracoStarted": true,
"summary": {
"total": 10,
"passed": 8,
"failed": 1,
"skipped": 1
},
"results": [
{
"example": "counter-dashboard",
"path": "plugins/umbraco-testing-skills/.../counter-dashboard",
"type": "unit",
"status": "passed",
"duration": 1234
}
]
}在项目根目录生成,结构如下:
test-report.jsonjson
{
"timestamp": "2024-12-26T12:00:00Z",
"umbracoStarted": true,
"summary": {
"total": 10,
"passed": 8,
"failed": 1,
"skipped": 1
},
"results": [
{
"example": "counter-dashboard",
"path": "plugins/umbraco-testing-skills/.../counter-dashboard",
"type": "unit",
"status": "passed",
"duration": 1234
}
]
}Integration
集成
This skill is Phase 3 of the command, running after:
validate-skills- Link validation ()
umbraco-skill-validator - Code analysis ()
umbraco-skill-code-analyzer
该技能是命令的第三阶段,在以下步骤之后运行:
validate-skills- 链接验证()
umbraco-skill-validator - 代码分析()
umbraco-skill-code-analyzer