test: fail ignoreHTTPSErrors faster (#11366)

Co-authored-by: Maksim Sadym <sadym@google.com>
This commit is contained in:
Maksim Sadym 2023-11-13 13:55:06 +01:00 committed by GitHub
parent 02d62be58e
commit d0d4ceb5fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 9 deletions

View File

@ -2133,7 +2133,7 @@
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.connect should support ignoreHTTPSErrors option",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["SKIP"]
"expectations": ["FAIL"]
},
{
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.connect should support targetFilter option",

View File

@ -700,20 +700,16 @@ describe('Launcher specs', function () {
protocol: browser.protocol,
});
const page = await remoteBrowser.newPage();
let error!: Error;
const [serverRequest, response] = await Promise.all([
httpsServer.waitForRequest('/empty.html'),
page.goto(httpsServer.EMPTY_PAGE).catch(error_ => {
return (error = error_);
}),
page.goto(httpsServer.EMPTY_PAGE),
]);
expect(error).toBeUndefined();
expect(response.ok()).toBe(true);
expect(response.securityDetails()).toBeTruthy();
expect(response!.ok()).toBe(true);
expect(response!.securityDetails()).toBeTruthy();
const protocol = (serverRequest.socket as TLSSocket)
.getProtocol()!
.replace('v', ' ');
expect(response.securityDetails().protocol()).toBe(protocol);
expect(response!.securityDetails()!.protocol()).toBe(protocol);
await page.close();
await remoteBrowser.close();
} finally {