Skip to content

Commit

Permalink
test: verify ignoreHTTPSErrors works with puppeteer.connect (#2648)
Browse files Browse the repository at this point in the history
References #2642.
  • Loading branch information
aslushnikov committed May 31, 2018
1 parent 754df58 commit 0ba72df
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/puppeteer.spec.js
Expand Up @@ -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');
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}) => {
const originalBrowser = await puppeteer.launch(defaultBrowserOptions);
const browserWSEndpoint = originalBrowser.wsEndpoint();
Expand Down

0 comments on commit 0ba72df

Please sign in to comment.