From 60df6ee2244efb86cb07db2ba08b8885fa4ff522 Mon Sep 17 00:00:00 2001 From: "Zhaopeng Wang (from Dev Box)" Date: Mon, 28 Apr 2025 07:02:09 +0800 Subject: [PATCH] fix pipeline error --- .../UITests-FancyZones/LayoutApplyHotKeyTests.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/modules/fancyzones/UITests-FancyZones/LayoutApplyHotKeyTests.cs b/src/modules/fancyzones/UITests-FancyZones/LayoutApplyHotKeyTests.cs index 19217de838..2a97690b43 100644 --- a/src/modules/fancyzones/UITests-FancyZones/LayoutApplyHotKeyTests.cs +++ b/src/modules/fancyzones/UITests-FancyZones/LayoutApplyHotKeyTests.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; +using System.Windows.Automation; using FancyZonesEditor.Models; using FancyZonesEditorCommon.Data; using Microsoft.FancyZonesEditor.UITests; @@ -540,7 +541,14 @@ namespace Microsoft.FancyZones.UITests UITestBase.NativeMethods.ChangeDispalyResolution(width, height); this.AttachPowertoySetting(); this.AttachFancyZonesEditor(); - Session.Find(By.AccessibilityId("Monitors")).Find("Monitor 1").Find($"{width} x {height}"); + var resolution = this.Session.Find(By.AccessibilityId("Monitors")).Find("Monitor 1").Find(By.AccessibilityId("ResolutionText")); + if (resolution.Text != "640 × 480") + { + this.CloseFancyZonesEditor(); + UITestBase.NativeMethods.ChangeDispalyResolution(nowWidth, nowHeight); + Assert.AreEqual("640 × 480", resolution.Text); + } + this.CloseFancyZonesEditor(); UITestBase.NativeMethods.ChangeDispalyResolution(nowWidth, nowHeight); }