## Summary of the Pull Request Adds a `PowerRename.UITests.Next` suite powered by winappcli and automates all 18 scenarios from #40663. The suite covers PowerRename settings, search and replace behavior, regular expressions, formatting and filtering options, file-list interactions, and both classic and Windows 11 context-menu workflows. The PR also stabilizes shared `UITestAutomation.Next` runner lifetimes and settings restoration, adds automation IDs for the original and renamed counters, and prepares unsigned CI builds for PowerRename shell testing. CI now signs the sparse context-menu MSIX and the runner/Settings IPC companions with a disposable machine-trusted test identity. ## PR Checklist - [x] Closes: #40663 - [x] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [x] **Tests:** Added/updated and all pass - [x] **Localization:** All end-user-facing strings can be localized - [x] **Dev docs:** Added/updated - [x] **New binaries:** Not applicable; no new shipped product binaries are added - [x] JSON for signing: Not applicable - [x] WXS for installer: Not applicable - [x] YML for CI pipeline: The new UI-test project is discovered through the existing `*UITest*.csproj` pipeline flow and is registered in `PowerToys.slnx` - [x] YML for signed pipeline: Not applicable - [x] **Documentation updated:** Not applicable; there are no user-facing behavior or documentation changes ## Detailed Description of the Pull Request / Additional comments ### PowerRename UI tests - Adds a 25-case `PowerRename.UITests.Next` executable covering all 18 checklist items from #40663. - Exercises classic context-menu registration on Windows 10 and Windows 11. - Exercises the signed Windows 11 tier-1 context menu, including icon visibility and real invocation with an Explorer selection. - Covers search/replace preview and application, text formatting, file/folder/subfolder inclusion, filename/extension scope, enumeration, case sensitivity, match-all behavior, regular expressions, file timestamps, Boost syntax, MRU autocomplete, persisted values, and file-list selection/filtering. - Preserves the existing legacy tests. ### Test reliability and automation hooks - Reuses one runner/Settings lifetime across the complete PowerRename suite to avoid repeated cold launches on constrained agents. - Retains and restores global settings for the full class lifetime and verifies that both Settings and the runner remain healthy. - Propagates scope and PowerRename cleanup failures instead of silently leaking process or profile state. - Adds `OriginalCount` and `RenamedCount` automation IDs. These are automation-only metadata and do not change the visible UI. - Uses stable preview samples, exact count targeting, authoritative Explorer selection, readable classic-menu inventories, and live UIA visibility for popup items. ### Unsigned CI build support - Extends the existing sparse-package test signer with required Authenticode companion files. - PowerRename jobs sign `PowerToys.exe` and `PowerToys.Settings.exe` with the same disposable machine-trusted test identity used for sparse MSIX packages. - This preserves Release IPC authentication while allowing Settings module-toggle commands to work on unsigned PR builds. - Windows 11 and ARM64 PowerRename jobs require a validly signed `PowerRenameContextMenuPackage.msix` before tests start. ## Validation Steps Performed ### Builds and discovery - `PowerRename.UITests.Next` Debug x64 build: passed - `PowerRename.UITests.Next` Debug ARM64 cross-build: passed - `PowerRenameUI` Release x64 build: passed - `UITestAutomation.Next.UnitTests` Debug x64 build: passed - `UITestAutomation.Next.UnitTests`: 16/16 passed - Microsoft.Testing.Platform discovery: 25 unique PowerRename test cases ### Local VM matrix All runs used the complete unfiltered `TestCategory=PowerRename` suite and restored the standard user's settings file byte-for-byte. | Guest | Profile | Result | |---|---|---:| | Windows 10 x64 | Default, 4 vCPU / 8 GB | 25/25 | | Windows 10 x64 | Constrained, 1 vCPU / 4 GB | 25/25 | | Windows 11 x64 | Default, 4 vCPU / 8 GB | 25/25 | | Windows 11 x64 | Constrained, 1 vCPU / 4 GB | 25/25 | ### Azure DevOps UI Test Automation - Final build: [155646235 / 20260824.1](https://dev.azure.com/microsoft/Dart/_build/results?buildId=155646235) - Source revision: `4496683104aea622b30179909bd6e95a17d5500f` - ARM64: 25/25 passed - Windows 10 x64: 25/25 passed - Windows 11 x64: 25/25 passed - Total: 75/75 passed, with zero failed, skipped, not-executed, or unanalyzed results - ARM64 and x64 Release product builds succeeded and published their normal artifacts - Signing steps verified the PowerRename sparse MSIX where applicable and both IPC companion executables on every PowerRename test job <img width="372" height="314" alt="image" src="https://github.com/user-attachments/assets/bc303673-0325-4f85-8d70-ef93110baf5b" />
6.1 KiB
name, description, license
| name | description | license |
|---|---|---|
| ui-tests-pipeline-ci | Microsoft FTE-only workflow for validating setup, queueing, monitoring, and stabilizing PowerToys UI Test Automation through an existing Azure CLI session and Azure DevOps REST APIs. Use after local VM suites pass, when asked to run UITests CI, perform a setup preflight/readiness check, diagnose repeated az login prompts or 401/403 permission failures, reuse a successful build, inspect recordings/artifacts, or manage the three-run limit. Keywords: FTE, az, Azure CLI, Azure DevOps, pipeline, UI Test Automation, UITests CI, buildNow, specificBuildId, uiTestModules, CI flake. | MIT |
PowerToys UI Tests Pipeline CI
Queue and stabilize the internal UI Test Automation Azure DevOps pipeline only after the target
UITest suite is proven locally. Use the existing Azure CLI sign-in plus Azure DevOps REST APIs for
discovery, preview, queueing, status, timelines, logs, tests, artifacts, and result attachments.
Important
Microsoft FTE only. This workflow requires authorized access to the
microsoftAzure DevOps organization and theDartproject. External contributors stop after local validation and report CI as unavailable. Never store credentials, PATs, tokens, or internal artifact contents in the repository.
When to use
Use this skill when an authorized Microsoft FTE asks to:
- Queue PowerToys UITests in the internal
UI Test Automationpipeline. - Validate Azure CLI and Azure DevOps readiness before queueing or after a
401/403response. - Monitor a UITests pipeline run or summarize its stages, tests, and artifacts.
- Iterate on a failure that passed the complete local VM matrix.
- Reuse a prior successful product build while rebuilding only one or more UITest projects.
- Find and share failed-test screenshots, logs, or recording links.
Do not use this skill for local execution. Complete ui-tests-local-vm first. Use ui-tests-migration for test implementation and stabilization.
Non-negotiable gates
- Setup preflight first. Before the first Azure operation in a session, run
Test-AzureDevOpsSetup.ps1 and require
Ready=truewith every required checkPASS. It performs reads and a non-mutating pipeline preview only. Re-run it after account changes or any401/403response. - Local first. Do not queue CI until all required local runs are green, including full suites on
the default and
Constrainedprofiles for Windows 10 and Windows 11, plus the applicable architecture builds/guests required byui-tests-local-vm. - Pushed revision. Queue only a pushed branch. Record its exact commit and verify the queued
run's
sourceVersionmatches it. - One run per branch. Before queueing, discover active runs for
UI Test Automation. Wait for or cancel a relevant superseded run on the target branch; runs on other branches may continue in parallel. Never cancel another branch's unrelated run. - Always scope modules.
uiTestModulesmust be non-empty and contain the exact current UITest project stem, for example[FancyZonesEditor.UITests.Next]. - Three-run ceiling. A CI stabilization sequence may queue at most three runs total. Keep an attempt ledger. If run 3 is not green, stop and ask the user for assistance. Also stop when three consecutive runs show no stabilization progress.
- Evidence before edits. Read the failed result, logs, screenshot, and recording before forming a fix hypothesis. Preserve assertions and classify infrastructure failures separately.
- Tracked runs remain unfinished work. After queueing, persist the build ID, branch, source SHA, attempt number, and parameters in session/task state. Do not mark the task complete or claim a terminal result while that build is nonterminal. If no authenticated completion waiter exists, arm the one-hour scheduled continuation in the agentic loop rather than relying on a passive handoff. On every scheduled wake, resume, notification, or user turn that continues the tracked CI task, query that exact build ID before other Azure work and continue from its current state.
Internal constants
| Setting | Value |
|---|---|
| Azure DevOps organization | microsoft |
| Project | Dart |
| Pipeline name | UI Test Automation |
| Current known definition ID | 161438 (discover by name each session; do not blindly hardcode) |
| Azure DevOps token resource | 499b84ac-1321-427f-aa17-267ca6975798 |
| Required setup check | scripts/Test-AzureDevOpsSetup.ps1 |
| Platforms | arm64, x64 |
| Default booleans | enableMsBuildCaching=false, useVSPreview=false, useLatestWebView2=false |
Required workflow
Read and execute references/agentic-loop.md from top to bottom. It contains:
- The required prompt-free setup preflight and bundled REST helper.
- Local-signoff and active-run preflight.
buildNowversusspecificBuildIddecision rules.- Exact queue parameters and branch targeting.
- Monitoring, failure evidence, direct Azure Test attachment downloads, and recording links.
- Tracked-run continuation, one-hour scheduled polling, and completion-notification limits.
- The three-run stabilization ledger and stop conditions.
Completion standard
A task is complete only when one of these is true:
- The run is terminal
Succeeded, all selected tests executed, and there are no failed, aborted, timed-out, error, or not-executed results. - For a monitor-only request, the run is terminal but failed, and the report includes the controlling failure, relevant logs, and available recording/artifact links.
- For a stabilization request, a terminal failed run is intermediate work. Continue the agentic loop until a later attempt succeeds, a genuine blocker prevents the next verified attempt, or the three-run/no-progress ceiling is reached.
- The three-run ceiling or no-progress rule was reached, and the agent stopped and asked the user for assistance with the full attempt ledger and evidence links.