Skip to content

Commit 80f1ffd

Browse files
author
Zhaopeng Wang (from Dev Box)
committed
add delay
1 parent 3be158d commit 80f1ffd

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/modules/fancyzones/UITests-FancyZones/LayoutApplyHotKeyTests.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -299,23 +299,20 @@ public void TestApplyHotKey()
299299
this.CloseFancyZonesEditor();
300300
this.AttachPowertoySetting();
301301
SendKeys(Key.Win, Key.Ctrl, Key.Alt, Key.Num0);
302-
Thread.Sleep(3);
303302
this.AttachFancyZonesEditor();
304303
var element = this.Find<Element>(layout);
305304
Assert.IsTrue(element.Selected, $"{element.Selected} Grid custom layout is not visible");
306305
this.CloseFancyZonesEditor();
307306
this.AttachPowertoySetting();
308307

309308
SendKeys(Key.Win, Key.Ctrl, Key.Alt, Key.Num1);
310-
Thread.Sleep(3);
311309
this.AttachFancyZonesEditor();
312310
element = this.Find<Element>("Grid-9");
313311
Assert.IsTrue(element.Selected, $"{element.Selected} Grid-9 is not visible");
314312
this.CloseFancyZonesEditor();
315313
this.AttachPowertoySetting();
316314

317315
SendKeys(Key.Win, Key.Ctrl, Key.Alt, Key.Num2);
318-
Thread.Sleep(3);
319316
this.AttachFancyZonesEditor();
320317
element = this.Find<Element>("Canvas custom layout");
321318
Assert.IsTrue(element.Selected, $"{element.Selected} Canvas custom layout is not visible");
@@ -402,8 +399,9 @@ public void HotKeyWindowFlashTest()
402399

403400
int tries = 24;
404401
Pull(tries, "down");
405-
this.Find<Group>("Enable quick layout switch").Click();
406-
var checkbox1 = this.Find<CheckBox>("Flash zones when switching layout");
402+
var switchGroup = this.Find<Group>("Enable quick layout switch");
403+
switchGroup.Click();
404+
var checkbox1 = switchGroup.Find<Element>("Flash zones when switching layout");
407405
if (checkbox1.GetAttribute("Toggle.ToggleState") == "0")
408406
{
409407
checkbox1.Click();
@@ -610,11 +608,12 @@ private void AttachPowertoySetting()
610608

611609
private void AttachFancyZonesEditor()
612610
{
613-
Task.Delay(1000).Wait();
611+
Task.Delay(4000).Wait();
614612
this.Find<Button>("Launch layout editor").Click();
615613

616614
Task.Delay(3000).Wait();
617615
this.Session.Attach(PowerToysModule.FancyZone);
616+
Task.Delay(3000).Wait();
618617
}
619618

620619
private void CloseFancyZonesEditor()

0 commit comments

Comments
 (0)