change code

This commit is contained in:
Zhaopeng Wang (from Dev Box)
2025-05-26 21:47:43 +08:00
parent ed209520a3
commit 72b424fb4e
2 changed files with 10 additions and 6 deletions

View File

@@ -344,7 +344,7 @@ namespace UITests_FancyZones
// Attach FancyZones Editor
this.AttachPowertoySetting();
this.Find<Pane>(By.ClassName("InputNonClientPointerSource")).Click();
this.OpenFancyZonesPanel();
this.OpenFancyZonesPanel(isMax: false);
this.AttachFancyZonesEditor();
var element = this.Find<Element>("Grid custom layout");
Assert.IsTrue(element.Selected, "Grid custom layout is not visible");
@@ -550,7 +550,7 @@ namespace UITests_FancyZones
Clean();
}
private void OpenFancyZonesPanel(bool launchAsAdmin = false)
private void OpenFancyZonesPanel(bool launchAsAdmin = false, bool isMax = true)
{
var windowingElement = this.Find<NavigationViewItem>("Windowing & Layouts");
@@ -563,7 +563,11 @@ namespace UITests_FancyZones
windowingElement.Find<Element>("FancyZones").Click();
this.Find<ToggleSwitch>("Enable FancyZones").Toggle(true);
this.Find<Button>("Maximize").Click(); // maximize the window
if (isMax == true)
{
this.Find<Button>("Maximize").Click(); // maximize the window
}
this.Find<Custom>("Editor").Find<TextBlock>(By.AccessibilityId("HeaderPresenter")).Click();
}

View File

@@ -34,9 +34,6 @@ namespace UITests_FancyZones
// kill all processes related to FancyZones Editor to ensure a clean state
Session.KillAllProcessesByName("PowerToys.FancyZonesEditor");
// get PowerToys window Name
powertoysWindowName = ZoneSwitchHelper.GetActiveWindowTitle();
// clear the app zone history
AppZoneHistory.DeleteFile();
FancyZonesEditorHelper.Files.CustomLayoutsIOHelper.DeleteFile();
@@ -46,6 +43,9 @@ namespace UITests_FancyZones
// set a custom layout with 2 subzones
SetupCustomLayouts();
// get PowerToys window Name
powertoysWindowName = ZoneSwitchHelper.GetActiveWindowTitle();
// Launch FancyZones
LaunchFancyZones();