Skip to content

Commit

Permalink
Bidi: Pass navigation should fail tests (#2837)
Browse files Browse the repository at this point in the history
* Bidi: Pass navigation should fail tests

* Update a test for bidi
  • Loading branch information
kblok authored Dec 5, 2024
1 parent dba0f89 commit 66f2267
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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*",
Expand Down Expand Up @@ -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 *",
Expand Down
2 changes: 1 addition & 1 deletion lib/PuppeteerSharp.Tests/NavigationTests/PageGotoTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
}

Expand Down
6 changes: 5 additions & 1 deletion lib/PuppeteerSharp/Bidi/BidiFrame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ public override async Task<IResponse> 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);
Expand Down Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 66f2267

Please sign in to comment.