Files
Gleb KhmyznikovandCopilot 001b4f6346 [UITests][ZoomIt] Add UI tests (#50606)
## Summary of the Pull Request

Add 47 automated cases (32 UI cases and 15 fixture/helper regressions)
using `Microsoft.PowerToys.UITest.Next` and winappcli, based on the
manual checklist in #40684.

Also include a narrow Demo Type fix discovered during validation: avoid
the unnecessary Space/Backspace indentation probe in Notepad.

## PR Checklist

- [ ] **Communication:** Maintainer review pending.
- [x] Closes: #40684
- [x] **Tests:** Added coverage; all selected local and CI tests pass.
- [x] **Dev docs:** Added checklist mapping, execution guidance, and
documented automation limits.
- [x] **New binaries:** Registered the test-only executable in the
solution and existing UI-test pipeline.

N/A: Closing the linked checklist issue, localization, new shipped
binaries or installer entries, and end-user documentation changes.

## Detailed Description of the Pull Request / Additional comments

The new suite lives in `src\modules\ZoomIt\Tests\ZoomIt.UITests` and
launches ZoomIt through the PowerToys runner rather than the standalone
application.

| Area | Coverage |
|---|---|
| Settings and tray | Enable/disable changes the actual runtime
lifecycle; show/hide the Shell icon; verify the exact four tray actions
through left and right clicks; activate modes through the tray. |
| Zoom and drawing | Static and live magnification, frozen versus
updating content, drawing strokes, initial magnification, animation
setting delivery, and exit behavior. |
| Demo Type | Native file selection; exact Notepad output on empty,
indented, and populated lines; typing-speed differences; Escape
cancellation; calibrated observation rejecting virtual Space/Backspace
indentation probes. |
| Break timer | Rendered position, opacity, background image, font
changes, sound-file configuration, and a real one-minute countdown with
overtime. |
| Recording and snipping | Hotkey and tray recording paths; MP4 metadata
and decoded frames; exact clipboard bitmap dimensions and pixels;
microphone choices matched to Windows device enumeration. |
| Fixture/helper regressions | Registry backup and rollback, abandoned
initialization, absent versus empty keys, source-window startup failure,
shortcut diagnostics, and buffered pixel equivalence including cropping
and negative stride. |

Deterministic desktop and Notepad fixtures preserve test-owned state and
retain screenshots, recordings, and decoded frames for diagnosis.
Notepad spelling options are temporarily isolated and restored so
recipient-side processing is not mistaken for Demo Type output.

Registry snapshots are persisted before mutation and retained across
initialization failures, with a class-cleanup safety net. The suite must
only run on disposable test desktops because it exercises the real
ZoomIt registry store shared with the standalone application. Buffered
bitmap reads replace per-pixel native calls while preserving the
existing sampling and color predicates; snip failures report the first
mismatching coordinate and colors.

Native dialogs use a single launcher click followed by separate bounded
waits for window appearance and typed control readiness in an
HWND-scoped session. An eight-second delayed Font dialog regression
covers the slow-opening case without retrying Settings-card lookup after
the dialog starts opening.

`PowerToys.slnx` registers the project.
`.pipelines\v2\templates\job-test-project.yml` includes it in the
existing authenticated Runner/Settings IPC companion-signing selection,
with matching coverage in
`.pipelines\tests\uiTestSigningSelection.Tests.ps1`.

The product change in `src\modules\ZoomIt\ZoomIt\DemoType.cpp` skips
only the Space/Backspace probe for Notepad, which has no virtual
indentation to materialize. Other editors retain the existing probe and
the remaining indentation logic is unchanged.

The probe regression positively calibrates its observer and requires
every scripted Unicode key pair before asserting absence of probe keys.
Red/green validation produced identical final text on both binaries, but
the pre-fix native baseline failed on four extra Space/Backspace events;
the fixed binary passed with none.

Animation smoothness and audible sound playback remain manual checks;
the automated suite does not claim to validate them. The detailed
mapping is in `src\modules\ZoomIt\Tests\ZoomIt.UITests\README.md`.

## Validation Steps Performed

| Validation | Result |
|---|---|
| x64 and ARM64 Release builds | Passed |
| Windows 10, Default: 4 vCPU / 8 GB | 47/47 passed |
| Windows 11, Default: 4 vCPU / 8 GB | 47/47 passed |
| Windows 10, Constrained: 1 vCPU / 4 GB | 47/47 passed |
| Windows 11, Constrained: 1 vCPU / 4 GB | 47/47 passed |
| Scoped UI Test Automation CI: fresh product builds and build-output
runs on Windows 10 x64, Windows 11 x64, and ARM64 | 141/141 passed |
| UI-test signing-selection Pester suite | 35/35 passed |

The latest local matrix executed 188/188 cases with no skipped tests or
evidence-export errors. Both full product builds and all three
build-output CI configurations passed, including the real
font-selection, delayed-dialog, and distinguishing Notepad probe
regressions.

<img width="661" height="1082" alt="image"
src="https://github.com/user-attachments/assets/94db5b4e-2f36-40b3-816c-b3c9d4eeec05"
/>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-09-17 07:46:27 +02:00
..
…
…
…

PowerToys Modules

This section contains documentation for individual PowerToys modules, including their architecture, implementation details, and debugging tools.

Available Modules

Module Description
Advanced Paste Tool for enhanced clipboard pasting with formatting options
Always on Top Tool for pinning windows to stay on top of other windows
Awake Tool to keep your computer awake without modifying power settings
Color Picker Tool for selecting and managing colors from the screen
Command Not Found Tool suggesting package installations for missing commands
Crop and Lock Tool for cropping application windows into smaller windows or thumbnails
Environment Variables Tool for managing user and system environment variables
FancyZones (debugging tools) Window manager utility for custom window layouts
File Explorer add-ons Extensions for enhancing Windows File Explorer functionality
File Locksmith Tool for finding processes that lock files
Hosts File Editor Tool for managing the system hosts file
Image Resizer Tool for quickly resizing images within File Explorer
Keyboard Manager Tool for remapping keys and keyboard shortcuts
Mouse Utilities Collection of tools to enhance mouse and cursor functionality
Mouse Without Borders Tool for controlling multiple computers with a single mouse and keyboard
NewPlus Context menu extension for creating new files in File Explorer
Peek File preview utility for quick file content viewing
Power Rename Bulk file renaming tool with search and replace functionality
PowerToys Run (deprecation soon) Quick application launcher and search utility
Quick Accent Tool for quickly inserting accented characters and special symbols
Registry Preview Tool for visualizing and editing Registry files
Screen Ruler Tool for measuring pixel distances and color boundaries on screen
Shortcut Guide Tool for displaying Windows keyboard shortcuts when holding the Windows key
Text Extractor Tool for extracting text from images and screenshots
Workspaces Tool for saving and restoring window layouts for different projects
ZoomIt Screen zoom and annotation tool

Adding New Module Documentation

When adding documentation for a new module:

  1. Create a dedicated markdown file for the module (e.g., modulename.md)
  2. If the module has specialized debugging tools, consider creating a separate tools document (e.g., modulename-tools.md)
  3. Update this index with links to the new documentation
  4. Follow the existing documentation structure for consistency