From de852142a4250655f307e6b6ec21006fe83eb7db Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Sat, 22 Oct 2022 00:41:19 +0200 Subject: [PATCH] Speed up tests a little. --- .../WindowTests.cs | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/tests/Avalonia.IntegrationTests.Appium/WindowTests.cs b/tests/Avalonia.IntegrationTests.Appium/WindowTests.cs index 9f542c75e2..b6ac75b78e 100644 --- a/tests/Avalonia.IntegrationTests.Appium/WindowTests.cs +++ b/tests/Avalonia.IntegrationTests.Appium/WindowTests.cs @@ -85,16 +85,22 @@ namespace Avalonia.IntegrationTests.Appium } finally { - try + if (state == Controls.WindowState.FullScreen) { - _session.FindElementByAccessibilityId("WindowState").SendClick(); - _session.FindElementByName("Normal").SendClick(); - - // Wait for animations to run. - if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) - Thread.Sleep(1000); + try + { + _session.FindElementByAccessibilityId("WindowState").SendClick(); + _session.FindElementByName("Normal").SendClick(); - } catch { /* Ignore errors in cleanup */ } + // Wait for animations to run. + if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + Thread.Sleep(1000); + } + catch + { + /* Ignore errors in cleanup */ + } + } } }