From 696e3bc96d89f50b68178725c3c1f4e1cf809b46 Mon Sep 17 00:00:00 2001 From: Jerome Laban Date: Thu, 3 Oct 2024 22:37:24 -0400 Subject: [PATCH] test: Adjust test duration for navigation On iOS simulators on CI, the navigation can be very slow. --- .../Microsoft_UI_Xaml_Controls/Given_WebView2.cs | 14 +++++++------- .../Windows_UI_Xaml_Controls/Given_WebView.cs | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Uno.UI.RuntimeTests/Tests/Microsoft_UI_Xaml_Controls/Given_WebView2.cs b/src/Uno.UI.RuntimeTests/Tests/Microsoft_UI_Xaml_Controls/Given_WebView2.cs index b3f1f8f8c538..ad1dd0413d0b 100644 --- a/src/Uno.UI.RuntimeTests/Tests/Microsoft_UI_Xaml_Controls/Given_WebView2.cs +++ b/src/Uno.UI.RuntimeTests/Tests/Microsoft_UI_Xaml_Controls/Given_WebView2.cs @@ -75,14 +75,14 @@ public async Task When_NavigateToString() webView.NavigationCompleted += (s, e) => navigationDone = true; webView.Source = uri; Assert.IsNotNull(webView.Source); - await TestServices.WindowHelper.WaitFor(() => navigationStarting, 3000); - await TestServices.WindowHelper.WaitFor(() => navigationDone, 3000); + await TestServices.WindowHelper.WaitFor(() => navigationStarting, 10000); + await TestServices.WindowHelper.WaitFor(() => navigationDone, 10000); Assert.IsNotNull(webView.Source); navigationStarting = false; navigationDone = false; webView.NavigateToString(""); - await TestServices.WindowHelper.WaitFor(() => navigationStarting, 3000); - await TestServices.WindowHelper.WaitFor(() => navigationDone, 3000); + await TestServices.WindowHelper.WaitFor(() => navigationStarting, 10000); + await TestServices.WindowHelper.WaitFor(() => navigationDone, 10000); Assert.AreEqual(new Uri("about:blank"), webView.Source); } @@ -107,7 +107,7 @@ public async Task When_GoBack() webView.NavigationCompleted += (sender, e) => navigated = true; webView.CoreWebView2.Navigate("https://uno-assets.platform.uno/tests/docs/WebView_NavigateToAnchor.html"); - await TestServices.WindowHelper.WaitFor(() => navigated, 3000); + await TestServices.WindowHelper.WaitFor(() => navigated, 10000); Assert.IsFalse(webView.CoreWebView2.CanGoBack); Assert.IsFalse(webView.CanGoBack); @@ -116,14 +116,14 @@ public async Task When_GoBack() navigated = false; webView.CoreWebView2.Navigate("https://platform.uno"); - await TestServices.WindowHelper.WaitFor(() => navigated, 3000); + await TestServices.WindowHelper.WaitFor(() => navigated, 10000); Assert.IsTrue(webView.CoreWebView2.CanGoBack); Assert.IsTrue(webView.CanGoBack); navigated = false; webView.GoBack(); - await TestServices.WindowHelper.WaitFor(() => navigated, 3000); + await TestServices.WindowHelper.WaitFor(() => navigated, 10000); Assert.IsFalse(webView.CoreWebView2.CanGoBack); Assert.IsFalse(webView.CanGoBack); diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_WebView.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_WebView.cs index 0fb127a45582..1dc37f707002 100644 --- a/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_WebView.cs +++ b/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_WebView.cs @@ -142,20 +142,20 @@ public async Task When_GoBack() webView.NavigationCompleted += (sender, e) => navigated = true; webView.Navigate(new Uri("https://uno-assets.platform.uno/tests/docs/WebView_NavigateToAnchor.html")); - await TestServices.WindowHelper.WaitFor(() => navigated, 3000); + await TestServices.WindowHelper.WaitFor(() => navigated, 10000); Assert.IsFalse(webView.CanGoBack); Assert.IsFalse(webView.CanGoForward); navigated = false; webView.Navigate(new Uri("https://platform.uno")); - await TestServices.WindowHelper.WaitFor(() => navigated, 3000); + await TestServices.WindowHelper.WaitFor(() => navigated, 10000); Assert.IsTrue(webView.CanGoBack); navigated = false; webView.GoBack(); - await TestServices.WindowHelper.WaitFor(() => navigated, 3000); + await TestServices.WindowHelper.WaitFor(() => navigated, 10000); Assert.IsFalse(webView.CanGoBack); Assert.IsTrue(webView.CanGoForward);