umbraco-testing by umbraco/umbraco-cms-backoffice-skills
npx skills add https://github.com/umbraco/umbraco-cms-backoffice-skills --skill umbraco-testing用于测试 Umbraco 后台扩展的入口点。使用此技能来确定应使用哪种测试方法,然后调用相应的专业测试技能。
| 级别 | 技能 | 使用场景 |
|---|---|---|
| 1 | umbraco-unit-testing | 隔离测试上下文、元素、控制器 |
| 2 | umbraco-msw-testing | 测试 API 错误处理、加载状态 |
| 3 | umbraco-mocked-backoffice | 在完整后台中测试扩展 UI(无需 .NET) |
| 4 | umbraco-e2e-testing | 针对真实 Umbraco 测试完整工作流 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 技能 | 用途 |
|---|---|
umbraco-test-builders | 用于测试数据的 JsonModels.Builders |
umbraco-playwright-testhelpers | 测试辅助工具的完整 API 参考 |
umbraco-example-generator | 生成可测试的示例扩展 |
umbraco-unit-testing)最适合快速、隔离的测试:
速度 : 毫秒级 | 后端 : 无需 | 浏览器 : Playwright 启动器
umbraco-msw-testing)最适合测试无需后端的 API 行为:
速度 : 快速 | 后端 : 无需(模拟) | 浏览器 : Playwright
umbraco-mocked-backoffice)最适合在逼真的 UI 中测试扩展:
速度 : 快速 | 后端 : 无需(MSW) | 浏览器 : Chromium
umbraco-e2e-testing)最适合完整的验收测试:
速度 : 较慢 | 后端 : 运行中的 Umbraco | 浏览器 : Chromium
umbraco-test-builders一个经过充分测试的扩展会使用多个测试级别。以下是完整的金字塔结构:
┌─────────────┐
│ 端到端测试 │ ← 真实后端,完整工作流
│ (7 个测试) │
└─────────────┘
┌─────────────────────────┐
│ 模拟后台测试 │ ← 无后端,逼真 UI
│ MSW: 6 | 模拟仓库: 6 │
└─────────────────────────┘
┌─────────────────────────────────────┐
│ 单元测试 │ ← 快速,隔离
│ (13 个测试) │
└─────────────────────────────────────┘
| 级别 | 测试数量 | 速度 | 需要后端 |
|---|---|---|---|
| 单元测试 | 13 | ~1秒 | 无需 |
| MSW 模拟测试 | 6 | ~30秒 | 无需(MSW) |
| 模拟仓库测试 | 6 | ~37秒 | 无需 |
| 端到端测试 | 7 | ~15秒 | 真实 Umbraco |
| 总计 | 32 |
tree-example 在一个项目中展示了所有测试方法:
cd /path/to/tree-example/Client
# 单元测试(快速,无需服务器)
npm test # 13 个测试,~1秒
# MSW 模拟测试(需要模拟后台)
npm run test:mocked:msw # 6 个测试,~30秒
# 模拟仓库测试(需要模拟后台)
npm run test:mocked:repo # 6 个测试,~37秒
# 端到端测试(需要真实 Umbraco)
URL=https://localhost:44325 \
UMBRACO_USER_LOGIN=admin@example.com \
UMBRACO_USER_PASSWORD=yourpassword \
npm run test:e2e # 7 个测试,~15秒
位置 : umbraco-backoffice/examples/tree-example/Client/
Umbraco-CMS 仓库包含大量的测试示例:
| 类型 | 位置 |
|---|---|
| 单元测试 | src/Umbraco.Web.UI.Client/examples/*/ |
| MSW 处理器 | src/Umbraco.Web.UI.Client/src/mocks/handlers/ |
| 端到端测试 | tests/Umbraco.Tests.AcceptanceTest/tests/ |
| 扩展 | src/Umbraco.Web.UI.Client/examples/ (27 个示例) |
| 完整金字塔 | umbraco-backoffice/examples/tree-example/Client/ |
每周安装次数
69
仓库
GitHub 星标数
17
首次出现
2026年2月4日
安全审计
安装于
github-copilot50
codex20
opencode19
cursor18
gemini-cli17
amp17
Entry point for testing Umbraco backoffice extensions. Use this skill to determine which testing approach to use, then invoke the appropriate specialized skill.
| Level | Skill | Use When |
|---|---|---|
| 1 | umbraco-unit-testing | Testing contexts, elements, controllers in isolation |
| 2 | umbraco-msw-testing | Testing API error handling, loading states |
| 3 | umbraco-mocked-backoffice | Testing extension UI in full backoffice (no .NET) |
| 4 | umbraco-e2e-testing | Testing complete workflows against real Umbraco |
| Skill | Purpose |
|---|---|
umbraco-test-builders | JsonModels.Builders for test data |
umbraco-playwright-testhelpers | Full API reference for testhelpers |
umbraco-example-generator | Generate testable example extensions |
umbraco-unit-testing)Best for fast, isolated testing:
Speed : Milliseconds | Backend : None | Browser : Playwright launcher
umbraco-msw-testing)Best for testing API behavior without backend:
Speed : Fast | Backend : None (mocked) | Browser : Playwright
umbraco-mocked-backoffice)Best for testing extensions in realistic UI:
Speed : Fast | Backend : None (MSW) | Browser : Chromium
umbraco-e2e-testing)Best for full acceptance testing:
Speed : Slower | Backend : Running Umbraco | Browser : Chromium
umbraco-test-builders if neededA well-tested extension uses multiple testing levels. Here's the complete pyramid:
┌─────────────┐
│ E2E Tests │ ← Real backend, complete workflows
│ (7 tests) │
└─────────────┘
┌─────────────────────────┐
│ Mocked Backoffice │ ← No backend, realistic UI
│ MSW: 6 | Mock Repo: 6 │
└─────────────────────────┘
┌─────────────────────────────────────┐
│ Unit Tests │ ← Fast, isolated
│ (13 tests) │
└─────────────────────────────────────┘
| Level | Tests | Speed | Backend Required |
|---|---|---|---|
| Unit | 13 | ~1s | None |
| MSW Mocked | 6 | ~30s | None (MSW) |
| Mock Repository | 6 | ~37s | None |
| E2E | 7 | ~15s | Real Umbraco |
| Total | 32 |
The tree-example demonstrates all testing approaches in one project:
cd /path/to/tree-example/Client
# Unit tests (fast, no server)
npm test # 13 tests, ~1s
# MSW mocked tests (requires mocked backoffice)
npm run test:mocked:msw # 6 tests, ~30s
# Mock repository tests (requires mocked backoffice)
npm run test:mocked:repo # 6 tests, ~37s
# E2E tests (requires real Umbraco)
URL=https://localhost:44325 \
UMBRACO_USER_LOGIN=admin@example.com \
UMBRACO_USER_PASSWORD=yourpassword \
npm run test:e2e # 7 tests, ~15s
Location : umbraco-backoffice/examples/tree-example/Client/
The Umbraco-CMS repository contains extensive test examples:
| Type | Location |
|---|---|
| Unit tests | src/Umbraco.Web.UI.Client/examples/*/ |
| MSW handlers | src/Umbraco.Web.UI.Client/src/mocks/handlers/ |
| E2E tests | tests/Umbraco.Tests.AcceptanceTest/tests/ |
| Extensions | src/Umbraco.Web.UI.Client/examples/ (27 examples) |
| Complete pyramid | umbraco-backoffice/examples/tree-example/Client/ |
Weekly Installs
69
Repository
GitHub Stars
17
First Seen
Feb 4, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykPass
Installed on
github-copilot50
codex20
opencode19
cursor18
gemini-cli17
amp17
测试策略完整指南:单元/集成/E2E测试金字塔与自动化实践
11,200 周安装