Skip to content

Commit

Permalink
test: Adjust test duration for navigation
Browse files Browse the repository at this point in the history
On iOS simulators on CI, the navigation can be very slow.
  • Loading branch information
jeromelaban committed Oct 4, 2024
1 parent 622ed96 commit 696e3bc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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("<html></html>");
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);
}

Expand All @@ -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);
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 696e3bc

Please sign in to comment.