AgentHubAgentHub

使用场景/测试与质量保障

测试自动化 MCP / Skill 推荐

单元测试、E2E、测试用例生成与执行。适合 QA 与持续交付团队。

共匹配 1,118 个资源 · 第 3 / 24 页

什么是测试与质量保障?

测试与 QA 场景里,MCP + Skill 的组合覆盖三类工作:让 AI 读源码补齐单元测试并跑通(配合 Filesystem / Test Runner 类 MCP)、让 AI 操作浏览器执行 E2E 回归(Playwright MCP)、让 AI 分析 CI 失败日志并给出修复建议(GitHub MCP 拉取构建记录)。

相比手写脚本,AI 生成测试的价值在于覆盖边界条件与维护速度:需求变更后让 AI 同步修改用例。建议要求 AI 先输出测试计划再产出代码,人工确认断言方向后执行,避免「测试迁就实现」的假阳性。

落地次序:从变更最频繁的模块开始补覆盖 → 把测试命令暴露为 MCP 工具让 AI 自主「改-跑-修」循环 → 在 CI 中固化回归集。

适合做什么

  • 补测试覆盖
  • 回归用例生成
  • CI 失败分析
  • 性能基线对比

不太适合

  • 替代专业性能压测平台
  • 未隔离环境的破坏性测试

相关资源

查看全部 →

添加 E2E 选择器 add-e2e-selectors

SkillSkillsMP

为 Grafana 前端的交互元素和关键容器添加可靠的 @grafana/e2e-selectors。为 React 组件添加 e2e 选择器、data-testid 或测试选择器,或文件和组件缺少测试选择器、需要让元素可测试时使用。收到 Grafana Pathfinder 交互指南(guide 目录或 content.json)要求审计修复时也可用——它会提取指南的 reftarget 选择器,识别薄弱项并在 Grafana 的 JSX 源头修复。在 e2e-selectors 包中定义版本化选择器并把 data-testid 接入 JSX。接受文件路径、目标列表、目录、pathfinder 指南或当前打开的文件。

source

unit-tests

SkillSkillsMP

Use when writing, reviewing, speeding up, or fixing a flaky `bun test` unit test in any package (core, cli, server, ai, codemode, util, client, sdk, plugin, http-recorder, merman, app src and test-browser, desktop, gui-plugins, ui, session-ui, latex, ...), except OpenTUI renderer tests (see tui-tests). Also use when a test "timed out after 5000ms" on Windows CI, fails only on Windows, when the unit job is slow, when adding cli subprocess or service tests, or when adding a package's test task to turbo.json. Covers controlling time instead of sleeping, per-test timeouts, process and git spawn cost on Windows, Windows-only failures, temp dirs and process state, leaks between files, and reading CI timeouts.

source

ui-tests-local-vm

SkillSkillsMP

Run PowerToys UITest.Next suites in persistent Hyper-V VMs over PowerShell Direct. Validate full default and constrained suites on Windows 10 and Windows 11, plus applicable ARM64 guests, then automatically hand implementation tasks to ui-tests-pipeline-ci for commit/push and CI validation. Local green is not end-to-end completion. Use for agentic UI-test iteration, reusable standard-user desktops, payload staging, evidence export, VM customization, clean baselines, or hosts without nested virtualization. Keywords: Hyper-V, local VM, virtual machine, PowerShell Direct, Copy-VMFile, VMBus, checkpoint, unattend, autounattend, ISO, Windows 10 LTSC, Windows 11, ARM64, Windows on ARM, UI tests, UITest.Next, winappcli, TRX, CI handoff.

source

web-gui-tester

SkillSkillsMP

Use the browser automation tooling available in the session to test web frontends interactively in a purely GUI-based, black-box manner: simulate real user clicks, text input, scrolling, and other actions; use screenshots for visual verification and read-only DOM inspection for cross-validation; and produce a final test report. Suitable for verifying whether web functionality works correctly, reproducing frontend bugs, checking interaction feedback and layout styling, or conducting exploratory testing of a page. Use this skill when the user asks to test a webpage/frontend feature, verify UI behavior, reproduce a page bug, or provides only a URL and asks you to "test it."

source

app-e2e-tests

SkillSkillsMP

