umbraco-skill-test-runner

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Skill 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.ts
bash
cd .claude/skills/umbraco-skill-test-runner/scripts
npm install --silent
npx tsx run-tests.ts

Test Types

测试类型

TypeDescriptionRunner
UnitComponent tests with
@open-wc/testing
Web Test Runner
MockedIntegration tests against mocked backofficePlaywright
E2EFull end-to-end against real UmbracoPlaywright
类型描述运行器
单元测试使用
@open-wc/testing
进行的组件测试
Web Test Runner
模拟测试针对模拟后台的集成测试Playwright
E2E针对真实Umbraco的完整端到端测试Playwright

Environment Variables

环境变量

VariableDefaultDescription
UMBRACO_USER_LOGIN
-Admin email for E2E authentication
UMBRACO_USER_PASSWORD
-Admin password for E2E authentication
UMBRACO_URL
https://localhost:44325
Umbraco instance URL
变量默认值描述
UMBRACO_USER_LOGIN
-E2E认证使用的管理员邮箱
UMBRACO_USER_PASSWORD
-E2E认证使用的管理员密码
UMBRACO_URL
https://localhost:44325
Umbraco实例地址

Auto-Start Umbraco

自动启动Umbraco

If E2E tests are needed and Umbraco is not running, the script will automatically:
  1. Start Umbraco from
    ./Umbraco-CMS.Skills/
    using
    dotnet run
  2. Wait for the instance to be ready
  3. Run E2E tests
  4. Stop Umbraco when done (if it was started by the script)
如果需要运行E2E测试且Umbraco未启动,脚本将自动执行以下操作:
  1. 使用
    dotnet run
    ./Umbraco-CMS.Skills/
    启动Umbraco
  2. 等待实例就绪
  3. 运行E2E测试
  4. 测试完成后停止Umbraco(如果是由脚本启动的)

Output

输出结果

Generates
test-report.json
in the project root with structure:
json
{
  "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.json
,结构如下:
json
{
  "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
validate-skills
command, running after:
  1. Link validation (
    umbraco-skill-validator
    )
  2. Code analysis (
    umbraco-skill-code-analyzer
    )
该技能是
validate-skills
命令的第三阶段,在以下步骤之后运行:
  1. 链接验证(
    umbraco-skill-validator
  2. 代码分析(
    umbraco-skill-code-analyzer