Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Disable HTTPS errors for asset discovery #199

Merged
merged 2 commits into from
May 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/services/asset-discovery-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ export default class AssetDiscoveryService extends PercyClientService {
async setup() {
profile('-> assetDiscoveryService.puppeteer.launch')
this.browser = await puppeteer.launch({
args: ['--no-sandbox'],
args: [
'--no-sandbox',
'--disable-web-security',
],
ignoreHTTPSErrors: true,
handleSIGINT : false,
})
profile('-> assetDiscoveryService.puppeteer.launch')
Expand Down
8 changes: 8 additions & 0 deletions test/integration/agent-integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe('Integration test', () => {
before(async () => {
browser = await puppeteer.launch({
headless: true,
ignoreHTTPSErrors: true,
args: [
'--disable-gpu',
'--no-sandbox',
Expand Down Expand Up @@ -56,6 +57,13 @@ describe('Integration test', () => {
expect(domSnapshot).contains('Example Domain')
})

it('snapshots an invalid HTTPS site', async () => {
// maintained by the chrome team
await page.goto('https://self-signed.badssl.com/')
const domSnapshot = await snapshot(page, 'Invalid HTTPS')
expect(domSnapshot).contains('badssl.com')
})

it('snapshots a complex website with responsive images', async () => {
await page.goto('https://polaris.shopify.com/')
const domSnapshot = await snapshot(page, 'Polaris snapshot', {widths: [300, 1200]})
Expand Down