microsoft/powertoys/ui-tests-migration
Claude Code and agent skill by microsoft/powertoys
- vendor
Checking that the SKILL.md file is still in the repository.
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.
Install
npx vskill@latest install microsoft/powertoys/ui-tests-migrationSKILL.md
The same SKILL.md was published earlier as microsoft/powertoys/ui-tests-migration.
PowerToys UI-Tests Migration (legacy → .Next)
Legacy retirement:mainno longer containssrc/common/UITestAutomationor its testprojects. Use the existing.Nextsuites and Scenario B for current development. Scenario Aand the legacy comparisons in this skill are historical guidance for older branches; do notrestore the retired framework or tests. Existing.Nextproject 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.Nextproject that re-implements the legacy tests with the new
harness, leaving the old project in place.
- Stand up brand-new
.NextUI 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, completion watching, and the three-run stabilization limit.
Reference implementation — read these working examples before porting anything. They arethe 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 throughwinappcli.- Worked Scenario-A port (validated 5/5): theScreenRuler suite ported from the retired legacy project lives in+ 5 test classes. It is the canonical port reference — cross-window toolbar discovery viaSession.FromProcess, a DPI-awareapp.manifest, cursor centering, and patient hotkeyactivation are all there because real runs needed them (see- Stateful/visual reference (validated 15/15 across Win10 x64, Win11 x64, and ARM64):demonstrates stable Explorer Shell selection, toggle-hotkey activation, process-preservingpinning tests, renderer readiness, and composed WinUI/WebView visual baselines.- Explorer/Shell-extension reference (validated across x64 and ARM64 CI):demonstrates class-scoped runner reuse, one-time Shell restart, state-aware Preview paneactivation, exact Shell selection, deterministic icon sizes, provider-log readiness, andfailure media captured before Explorer teardown. Readreferences/explorer-shell-tests.md before testing Explorer.
Required reads (in order)
- This `SKILL.md` — the decision tree (which scenario), the naming rules, the high-level
workflow, and the build/validate loop.
- [references/framework-differences.md](references/framework-differences.md) — the conceptual
deltas you MUST internalize before writing code: winappcli engine, stateless elements, selector grammar (no XPath/CssSelector), session scopes (window vs process), lifecycle/hygiene/module pre-enablement, multi-window discovery, and what the new harness does NOT (yet) provide.
- [references/api-mapping.md](references/api-mapping.md) — the line-by-line cheat sheet:
namespaces, By, Element actions/properties, Session, UITestBase, the static Keyboard/Mouse/Clipboard helpers, and the element-wrapper catalog. Keep this open while editing.
- [references/project-setup.md](references/project-setup.md) — csproj scaffold, naming/placement
rules, .slnx registration, and how to build & run a .Next project. Uses the templates/ starter files.
- [references/porting-workflow.md](references/porting-workflow.md) — the two end-to-end
playbooks: A) port existing legacy tests, and B) author tests from a human sign-off markdown when none exist.
- [references/patterns-and-pitfalls.md](references/patterns-and-pitfalls.md) — adaptable recipes
for the recurring PowerToys patterns (toggle a module + verify its process, read the activation shortcut from a ShortcutControl, fire a global hotkey reliably, inspect the clipboard, discover overlay/editor windows) and the gotchas that bite during migration.
- [references/explorer-shell-tests.md](references/explorer-shell-tests.md) — required for tests
involving Explorer, preview handlers, thumbnail providers, Shell selection, view modes, or Shell restarts. Covers lifecycle boundaries, authoritative signals, and failure evidence.
- [references/ci-stability.md](references/ci-stability.md) — the CI-stability capstone: the
Win32-window vs UIA-element mental model, state-boundary worksheet, stable-sample waits, retry semantics, foreground/integrity constraints, process lifecycle, composed visual capture, and a pre-flight checklist to apply BEFORE the first CI push. It also covers Release Runner/Settings IPC authentication, the existing CI companion-signing mechanism, and why a visible Settings toggle must never be rescued with a settings-file/restart fallback. Read this to spend one CI iteration instead of six.
- [ui-tests-local-vm](../ui-tests-local-vm/SKILL.md) — the live desktop execution loop:
scaffold or reuse a persistent Hyper-V VM, run as a true standard user, refresh only changed payloads, iterate through durable TRX/evidence, and restore or recreate the baseline for clean-profile validation.
- [ui-tests-pipeline-ci](../ui-tests-pipeline-ci/SKILL.md) — the mandatory post-local handoff
for implementation tasks: preflight, scoped commit/push, exact-revision CI, and terminal sign-off.
Pick your scenario
| Scenario | Trigger | New project name | Source of test cases | |
|---|---|---|---|---|
| A — Port | A legacy [Module].UITests (or similar) project already exists and references UITestAutomation.csproj | `[Module].UITests.Next` — keep the .Next suffix so it lives alongside the legacy project | The existing legacy test methods (1:1 re-implementation) | |
| B — Greenfield | The module has no UI tests at all | `[Module].UITests` — drop the .Next suffix; there's nothing to live alongside | The module's human sign-off markdown (manual checklist), e.g. ColorPickerUITest.md |
Place the new project under `src/modules/[Module]/Tests/[Module].UITests.Next/` (or …/Tests/[Module].UITests/ for Scenario B). If the module already keeps tests in a different Tests/ layout, match the module's existing convention rather than forcing this one — see references/project-setup.md.
Keep it abstract. Every PowerToys module is unique and the legacy tests were written bydifferent people in different styles. Treat the recipes in this skill as adaptable patterns, nota rigid script. Re-create the intent and assertions of each test; do not mechanically translatebrittle, harness-specific scaffolding (SeleniumActions, XPath walks, manual driver attaches) whenthe new harness has a cleaner idiom.
High-level workflow
Create a TODO list and work top-to-bottom. Each step links to the reference that drives it.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 29 Sep 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/ui-tests-migration/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/powertoys/ui-tests-migration)