[Settings] Add UI smoke test that visits every shell NavigationView item#48411
Closed
crutkas wants to merge 1 commit into
Closed
[Settings] Add UI smoke test that visits every shell NavigationView item#48411crutkas wants to merge 1 commit into
crutkas wants to merge 1 commit into
Conversation
Drives PowerToys.Settings.exe end-to-end via WinAppDriver and asserts the Settings process stays alive after navigating to every shell NavigationView item. Covers Dashboard, General, and every module page across the System tools, Windowing and layouts, Input/Output, File management, and Advanced groups. This is the runtime counterpart to the unit tests on ShellViewModel.HandleNavigationFailure. Unit tests cannot exercise NavigationFailedEventArgs (sealed WinRT type) so any regression that re-introduces a throw from Frame_NavigationFailed - or breaks a module page constructor - can only be caught by actually attempting navigation against a running WinUI Frame. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
Replacing this with a winapp CLI-based version that does not depend on WinAppDriver/Appium. Will open a follow-up PR shortly with the same coverage on the new framework. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a WinAppDriver smoke test that drives the real
PowerToys.Settings.exethrough every NavigationView item in the shell and asserts the Settings process stays alive after each navigation. This is the runtime counterpart to the unit tests being added forShellViewModel.HandleNavigationFailure- the unit tests prove the helper does not throw for null inputs, this UI test proves no page in the shell triggers a navigation-failure path that crashes the process.Background
The Settings shell wires
Frame.NavigationFailedto a handler that, in the past, simply re-threwe.Exception. Throwing from aNavigationFailedhandler propagates back through the WinRT marshalling layer as a stowed exception and the runtime tears the process down viaRoFailFastWithErrorContextInternal2. A regression of this kind inShellViewModel.Frame_NavigationFailedis invisible to the existingSettings.UI.UnitTestsbecauseNavigationFailedEventArgsis a sealed WinRT type that cannot be constructed from MSTest - the failure can only be observed by actually attempting navigation against a running WinUI Frame.This UI test fills that gap: any future change that re-introduces a throw from
Frame_NavigationFailed, or breaks a module page's constructor, will turn this test red instead of shipping to users.Change
New file:
src/settings-ui/UITest-Settings/NavigationSmokeTests.cs.NavigationSmokeTestsderiving fromMicrosoft.PowerToys.UITest.UITestBase, scoped toPowerToysModule.PowerToysSettings.(ParentGroupId, ItemId)tuples covering all NavigationView items in the shell (Dashboard, General, plus every module under System tools, Windowing & layouts, Input / Output, File management, Advanced). Items reference UIAAutomationIdrather thanContent, so the test is localization-independent.AllNavigationViewItems_NavigateWithoutCrashingiterates the list, expands each parent group on first encounter, clicks each item, and assertsIsWindowOpen("Settings")returns true after every navigation.Validation
MSBuild src\settings-ui\UITest-Settings\UITest-Settings.csproj /p:Configuration=Release /p:Platform=x64builds clean.The UITest project has
<RunVSTest>false</RunVSTest>so it does not execute as part of normal MSBuild PR validation - it runs in the dedicated UI-test pipeline alongside the existingSettingsTestsandOOBEUITests. The test follows the same patterns those existing classes use (UITestBaseconstructor scope,Find<NavigationViewItem>(...)for element lookup,Task.Delayfor navigation settle).Notes
AutoSuggestBox(x:Name="SearchBox",x:Uid="Shell_SearchBox") and asserting on free-text query navigation, which deserves its own test class once we settle on the right pattern for typed text in WinAppDriver. The navigation-item smoke is the highest-value first cut.