← 返回列表
全部 Skill›工具 Tools›ui-tests-migration

ui-tests-migration

作者 @microsoft · 语言 en
Create and stabilize PowerToys UI suites using the existing Microsoft.PowerToys.UITest.Next framework and winappcli. Use for new UITest projects, flaky CI, Settings IPC and signing, Explorer/Shell selection, preview and thumbnail handlers, hotkeys, foreground ownership, and WinUI/WebView visual assertions. Covers test design, Hyper-V validation and the required CI handoff. WinAppDriver/Selenium migration guidance is historical and applies only to older branches that still contain the legacy framework.
工具 Tools自动化工具通用待翻译
最近源活动
—
检测 SKILL.md 语言
en
星标 ★
141,354
分支 Fork
0
安装选项
提示
指令
使用 AI 助手安装
将下面的提示复制到你正在使用的 AI 助手中。
下载完整 Skill 目录(含全部配套文件)。 下载压缩包 ↓
SKILL.md 原文预览

PowerToys UI-Tests Migration (legacy → .Next)

Legacy retirement: main no longer contains src/common/UITestAutomation or its test
projects. Use the existing .Next suites and Scenario B for current development. Scenario A
and the legacy comparisons in this skill are historical guidance for older branches; do not
restore the retired framework or tests. Existing .Next project names remain unchanged.

Convert a PowerToys module's UI tests from the legacy WinAppDriver / Selenium / Appium harness

(Microsoft.PowerToys.UITest, in src/common/UITestAutomation/) to the new winappcli harness

(Microsoft.PowerToys.UITest.Next, in src/common/UITestAutomation.Next/).

The new harness shells out to winapp.exe and parses its JSON — **no WinAppDriver server on :4723,

no Selenium/Appium NuGet packages, no WindowsElement/WindowsDriver.** The public *shape*

(UITestBase, Session, Find<T>, By, element wrappers like ToggleSwitch) is deliberately

similar, so most of the work is mechanical API mapping plus reworking a few patterns that don't

translate one-to-one (XPath selectors, stateful elements, instance mouse/keyboard helpers).

When to use this skill

Use this skill when the task is to:

  • Port a module's existing legacy UI tests to .Next (e.g. "migrate the ScreenRuler UI tests to

the new framework", "convert FancyZones.UITests to winappcli").

  • Create a new [Module].UITests.Next project that re-implements the legacy tests with the new

harness, leaving the old project in place.

  • Stand up brand-new .Next UI tests for a module that has no UI tests at all, by reading the

module's human test sign-off markdown (e.g. ColorPickerUITest.md) and turning each manual

checklist item into an automated test.

  • Validate a new or migrated suite in a local Windows VM through an unattended

build/package/deploy/run/TRX/diagnose loop. Use a retained VM for fast iteration and a restored

baseline checkpoint when clean-profile behavior matters.

This skill is the *how*: the framework differences, the API mapping, the project scaffolding, the

naming rules, the recurring PowerToys test recipes, and the build/validate loop. The *what* (which

module, which tests) comes from the calling prompt.

End-to-end completion contract

A request to create, migrate, or stabilize UI tests includes the complete delivery loop:

implement -> build -> full local VM matrix -> commit and push -> scoped CI -> terminal results.

Local success is a handoff, not completion. After the full default and constrained suites pass,

invoke ui-tests-pipeline-ci automatically; do not wait for a

separate "push" or "run CI" request. Keep commit/push and CI validation as open TODOs from the start.

Respect an explicit local-only/no-push/no-CI request. A read-only investigation, VM setup, or request

to run an existing suite locally does not authorize publishing changes. CI remains Microsoft

FTE-only and requires the pipeline skill's successful access preflight; report an exact blocker

when unavailable, never call local-only evidence CI-validated. The pipeline skill owns publication,

queueing, synchronous waiting, and the three-run stabilization limit.

Reference implementation — read these working examples before porting anything. They are
the ground truth for "what good looks like" with each harness:
- New (.Next): ColorPickerEndToEndTests.cs
— full end-to-end scenario (navigate Settings → toggle module → read shortcut → fire hotkey →
read overlay → click-capture → inspect editor), driven entirely through winappcli.
- Worked Scenario-A port (validated 5/5): the
ScreenRuler suite ported from the retired legacy project lives in
ScreenRuler.UITests.Next/TestHelper.cs
+ 5 test classes. It is the canonical port reference — cross-window toolbar discovery via
Session.FromProcess, a DPI-aware app.manifest, cursor centering, and patient hotkey
activation are all there because real runs needed them (see
references/patterns-and-pitfalls.md).
- Stateful/visual reference (validated 15/15 across Win10 x64, Win11 x64, and ARM64):
PeekFilePreviewTests.cs
demonstrates stable Explorer Shell selection, toggle-hotkey activation, process-preserving
pinning tests, renderer readiness, and composed WinUI/WebView visual baselines.
- Explorer/Shell-extension reference (validated across x64 and ARM64 CI):
FileExplorerAddonsTests.cs
demonstrates class-scoped runner reuse, one-time Shell restart, state-aware Preview pane
activation, exact Shell selection, deterministic icon sizes, provider-log readiness, and
failure media captured before Explorer teardown. Read
references/explorer-shell-tests.md before testing Explorer.

Required reads (in order)

  1. This SKILL.md — the decision tree (which scenario), the naming rules, the high-level

workflow, and the build/validate

评论
Mmicrosoft
microsoft
microsoft/PowerToys
查看 GitHub 仓库 查看作者的其他 Skill
来源信息
作者@microsoft
所属大类工具 Tools / 自动化工具
国内可用性通用
最近源活动—
风险提示无
提示:风险标签为程序静态扫描结果,仅作提示,不代表安全认证。安装前请阅读 SKILL.md 及其引用的脚本、权限,自行判断是否可信。