@@ -54,7 +54,6 @@ public void TestInitialize()
54
54
ClearOpenWindows ( ) ;
55
55
56
56
// clean app zone history file
57
- FancyZonesEditorHelper . Files . CustomLayoutsIOHelper . DeleteFile ( ) ;
58
57
AppZoneHistory . DeleteFile ( ) ;
59
58
this . RestartScopeExe ( ) ;
60
59
FancyZonesEditorHelper . Files . Restore ( ) ;
@@ -366,27 +365,26 @@ private void LaunchFancyZones()
366
365
this . Scroll ( 6 , "Down" ) ; // Pull the settings page up to make sure the settings are visible
367
366
ZoneBehaviourSettings ( TestContext . TestName ) ;
368
367
369
- this . Find < Microsoft . PowerToys . UITest . Button > ( "Launch layout editor" ) . Click ( false , 500 , 5000 ) ;
368
+ this . Find < Microsoft . PowerToys . UITest . Button > ( "Launch layout editor" ) . Click ( false , 500 , 10000 ) ;
370
369
string customLayoutData = FancyZonesEditorHelper . Files . CustomLayoutsIOHelper . GetData ( ) ;
370
+ this . Session . Attach ( PowerToysModule . FancyZone ) ;
371
371
372
372
// pipeline machine may have an unstable delays, causing the custom layout to be unavailable as we set. then A retry is required.
373
373
// Console.WriteLine($"after launch, Custom layout data: {customLayoutData}");
374
- if ( customLayoutData == setCustomLayoutData )
374
+ try
375
375
{
376
- this . Session . Attach ( PowerToysModule . FancyZone ) ;
377
376
this . Find < Microsoft . PowerToys . UITest . Button > ( "Maximize" ) . Click ( ) ;
378
- Task . Delay ( 1000 ) . Wait ( ) ; // Optional: Wait for a moment to ensure the window is in position
379
377
380
378
// Set the FancyZones layout to a custom layout
381
379
this . Find < Element > ( By . Name ( "Custom Column" ) ) . Click ( ) ;
382
380
}
383
- else
381
+ catch ( Exception ex )
384
382
{
385
- // Console.WriteLine($"[Exception] Failed to attach to FancyZones window. Retrying...");
383
+ Console . WriteLine ( $ "[Exception] Failed to attach to FancyZones window. Retrying...{ ex . ToString ( ) } ") ;
386
384
this . Find < Microsoft . PowerToys . UITest . Button > ( "Close" ) . Click ( ) ;
387
385
this . Session . Attach ( PowerToysModule . PowerToysSettings ) ;
388
386
SetupCustomLayouts ( ) ;
389
- this . Find < Microsoft . PowerToys . UITest . Button > ( "Launch layout editor" ) . Click ( false , 500 , 5000 ) ;
387
+ this . Find < Microsoft . PowerToys . UITest . Button > ( "Launch layout editor" ) . Click ( false , 5000 , 5000 ) ;
390
388
this . Session . Attach ( PowerToysModule . FancyZone ) ;
391
389
this . Find < Microsoft . PowerToys . UITest . Button > ( "Maximize" ) . Click ( ) ;
392
390
0 commit comments