From 996ff678f2805075c81717257c98219dcbb62505 Mon Sep 17 00:00:00 2001 From: jbe2277 Date: Tue, 24 Sep 2024 21:35:38 +0200 Subject: [PATCH] UITest: Use DefaultTimeout * 2 for FirstModalWindow to improve stability --- src/Samples.UITest/UITest.Core/UITestHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Samples.UITest/UITest.Core/UITestHelper.cs b/src/Samples.UITest/UITest.Core/UITestHelper.cs index c0e06383..c3125203 100644 --- a/src/Samples.UITest/UITest.Core/UITestHelper.cs +++ b/src/Samples.UITest/UITest.Core/UITestHelper.cs @@ -51,7 +51,7 @@ public static Menu ShowContextMenu(this AutomationElement element) public static Window FirstModalWindow(this Window window, TimeSpan? timeout = null) { - var result = Retry.WhileEmpty(() => window.ModalWindows, timeout); + var result = Retry.WhileEmpty(() => window.ModalWindows, timeout ?? Retry.DefaultTimeout * 2); return result?.Result?.FirstOrDefault() ?? throw new ElementNotFoundException($"First modal dialog was not found for window '{window.TryAutomationId()}'"); }