Skip to content

[winappcli] Add Command Palette UI test suite (winappCli-driven)#48788

Draft
LegendaryBlair wants to merge 2 commits into
microsoft:mainfrom
LegendaryBlair:legendaryblair/winappcli-cmdpal
Draft

[winappcli] Add Command Palette UI test suite (winappCli-driven)#48788
LegendaryBlair wants to merge 2 commits into
microsoft:mainfrom
LegendaryBlair:legendaryblair/winappcli-cmdpal

Conversation

@LegendaryBlair

Copy link
Copy Markdown
Contributor

Summary

Adds a PowerShell-only UI test suite that drives the PowerToys Command Palette (CmdPal) module via Microsoft's winappCli UI-Automation client, translating the manual release-checklist boxes into runnable assertions.

This PR is intentionally focused on Command Palette as a worked example of the winappcli approach, so it can serve as a template for porting other modules.

What's included

  • WinAppCli.PowerToys/ — shared helper module (test harness, PT settings read/write, shared-event signalling, UIA actions, asserts, lifecycle).
  • modules/_shared/Assertions.ps1 — uniform Assert-* vocabulary.
  • modules/command-palette-checklist.ps1 — CmdPal orchestrator / entry point with -Only / -Skip / -Tag filtering.
  • modules/cmdpal/ — 24 per-provider test files (Calculator, Files, WebSearch, System, Shell, Registry, Dock/Pin, Settings-UI, stability, mutation, …) plus CmdPal-specific helpers.
  • DocsREADME.md, AAA-PATTERN-CONVENTION.md, command-palette-099-coverage-gaps.md.

How it runs

The suite runs against an installed PowerToys (winget / AppX) and does not build the product. Prerequisites: winappCli ≥ 0.3.1, PowerShell 7.2+, PowerToys with CmdPal enabled.

cd tools\winappcli
pwsh -File .\modules\command-palette-checklist.ps1 -Only 'CmdPal_Installed_*'   # smoke (<1s)
pwsh -File .\modules\command-palette-checklist.ps1 -Tag schema                  # CI gate (~2s)
pwsh -File .\modules\command-palette-checklist.ps1                              # full suite

Validation

Verified locally against CmdPal 0.11.11561.0 with winappCli 0.3.1:

  • CmdPal_Installed_*PASS 1 · FAIL 0
  • CmdPal_Calculator_* (functional, drives the live UI end-to-end: typing, invoking, clipboard + on-disk history assertions) → PASS 6 · FAIL 0

Draft: opening for early feedback on the approach and folder structure before expanding to additional modules.

Adds a PowerShell-only UI test suite that drives the PowerToys Command
Palette (CmdPal) module via Microsoft's winappCli UI-Automation client and
translates the manual release-checklist boxes into runnable assertions.

Contents (focused on CmdPal as a worked example):
- WinAppCli.PowerToys: shared helper module (test harness, PT settings,
  shared events, UIA actions, asserts, lifecycle).
- modules/_shared/Assertions.ps1: uniform Assert-* vocabulary.
- modules/command-palette-checklist.ps1: CmdPal orchestrator entry point
  with -Only/-Skip/-Tag filtering.
- modules/cmdpal/: 24 per-provider test files + CmdPal-specific helpers.
- Supporting docs: README, AAA-PATTERN-CONVENTION, 0.99 coverage-gaps.

The suite runs against an installed PowerToys (winget/AppX); it does not
build the product. Verified locally against CmdPal 0.11 with winappCli
0.3.1: CmdPal_Installed_* and all 6 CmdPal_Calculator_* functional tests
pass (0 failures).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the Product-Command Palette Refers to the Command Palette utility label Jun 22, 2026
Reachability analysis (direct + transitive call graph) from the CmdPal
orchestrator, test files and helpers showed 4 function files in
WinAppCli.PowerToys are never reached by the suite:

- 05-PtSettingsJson.ps1  (CmdPal mutation tests use their own
  cmdpal/helpers/cmdpal-settings.ps1 backup/restore, not the generic Tier-B
  Backup-/Restore-/Set-PtSettingJson)
- 11-MouseInput.ps1      (no mouse simulation in CmdPal tests)
- 13-Asserts.ps1         (Assert-Eventually* — CmdPal uses Wait-Until +
  the _shared Assert-* vocabulary instead)
- 14-Lifecycle.ps1       (Use-ClipboardSnapshot / New-FreshAppX unused;
  CmdPal uses Use-CmdPalClipboardSnapshot)

Removed the files and their entries from FunctionsToExport. Module still
imports cleanly (63 functions); CmdPal_Installed_* + all CmdPal_Calculator_*
tests still pass (7 PASS / 0 FAIL).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Product-Command Palette Refers to the Command Palette utility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant