mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
test: verify ignoreHTTPSErrors works with puppeteer.connect (#2648)
References #2642.
This commit is contained in:
parent
754df58d4e
commit
0ba72df67d
@ -301,6 +301,21 @@ module.exports.addTests = function({testRunner, expect, PROJECT_ROOT, defaultBro
|
|||||||
expect(await secondPage.evaluate(() => 7 * 6)).toBe(42, 'original browser should still work');
|
expect(await secondPage.evaluate(() => 7 * 6)).toBe(42, 'original browser should still work');
|
||||||
await originalBrowser.close();
|
await originalBrowser.close();
|
||||||
});
|
});
|
||||||
|
it('should support ignoreHTTPSErrors option', async({httpsServer}) => {
|
||||||
|
const originalBrowser = await puppeteer.launch(defaultBrowserOptions);
|
||||||
|
const browserWSEndpoint = originalBrowser.wsEndpoint();
|
||||||
|
|
||||||
|
const browser = await puppeteer.connect({browserWSEndpoint, ignoreHTTPSErrors: true});
|
||||||
|
const page = await browser.newPage();
|
||||||
|
let error = null;
|
||||||
|
const response = await page.goto(httpsServer.EMPTY_PAGE).catch(e => error = e);
|
||||||
|
expect(error).toBe(null);
|
||||||
|
expect(response.ok()).toBe(true);
|
||||||
|
expect(response.securityDetails()).toBeTruthy();
|
||||||
|
expect(response.securityDetails().protocol()).toBe('TLS 1.2');
|
||||||
|
await page.close();
|
||||||
|
await browser.close();
|
||||||
|
});
|
||||||
it('should be able to reconnect to a disconnected browser', async({server}) => {
|
it('should be able to reconnect to a disconnected browser', async({server}) => {
|
||||||
const originalBrowser = await puppeteer.launch(defaultBrowserOptions);
|
const originalBrowser = await puppeteer.launch(defaultBrowserOptions);
|
||||||
const browserWSEndpoint = originalBrowser.wsEndpoint();
|
const browserWSEndpoint = originalBrowser.wsEndpoint();
|
||||||
|
Loading…
Reference in New Issue
Block a user