Skip to content

Commit 66f2267

Browse files
authored
Bidi: Pass navigation should fail tests (#2837)
* Bidi: Pass navigation should fail tests * Update a test for bidi
1 parent dba0f89 commit 66f2267

File tree

3 files changed

+6
-32
lines changed

3 files changed

+6
-32
lines changed

lib/PuppeteerSharp.Nunit/TestExpectations/TestExpectations.local.json

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -135,21 +135,6 @@
135135
"FAIL"
136136
]
137137
},
138-
{
139-
"comment": "This is part of organizing the webdriver bidi implementation, We will remove it one by one",
140-
"testIdPattern": "[navigation.spec] * should fail when main resources failed to load",
141-
"platforms": [
142-
"darwin",
143-
"linux",
144-
"win32"
145-
],
146-
"parameters": [
147-
"webDriverBiDi"
148-
],
149-
"expectations": [
150-
"FAIL"
151-
]
152-
},
153138
{
154139
"comment": "This is part of organizing the webdriver bidi implementation, We will remove it one by one",
155140
"testIdPattern": "[navigation.spec] navigation Frame.goto*",
@@ -285,21 +270,6 @@
285270
"FAIL"
286271
]
287272
},
288-
{
289-
"comment": "This is part of organizing the webdriver bidi implementation, We will remove it one by one",
290-
"testIdPattern": "[navigation.spec] *should fail*",
291-
"platforms": [
292-
"darwin",
293-
"linux",
294-
"win32"
295-
],
296-
"parameters": [
297-
"webDriverBiDi"
298-
],
299-
"expectations": [
300-
"FAIL"
301-
]
302-
},
303273
{
304274
"comment": "This is part of organizing the webdriver bidi implementation, We will remove it one by one",
305275
"testIdPattern": "[navigation.spec] navigation Page.goBack *",

lib/PuppeteerSharp.Tests/NavigationTests/PageGotoTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public void ShouldFailWhenNavigatingToBadUrl()
163163
}
164164
else
165165
{
166-
Assert.That(exception.Message, Does.Contain("invalid URL"));
166+
Assert.That(exception.Message, Does.Contain("NS_ERROR_MALFORMED_URI"));
167167
}
168168
}
169169

lib/PuppeteerSharp/Bidi/BidiFrame.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ public override async Task<IResponse> GoToAsync(string url, NavigationOptions op
106106
{
107107
await Task.WhenAll(waitForNavigationTask, navigationTask).ConfigureAwait(false);
108108
}
109+
catch (NavigationException)
110+
{
111+
throw;
112+
}
109113
catch (Exception ex)
110114
{
111115
throw RewriteNavigationError(ex, url, options?.Timeout ?? TimeoutSettings.NavigationTimeout);
@@ -244,7 +248,7 @@ private async Task NavigateAsync(string url)
244248
return;
245249
}
246250

247-
throw new PuppeteerException("Failed to navigate to " + url, ex);
251+
throw new NavigationException($"Failed to navigate to {url}. {ex.Message}", url, ex);
248252
}
249253
}
250254

0 commit comments

Comments
 (0)