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", "testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.connect should support ignoreHTTPSErrors option",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"], "parameters": ["chrome", "webDriverBiDi"],
"expectations": ["SKIP"] "expectations": ["FAIL"]
}, },
{ {
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.connect should support targetFilter option", "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, protocol: browser.protocol,
}); });
const page = await remoteBrowser.newPage(); const page = await remoteBrowser.newPage();
let error!: Error;
const [serverRequest, response] = await Promise.all([ const [serverRequest, response] = await Promise.all([
httpsServer.waitForRequest('/empty.html'), httpsServer.waitForRequest('/empty.html'),
page.goto(httpsServer.EMPTY_PAGE).catch(error_ => { page.goto(httpsServer.EMPTY_PAGE),
return (error = error_);
}),
]); ]);
expect(error).toBeUndefined(); expect(response!.ok()).toBe(true);
expect(response.ok()).toBe(true); expect(response!.securityDetails()).toBeTruthy();
expect(response.securityDetails()).toBeTruthy();
const protocol = (serverRequest.socket as TLSSocket) const protocol = (serverRequest.socket as TLSSocket)
.getProtocol()! .getProtocol()!
.replace('v', ' '); .replace('v', ' ');
expect(response.securityDetails().protocol()).toBe(protocol); expect(response!.securityDetails()!.protocol()).toBe(protocol);
await page.close(); await page.close();
await remoteBrowser.close(); await remoteBrowser.close();
} finally { } finally {