Use when writing, changing, reviewing, or debugging Playwright e2e tests in packages/app/e2e (regression keepers and user stories). Covers the mocked opencode server harness and the Bun static server, per-test isolation, page-load and route cost, the suite-wide service-worker block, races with first mount, hover, measurement, clock, dialogs and shortcuts, projects, shards and worker scheduling, rehearsing Windows timing locally, and diagnosing a CI flake from its artifacts. Not for Storybook component tests or e2e/performance benchmarks.

source

tui-tests

SkillSkillsMP

Use when writing, fixing, or reviewing tests that render OpenTUI (testRender, createTestRenderer, createAppFixture) in packages/tui or packages/cli. Covers frame waits (waitForFrame, waitFor, waitForVisualIdle, flush), started vs non-started renderers, injected clocks, mock keyboard and mouse input, terminal sizes, cleanup and shared paths, and the 30s budget. Also use when a TUI test fails with "Timed out waiting for frame predicate after N passes", or when a tui test file is slow. For cli subprocess and service tests, use the unit-tests skill.

source

test-collaboration

SkillSkillsMP

Inventory and govern a project's test assets. Connect requirements, business rules, risks, bugs, and cross-boundary contracts to stable TEST-IDs and executable evidence in the repository's existing test registry or TESTS.md. Use for test inventory, test gap analysis, unit/integration/contract/E2E/smoke classification, bug-to-test regression protection, consumer/provider contract testing, test-necessity review, and pre-delivery evidence review.

source

test-collaboration

SkillSkillsMP

Inventory and govern a project's test assets. Connect requirements, business rules, risks, bugs, and cross-boundary contracts to stable TEST-IDs and executable evidence in the repository's existing test registry or TESTS.md. Use for test inventory, test gap analysis, unit/integration/contract/E2E/smoke classification, bug-to-test regression protection, consumer/provider contract testing, test-necessity review, and pre-delivery evidence review.

source

PowerToys UI 测试迁移

SkillSkillsMP

将 PowerToys UI 测试从 WinAppDriver/Selenium 迁移并稳定到 Microsoft.PowerToys.UITest.Next 与 winappcli。适用于移植、新建 UITest 工程、CI flaky 测试、本地 Hyper-V 虚拟机持续验证、可重置的干净基线运行、Settings IPC 鉴权/测试签名、Explorer/Shell 选择、预览 handler、缩略图提供程序、快捷键激活、有状态进程生命周期、WinUI/WebView 合成视觉基线,以及跨窗口/前台失焦问题。涵盖 API、脚手架、测试设计、诊断、agent 化执行与 CI 加固。关键词:UI test、UITestAutomation.Next、winappcli、WinAppDriver、Selenium、Settings IPC、Authenticode、local VM、Hyper-V、checkpoint、flaky、CI stability、WebView2。

source

agent-host-e2e-tests(Agent Host 端到端测试)

SkillSkillsMP

在编写、录制、更新、验证或排查 src/vs/platform/agentHost/test/node/e2e 下的 agent host 端到端测试时使用(这些黑盒测试通过 AHP 协议驱动整个 agent host,并借助 CapiReplayProxy 的录制/回放系统对接 Claude/Copilot/Codex)。涵盖新增跨提供方测试、SDK 升级后重新录制 fixture、跨平台 Azure 验证、对非确定性或平台相关测试加门禁,以及诊断回放缓存未命中。

source

durable-test-collateral

SkillSkillsMP

Load the body before the first implementation edit for a bug fix or behavior change, or when the user or governing specification makes reusable tests a deliverable. It keeps the smallest focused test with the delivered project and updates coverage when behavior changes. Do not load for greenfield work unless reusable tests are explicitly required, behavior-preserving refactors, verification-only work, plan/review/explanation/documentation/formatting/generated-output-only work, explicit no-change or no-tool work, or when the user declines tests.

source

常见问题

AI 生成的测试可靠吗?

取决于约束方式:提供测试规范 Skill、要求先计划后编码、并在 CI 中真实执行,通过率与断言质量会显著改善。关键业务路径仍需人工评审断言。

E2E 测试必须用浏览器自动化 MCP 吗?

不一定。AI 可以直接生成 Playwright / Cypress 测试代码交给 CI 执行;浏览器 MCP 的价值在于让 AI 即时观察页面、调试选择器。

能让 AI 自己跑测试自己修吗?

可以,把「运行测试并返回结果」做成 MCP 工具即可形成闭环。建议限制循环次数并保留人工终审,防止过拟合式修复。

配套安装与配置教程

相关场景