diff --git a/lib/PuppeteerSharp.Nunit/TestExpectations/TestExpectations.local.json b/lib/PuppeteerSharp.Nunit/TestExpectations/TestExpectations.local.json index b888bf8f1..15856ef69 100644 --- a/lib/PuppeteerSharp.Nunit/TestExpectations/TestExpectations.local.json +++ b/lib/PuppeteerSharp.Nunit/TestExpectations/TestExpectations.local.json @@ -135,21 +135,6 @@ "FAIL" ] }, - { - "comment": "This is part of organizing the webdriver bidi implementation, We will remove it one by one", - "testIdPattern": "[navigation.spec] * should fail when main resources failed to load", - "platforms": [ - "darwin", - "linux", - "win32" - ], - "parameters": [ - "webDriverBiDi" - ], - "expectations": [ - "FAIL" - ] - }, { "comment": "This is part of organizing the webdriver bidi implementation, We will remove it one by one", "testIdPattern": "[navigation.spec] navigation Frame.goto*", @@ -285,21 +270,6 @@ "FAIL" ] }, - { - "comment": "This is part of organizing the webdriver bidi implementation, We will remove it one by one", - "testIdPattern": "[navigation.spec] *should fail*", - "platforms": [ - "darwin", - "linux", - "win32" - ], - "parameters": [ - "webDriverBiDi" - ], - "expectations": [ - "FAIL" - ] - }, { "comment": "This is part of organizing the webdriver bidi implementation, We will remove it one by one", "testIdPattern": "[navigation.spec] navigation Page.goBack *", diff --git a/lib/PuppeteerSharp.Tests/NavigationTests/PageGotoTests.cs b/lib/PuppeteerSharp.Tests/NavigationTests/PageGotoTests.cs index 442dcebd9..a4c73f8f8 100644 --- a/lib/PuppeteerSharp.Tests/NavigationTests/PageGotoTests.cs +++ b/lib/PuppeteerSharp.Tests/NavigationTests/PageGotoTests.cs @@ -163,7 +163,7 @@ public void ShouldFailWhenNavigatingToBadUrl() } else { - Assert.That(exception.Message, Does.Contain("invalid URL")); + Assert.That(exception.Message, Does.Contain("NS_ERROR_MALFORMED_URI")); } } diff --git a/lib/PuppeteerSharp/Bidi/BidiFrame.cs b/lib/PuppeteerSharp/Bidi/BidiFrame.cs index f7164c402..463500bc8 100644 --- a/lib/PuppeteerSharp/Bidi/BidiFrame.cs +++ b/lib/PuppeteerSharp/Bidi/BidiFrame.cs @@ -106,6 +106,10 @@ public override async Task GoToAsync(string url, NavigationOptions op { await Task.WhenAll(waitForNavigationTask, navigationTask).ConfigureAwait(false); } + catch (NavigationException) + { + throw; + } catch (Exception ex) { throw RewriteNavigationError(ex, url, options?.Timeout ?? TimeoutSettings.NavigationTimeout); @@ -244,7 +248,7 @@ private async Task NavigateAsync(string url) return; } - throw new PuppeteerException("Failed to navigate to " + url, ex); + throw new NavigationException($"Failed to navigate to {url}. {ex.Message}", url, ex); } }