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); }