ui-tests-migration
Skill142k starsChanged 38 days agoMITView on GitHub
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.
Trending
More talk lately.about the whole repository
Who's talking about microsoft/PowerToys
- A Hacker News story“Fancy Zones, a tiling window manager”Hacker News · Sep 6, 2019 · 507 points
- A Hacker News story“PowerToys: Windows system utilities to maximize productivity”Hacker News · Sep 5, 2019 · 343 points
- A Hacker News story“PowerToys – Windows system utilities to maximize productivity”Hacker News · May 7, 2019 · 82 points
- snowie2000/mactype“Generic Subpixel Algorithm for Triangular-Structure QD-OLEDs / Pentile / WOLED / Others”GitHub · Apr 20, 2023 · 42 reactions
- A Hacker News story“PowerToys Release 0.70 with Mouse Without Borders and PowerToys Peek”Hacker News · May 24, 2023 · 41 points
The biggest 5 of 111 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 111
Talked about on GitHub, Bluesky and Hacker News (111 times).
On GitHub · 42
- Apr 20, 2023Generic Subpixel Algorithm for Triangular-Structure QD-OLEDs / Pentile / WOLED / Others — snowie2000/mactype42 reactions · 32 comments
- Oct 10, 2023Option to disable subpixel rendering on Windows instead of having to use CLI argument — microsoft/vscode28 reactions · 11 comments
- Mar 31, 2020Powertoys — QL-Win/QuickLook23 reactions · 2 comments
- May 18, 2021Obsolete due to MS PowerToys — tibold/svg-explorer-extension16 reactions · 11 comments
- Apr 30, 2026No results since vscode 1.118 — taooceros/Flow.Plugin.VSCodeWorkspace10 reactions · 4 comments
37 more on GitHub
- Jan 28, 2026(powertoys) 0.97.1's download URL is incorrect — mkevenaar/chocolatey-packages9 reactions · 1 comment
- Oct 13, 2023Tracking issue for DSC Resources — microsoft/winget-cli8 reactions
- Apr 20, 2022Question: When will InfoBadge be available in WinUI3? — microsoft/microsoft-ui-xaml8 reactions · 2 comments
- Apr 8, 2026Suggested fix for Windows host 1.4.6 breaks text input from iOS and Android (Resulted in modifier keys general fix) — rustdesk/rustdesk5 reactions · 38 comments
- Oct 17, 2026Remove version: Microsoft.PowerToys version 0.102.2862.0 — microsoft/winget-pkgs2 reactions · 9 comments
- Jun 11, 2026powertoys@0.100.0: Fix runtime issues by copying required files in the installer script — ScoopInstaller/Extras2 reactions · 3 comments
- Dec 6, 2023DwmGetColorizationParameters fallback in case of failure #593 — lepoco/wpfui2 reactions · 1 comment
- Dec 13, 2022Implement IFileDropResult to support drag&drop of results — lin-ycv/EverythingPowerToys2 reactions
- Sep 29, 2021add other localization resources — Flow-Launcher/Flow.Plugin.WindowsSettings2 reactions · 1 comment
- Apr 27, 2026[codex] Add low memory mode for supported utilities — Michaelihc/PowerToys1 reaction · 3 comments
- Feb 14, 2026Adds Microsoft PowerToys to Tools section — phoboslab/qoi1 reaction
- Jan 30, 2026PowerToys: Correct Typo in chocolateyinstall.ps1 $url64 Value — mkevenaar/chocolatey-packages1 reaction · 3 comments
- Oct 30, 2025[PowerToys Awake] Clarify lock screen behavior, add security considerations — MicrosoftDocs/windows-dev-docs1 reaction · 5 comments
- Oct 28, 2025[PowerToys] Shortcut Guide V2 docs — MicrosoftDocs/windows-dev-docs1 reaction · 15 comments
- Feb 21, 2025Update InvokeTestingPlatformTask to prefer running Exe over `dotnet exec dll` — microsoft/testfx1 reaction · 9 comments
- Feb 11, 2025Add Extensions page to Settings UI — microsoft/terminal1 reaction · 9 comments
- Jan 7, 2025Remove workaround that's not needed anymore — MicrosoftDocs/windows-dev-docs1 reaction · 9 comments
- Dec 18, 2024chore: configure Dependabot for GitHub Actions updates — microsoft/markitdown1 reaction · 1 comment
- Aug 5, 2024Updated Awake settings — MicrosoftDocs/windows-dev-docs1 reaction · 3 comments
- Jul 15, 2024Update PowerToys script to newer tag — mkevenaar/chocolatey-packages1 reaction · 5 comments
- Jul 15, 2024powertoys@0.82.1: Fix for the tag change — ScoopInstaller/Extras1 reaction · 3 comments
- May 14, 2024PowerToys PowerRename random values feature docs — MicrosoftDocs/windows-dev-docs1 reaction · 4 comments
- May 2, 2024Create similarIssues.yml which automatically comments with similar issues on the repo — dotnet/maui1 reaction · 4 comments
- Jan 25, 2024Update copyright year and copyright string — microsoft/WinUI-Gallery1 reaction · 2 comments
- Jan 22, 2024Add PowerToys Text Extractor — dynobo/normcap1 reaction · 2 comments
- Nov 21, 2023Implement FREETYPE_CUSTOM_GEOMETRY environment variable for unusual subpixel formats — rennr/freetype1 reaction · 15 comments
- Nov 13, 2023PowerToys Run for 0.75.1 requires Plugin ID in Main — bostrot/PowerToysRunPluginWinget1 reaction · 6 comments
- Aug 31, 2023[PowerToys][FindMyMouse] Add new activation methods — MicrosoftDocs/windows-dev-docs1 reaction · 2 comments
- Jun 4, 2023[Peek] Update docs to reflect new navigation keys — MicrosoftDocs/windows-dev-docs1 reaction · 6 comments
- May 15, 2023[PowerToys] Add Peek docs — MicrosoftDocs/windows-dev-docs1 reaction · 9 comments
- Apr 5, 2023[SettingsControls] Accessibility improvements — CommunityToolkit/Labs-Windows1 reaction · 2 comments
- Dec 30, 2022Use localized name for shell link programs — Flow-Launcher/Flow.Launcher1 reaction · 7 comments
- Dec 11, 2022Update quick-accent.md — MicrosoftDocs/windows-dev-docs1 reaction · 3 comments
- Oct 22, 2022[Program Plugin] Fix program UID and other bugs — Flow-Launcher/Flow.Launcher1 reaction · 4 comments
- Sep 30, 2022PowerToys text improvements — MicrosoftDocs/windows-dev-docs1 reaction · 12 comments
- Jul 23, 2022[PowerToys] Docs update for activation command change — MicrosoftDocs/windows-dev-docs1 reaction · 10 comments
- Jun 23, 2022v0.59.0 added support for arm — MicrosoftDocs/windows-dev-docs1 reaction · 1 comment
On Bluesky · 41
- Jan 22, 2026Hot tip: Turns out you can disable the Copilot button on the keyboard with the keyboard remapping tool (map it onto the left-ctrl button… — @keithng.bsky.social14 likes and reposts · 2 replies
- Sep 7, 2023برای استخراج متن از تصویر در ویندوز Microsoft PowerToys رو از گیتهاب دانلود و نصب کنید. github.com/microsoft/Po... وارد تنظیمات اون بشید… — @yetanotheruserhere.bsky.social9 likes and reposts
- Jan 8, 2025So, let me get this straight. Microsoft (yes, actually them) developed an OPEN SOURCE addon for Windows that adds a bunch of use of useful… — @dzaladan.eurosky.social5 likes and reposts
- Aug 12, 2023https://learn.microsoft.com/en-us/windows/powertoys/ — @starsetbyte.lol5 likes and reposts · 2 replies
- Jan 6, 2026📦 microsoft / PowerToys ⭐ 127,159 (+46) 🗒 C# Microsoft PowerToys is a collection of utilities that help you customize Windows and… — @github-trending.bsky.social4 likes and reposts
36 more on Bluesky
- May 16, 2025📦 microsoft / PowerToys ⭐ 118,571 (+41) 🗒 C# Windows system utilities to maximize productivity — @github-trending.bsky.social3 likes and reposts
- May 7, 2025Microsoft... Faut les sucer en chantant "Microsoft est le plus grand contributeur du libre au monde, Microsoft est beau, Microsoft est… — @zurbo.fr3 likes and reposts · 1 reply
- Mar 23, 2025powertoys fancyzones, get that shit fixed up github.com/microsoft/Po... — @ket.bsky.social3 likes and reposts · 1 reply
- Jan 7, 2025If you're a Windows user, this bundle of efficiency gadgets from @microsoft.com should be definitely on your radar!… — @jankabatek.com3 likes and reposts
- Dec 19, 2024📦 microsoft / PowerToys ⭐ 112,455 (+71) 🗒 C# Windows system utilities to maximize productivity — @github-trending.bsky.social3 likes and reposts
- Jan 11, 2024📦 microsoft / PowerToys ⭐ 100,904 (+86) 🗒 C# Windows system utilities to maximize productivity — @github-trending.bsky.social3 likes and reposts
- Nov 22, 20232. download Windows PowerToys and find the Text Extractor module. The default keybind Win-Shift-T lets you select text directly from your… — @meganox.myatproto.social3 likes and reposts · 2 replies
- Oct 31, 2023Why?! 😶 Why haven't I installed MS PowerToys sooner? 😒 Love them! 😍 — @ferociousbyte.dev3 likes and reposts · 1 reply
- Dec 12, 2025github.com/microsoft/Po... learn.microsoft.com/en-us/window... indeed, it does! have some relevant links :) — @auralyn.northsky.social2 likes and reposts
- Oct 17, 2025📦 microsoft / PowerToys ⭐ 124,453 (+79) 🗒 C# Microsoft PowerToys is a collection of utilities that help you customize Windows and… — @github-trending.bsky.social2 likes and reposts
- Jul 29, 2025📦 microsoft / PowerToys ⭐ 121,315 (+82) 🗒 C# Windows system utilities to maximize productivity — @github-trending.bsky.social2 likes and reposts
- Mar 10, 2025PowerToys has some useful tools too github.com/microsoft/Po... — @emeraldfox.gay2 likes and reposts
- Mar 6, 2025📦 microsoft / PowerToys ⭐ 115,374 (+62) 🗒 C# Windows system utilities to maximize productivity — @github-trending.bsky.social2 likes and reposts
- Jan 28, 2025You rang? PowerToys: github.com/microsoft/Po... AI Dev Gallery: github.com/microsoft/AI... — @baldbeardedbuilder.com2 likes and reposts · 2 replies
- Jan 14, 2025It's free, open source, and developed by Microsoft. github.com/microsoft/Po... — @crossmod.bsky.social2 likes and reposts
- Sep 5, 2024📦 microsoft / PowerToys ⭐ 108,627 (+60) 🗒 C# Windows system utilities to maximize productivity — @github-trending.bsky.social2 likes and reposts
- Nov 13, 2026🚀 GitHub Intelligence Drop gstack (TypeScript • 🟢) ⭐ 141.5K → https://github.com/garrytan/gstack PowerToys (C • 🟢) ⭐ 141K →… — @githubfeed.bsky.social1 likes and repost
- Sep 11, 2026Power Display within PowerToys would probably work for ya - github.com/microsoft/Po... — @siberionhusky.bsky.social1 likes and repost
- Jun 12, 2026I just starred microsoft/PowerToys on GitHub: https://github.com/microsoft/PowerToys — @chiefgyk3d.com1 likes and repost
- Apr 1, 2026I really find the Mouse Without Borders tool (part of github.com/microsoft/Po...) super useful. There's a few rough edges for features I'd… — @david.gardiner.net.au1 likes and repost · 1 reply
- Jan 31, 2026📦 microsoft / PowerToys ⭐ 128,642 (+61) 🗒 C# Microsoft PowerToys is a collection of utilities that help you customize Windows and… — @github-trending.bsky.social1 likes and repost
- Nov 9, 2025And last but not least, in fact very important, is powertoy, and the command palette github.com/microsoft/Po... — @vnphanquang.com1 likes and repost
- Sep 17, 20251. FlipFlip by StarrHelixx github.com/ififfy/flipf... For studying art REFs 2. PureRef www.pureref.com 2. Draw-IO www.drawio.com —… — @mireu9999.bsky.social1 likes and repost · 1 reply
- May 21, 2025📦 microsoft / PowerToys ⭐ 118,951 (+95) 🗒 C# Windows system utilities to maximize productivity — @github-trending.bsky.social1 likes and repost
- Feb 16, 2025GitHub: github.com/microsoft/Po... — @rand0mbits.bsky.social1 likes and repost
- Feb 3, 2025microsoft power toys has a window manager that lets you do exactly that - set custom zones for each display… — @lucyluuu.me1 likes and repost · 1 reply
- Dec 22, 2024Two must haves on every new Windows laptop I have github.com/microsoft/Po... Powertools and www.voidtools.com Everything Pretty much lets… — @nathanbeddoe.com1 likes and repost
- Sep 23, 2024Github, too github.com/microsoft/Po... — @obol.bsky.social1 likes and repost
- Sep 16, 2024https://github.com/microsoft/PowerToys Interesting — @yee.nu1 likes and repost
- Mar 17, 2024Años buscando cómo cambiar el mapa de caracteres de mi teclado en Windows y resulta que existía esto publicado por el propio Microsoft.… — @jmbeas.es1 likes and repost · 1 reply
- Sep 29, 2023📦 microsoft / PowerToys ⭐ 95,738 (+58) 🗒 C# Windows system utilities to maximize productivity — @github-trending.bsky.social1 likes and repost
- Sep 4, 2023Favorite productivity tools that I use daily: 1) PowerToys - github.com/microsoft/Po... - fancy zones, text extractor, and more 2) Beeftext… — @drewmaust.bsky.social1 likes and repost
- Oct 18, 2025Ny Powertoys (om du ikke bruker det, get it!) har nå fått Light Switch og Peek! Light Switch endrer automatisk light/dark mode basert på… — @visn.es0 likes and reposts · 1 reply
- Sep 4, 2025📦 microsoft / PowerToys ⭐ 122,846 (+52) 🗒 C# Windows system utilities to maximize productivity — @github-trending.bsky.social0 likes and reposts · 1 reply
- Aug 21, 2025I discovered that PowerToys for Windows is a thing. * Spotlight-like search with Alt+Space; * Caffeine-like app to prevent the PC from… — @andrey.nering.dev0 likes and reposts · 1 reply
- Aug 12, 2025Eine Auswahl der Tools: https://github.com/memstechtips/WIMUtil https://github.com/memstechtips/UnattendedWinstall… — @sebastianlaube.layer8.space.ap.brid.gy0 likes and reposts · 1 reply
On Hacker News · 28
- Sep 6, 2019Fancy Zones, a tiling window manager507 points · 163 comments
- Sep 5, 2019PowerToys: Windows system utilities to maximize productivity343 points · 126 comments
- May 7, 2019PowerToys – Windows system utilities to maximize productivity82 points · 29 comments
- May 24, 2023PowerToys Release 0.70 with Mouse Without Borders and PowerToys Peek41 points · 12 comments
- May 3, 2025PowerToys – Windows system utilities to maximize productivity10 points · 2 comments
23 more on Hacker News
- Oct 29, 2020Microsoft PowerToys – Color Picker7 points
- Feb 21, 2021PowerToys6 points
- May 8, 2019Microsoft PowerToys for Windows 106 points · 2 comments
- May 21, 2025The Windows efficiency toolkit open-sourced by Microsoft5 points · 1 comment
- Apr 30, 2020Microsoft PowerToys v0.17.05 points
- May 29, 2023A plea to Microsoft: Subpixel text rendering for WRGB stripe and RGB triangular4 points
- Nov 3, 2023Microsoft PowerToys: utilities for tuning and streamlining Windows experience3 points · 1 comment
- Nov 3, 2022Release v0.64.0 · Microsoft/PowerToys3 points
- Jan 10, 2022PowerToys: Utilities to tune and streamline Windows for greater productivity3 points
- Nov 1, 2021Microsoft PowerToys3 points
- Oct 9, 2025PowerToys has detected an app Always On Top message · Issue #309732 points
- Oct 30, 2023PowerToys: Windows system utilities to maximize productivity2 points
- Feb 9, 2023PowerToys Quick Accent adds the ability to type en and em dashes2 points · 1 comment
- Aug 23, 2020Microsoft PowerToys for Windows 102 points · 1 comment
- Aug 2, 2020Microsoft PowerToys2 points
- May 19, 2020PowerToys v0.18.02 points
- Oct 1, 2023Powertoys bug #2701: [New setting] Check for updates automatically (on/off)1 point
- Nov 3, 2022PowerToys: Windows system utilities to maximize productivity1 point
- May 28, 2021MS PowerToys is a set of utilities for power users to tune their Windows 101 point · 1 comment
- Jun 24, 2020PowerToys Keyboard Manager1 point
- May 30, 2020Windows PowerToys Run1 point
- Oct 29, 2019Microsoft Powertoys v0.12.01 point
- May 8, 2019Microsoft Reboots PowerToys for Windows 101 point
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- src/modules/cmdpal/ExtensionTemplate/TemplateCmdPalExtension/.github/copilot-instructions.mdCopilot instructions
- powertoys-verificationSkill
- release-note-generationSkill
- ui-tests-local-vmSkill
- ui-tests-pipeline-ciSkill
- winmd-api-searchSkill
- wpf-to-winui3-migrationSkill
- add-adaptive-card-formSkill
- add-dock-bandSkill
- add-extension-settingsSkill
- add-fallback-commandsSkill
- publish-extensionSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
Use this skill when the task is to:
- Very specific: line 134
Place the new project under src/modules/[Module]/Tests/[Module].UITests.Next/ (or …/Tests/[Module].UITests/ for Scenario B).
- Distinctive: line 147
Create a TODO list and work top-to-bottom.
- Distinctive: line 231
Before the first push, walk its pre-flight checklist (authoritative-signal retries instead of fixed sleeps, navigation via UIA invoke, …
- Distinctive: line 239
Diagnose from the artifacts, not from the assertion message: Every failed test attaches a desktop screenshot, and in pipeline mode an MP4 …
- Very specific: line 282
Do NOT port the legacy plumbing literally: No Selenium Actions, no WindowsDriver/WindowsElement, no By.XPath/By.CssSelector, no :4723.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PowerToys UI-Tests Migration (legacy → .Next)
Legacy retirement:
mainno longer containssrc/common/UITestAutomationor its test projects. Use the existing.Nextsuites 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.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 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 throughwinappcli.- 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-awareapp.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)
- This
SKILL.md— the decision tree (which scenario), the naming rules, the high-level workflow, and the build/validate loop. - 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 — the line-by-line cheat sheet:
namespaces,
By,Elementactions/properties,Session,UITestBase, the static Keyboard/Mouse/Clipboard helpers, and the element-wrapper catalog. Keep this open while editing. - references/project-setup.md — csproj scaffold, naming/placement
rules,
.slnxregistration, and how to build & run a.Nextproject. Uses the templates/ starter files. - 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 — 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 — 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 — 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 — 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 — the mandatory post-local handoff for implementation tasks: preflight, scoped commit/push, exact-revision CI, and terminal sign-off.
Pick your scenario
flowchart TD
A[Module to migrate] --> B{Does a legacy<br/>UITests project exist?}
B -- Yes --> C["Scenario A: PORT<br/>Create [Module].UITests.Next<br/>Re-implement each legacy test"]
B -- No --> D{Is there a human test<br/>sign-off .md?}
D -- Yes --> E["Scenario B: GREENFIELD<br/>Create [Module].UITests<br/>Turn each checklist item into a test"]
D -- No --> F[Ask the user for the<br/>test spec / sign-off doc]| 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 by different people in different styles. Treat the recipes in this skill as adaptable patterns, not a rigid script. Re-create the intent and assertions of each test; do not mechanically translate brittle, harness-specific scaffolding (Selenium
Actions, XPath walks, manual driver attaches) when the 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.
- [ ] 1. Identify the module + scenario (A port / B greenfield) — this SKILL.md "Pick your scenario"
- [ ] 1a. Read the module's developer docs — `doc/devdocs/modules/<module>.md` (if the exact file is
missing, search `doc/devdocs/`, including `doc/devdocs/common/`) — to learn its
development-cycle specifics BEFORE writing tests: how its shell extensions / context menus
register, whether they need a **Release** build (`NDEBUG`) or a **signed** sparse MSIX package,
and any Explorer-restart or first-run needs. Skipping this produces opaque failures — e.g. a
context-menu entry never appears because a Debug build compiles registration out, or an
unsigned `.msix` fails to register (`0x800B0100`).
- [ ] 2. Read the two reference examples (ColorPicker + ScreenRuler `.Next`) end-to-end
- [ ] 3. Inventory the source:
• Scenario A → list every [TestMethod] + shared helper in the legacy project
• Scenario B → read the module's sign-off .md; list each manual checklist item
• For each workflow → list every external boundary (runner, Explorer, HWND, renderer,
compositor, child process) and its authoritative ready signal
— references/porting-workflow.md
- [ ] 4. Internalize the deltas — references/framework-differences.md
- [ ] 5. Scaffold the new project (csproj + PerMonitorV2 app.manifest from templates, name per the
table, register in .slnx)
— references/project-setup.md
- [ ] 6. Re-implement tests, mapping each API as you go — references/api-mapping.md
+ recipes from references/patterns-and-pitfalls.md
- [ ] 6a. If Explorer/Shell is involved, apply references/explorer-shell-tests.md
- [ ] 7. Apply the CI-stability checklist BEFORE building — references/ci-stability.md
(stable authoritative signals, retry classification, foreground/integrity, lifecycle reset
scope, non-activating helper processes, composed capture, DPI manifest, single-module enable,
first-run suppression)
- [ ] 7a. If a test changes a module's enabled state through Settings, keep the real Settings UI +
immediate runtime assertion. Verify the selected UITest project is covered by the existing
`$requiresAuthenticatedSettingsIpc` companion-signing path in
`.pipelines/v2/templates/job-test-project.yml`; never add a test-side settings/restart fallback
for Release CI — [references/ci-stability.md](references/ci-stability.md#principle-5a--keep-module-lifecycle-tests-on-real-release-settings-ipc)
- [ ] 8. Build the new project to exit code 0 — this SKILL.md "Build & validate"
- [ ] 9. Run one deterministic test in the local VM and diagnose the first failure
— ../ui-tests-local-vm/SKILL.md
- [ ] 10. Rerun the focused test after each fix, then widen to the complete module suite with bounded
timeouts; parse TRX and verify durable evidence export
- [ ] 11. If the local VM is unavailable or unsupported, run on another live desktop or report the exact
environmental blocker; do not silently stop at compile validation
- [ ] 12. Complete the full default and Constrained suites on both guest OSes, plus applicable
architecture builds/guests; preserve counts, payload hashes, and evidence
- [ ] 13. Invoke ui-tests-pipeline-ci, pass its access preflight, commit only task-owned changes,
and push the feature branch; record the exact SHA
- [ ] 14. Preview and queue scoped CI, persist its build ID, watch through completion, and diagnose/retry
within the three-run ceiling; finish only on verified terminal success or an explicit blockerBuild & validate
The .Next harness needs winapp.exe only at run time, not build time — the project has zero
managed dependency on the engine. So you can always compile-verify a migration even on an agent with
no winappcli installed.
# 0. FIRST build of a brand-new project: restore so the assets file exists, otherwise the build
# fails with NETSDK1004 "Assets file ... project.assets.json not found".
dotnet restore src\modules\<Module>\Tests\<Module>.UITests.Next\<Module>.UITests.Next.csproj -p:Platform=x64
# (Equivalently, run tools\build\build-essentials.cmd once at the start of the session.)
# 1. Build just the new test project (fast inner loop). Prefer the repo build script.
tools\build\build.cmd -Path src\modules\<Module>\Tests\<Module>.UITests.Next -Platform x64 -Configuration Debug
# Exit code 0 = success; non-zero = failure. On failure read the errors log under the repo root:
# artifacts\logs\<Module>.UITests.Next\build.<Configuration>.<Platform>.errors.log
# Do not substitute `dotnet build` when UITestAutomation.Next's COM references are in the graph:
# .NET SDK MSBuild cannot run ResolveComReference and fails with MSB4803. Use the repo script or
# Visual Studio's full-framework MSBuild.exe; use `dotnet restore` only to create project.assets.json.
# 2. Run (needs a live desktop). A .Next project is a Microsoft.Testing.Platform Exe — run the
# produced exe directly with a TRX report; filter to one test/category for a tight loop.
$exe = "<repo>\x64\Debug\tests\<Module>.UITests.Next\net11.0-windows10.0.26100.0\<Module>.UITests.Next.exe"
& $exe --filter "TestCategory=<Cat>" --report-trx --report-trx-filename run.trx --results-directory <dir>
# --filter accepts "TestCategory=X" or "FullyQualifiedName~Y"; omit it to run everything.
# Exit 0 = all passed. Parse the .trx for per-test outcomes + failure messages.- Default to persistent local VM validation — ui-tests-local-vm. It keeps the interactive desktop and staged tools, refreshes only changed archives, and returns durable status/TRX/evidence. Do not modify stabilized tests merely to improve a VM-specific pass rate when the task only asks whether the execution loop works. Finish clean-profile claims from a restored known baseline or a fresh named VM volume.
- Design for CI stability up-front — references/ci-stability.md. Before the first push, walk its pre-flight checklist (authoritative-signal retries instead of fixed sleeps, navigation via UIA invoke, interaction-scoped foreground checks, non-activating helpers, Win32 window/overlay detection, screen-capture cold-start handling, DPI manifest, single-module enable, first-run suppression). Most "passes local, fails CI" loops come from skipping one of these; applying them proactively is how you spend one CI iteration instead of six.
- Run it in a loop: write → build → run → diagnose → repeat. UI tests surface environment-real failures (DPI scaling, cursor position, hotkey-arming races) that only a live run reveals. Start with one deterministic test (e.g. the activation/toggle test), get it green, then widen.
- Diagnose from the artifacts, not from the assertion message. Every failed test attaches a desktop screenshot, and in pipeline mode an MP4 of the run. Open them before forming any theory — especially before concluding the product is broken. An assertion can only say "found 0 rows"; the screenshot says whether the list was empty or whether your selector was wrong. This is the single highest-leverage habit in the agentic loop: skipping it cost ~8 iterations and a confident but entirely wrong product-defect report on File Locksmith (see references/patterns-and-pitfalls.md Pitfall 26). If there is no video, find out why rather than proceeding blind — the harness now prints the reason (a clean Windows image without the Visual C++ redistributable cannot load the native encoder).
- First, run the legacy suite once for a baseline — and run it ELEVATED. The legacy harness
launches PowerToys via
ProcessStartInfo { Verb = "runas" }(elevated), so a non-elevated test host can't complete the launch and every test fails at startup with a misleadingWin32Exceptioncascade — a false 0/N that looks like "the tests are broken" but is purely the run method. (That's why VS Test Explorer passes them: VS runs as admin.) Run from an elevated terminal: startWinAppDriver.exeon127.0.0.1:4723, then run the built DLL withvstest.console.exe(see references/porting-workflow.md §A0 for the-Verb RunAsrecipe). A measurement failure on a scaled (non-100%) display is usually a pre-existing DPI issue (Pitfall 12), not something the port must reproduce — the ScreenRuler legacy suite scores 4/5 elevated here (Bounds fails at 150% scale) while the.Nextport scores 5/5..Nexttests themselves need no elevation (the new harness launches the runner non-elevated). - Always build to exit code 0 before proceeding to live validation. Fix every compile error — do
not leave
// TODO: port thisstubs that break the build. - Running the tests requires a live interactive desktop plus
winapp.exe(winget install Microsoft.winappcli, or setWINAPP_CLI_PATH). The whole PowerToys runner is launched by the harness (PowerToys.exe --open-settings) — you should see the Settings window appear. If no supported live desktop is available, report local validation blocked, along with the build result and checklist coverage. Compile-only evidence does not complete an implementation task or satisfy the CI local gate. - New
.csprojfiles undersrc/MUST<Import Project="$(RepoRoot)src\Common.Dotnet.CsWinRT.props" />right after<Project Sdk=...>(CI audits this). The template already does.
What NOT to do
- Do NOT delete or edit the legacy
[Module].UITestsproject in Scenario A. The.Nextproject lives alongside it; removing the old one is a separate, explicit decision for the maintainers. - Do NOT change product behaviour. This is a test-only migration. The one sanctioned product edit
is adding
AutomationProperties.AutomationIdto a control that is otherwise unaddressable — an icon-only button whose label lives in a tooltip has no UIA Name at all, and the alternative is a brittle coordinate click. UseAutomationProperties.AutomationId, neverx:Name(which also emits a code-behind field); see references/patterns-and-pitfalls.md Recipe 16. Anything larger — a hidden automation-peer TextBlock, a new property, a state string — must be flagged for the user instead. (ColorPicker'sColorHexAutomationPeerhook is a documented, pre-existing exception — see its class remarks.) - Do NOT port the legacy plumbing literally. No Selenium
Actions, noWindowsDriver/WindowsElement, noBy.XPath/By.CssSelector, no:4723. Map them to the winappcli idioms in references/api-mapping.md. - Do NOT add a
ProjectReferencetoUITestAutomation.csproj(the legacy harness) — referenceUITestAutomation.Next.csprojonly. - Do NOT invent assertions for a vague sign-off item. If a checklist line has no observable
pass/fail signal, implement what you can and leave a clearly-marked
TestContext.WriteLinenote (or skip with an explanation) rather than asserting on something you can't actually read. - Do NOT introduce new third-party NuGet dependencies. The
.Nextharness is intentionally dependency-free (MSTest only). Use the Win32-based helpers it already ships. - Do NOT retry a toggle hotkey blindly. Once any target window appears, wait for initialization; resending the chord may close a healthy window. Restart only after a terminal readiness failure.
- Do NOT replace or weaken visual baselines before proving capture is correct. Foreground HWND, DWM z-order, composed WebView content, theme, and platform are separate failure sources.
- Do NOT work around a Release Runner
not-microsoft-signedSettings rejection in test code. Do not seed the global enabled map, restart PowerToys, bypass authentication, or weaken the lifecycle assertion. Reuse the pipeline's existing Runner/Settings companion-signing mechanism; see references/ci-stability.md.
What is NICE to do
- Improve the framework when a helper is demonstrably reusable. Prefer small composable APIs
(
WaitHelper,WindowControl,ExplorerShell) over module-specific mega-helpers. Keep product semantics such as Peek pin-state preservation in the module test.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

