From 7ace140c448dbb9ed1c2e991961cb7b1cdd548f5 Mon Sep 17 00:00:00 2001 From: James Nicholls Date: Thu, 4 Oct 2018 17:09:34 +0100 Subject: [PATCH 1/5] Add no-sandbox argument to puppeteer launch --- lib/smoke/smoke-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/smoke/smoke-test.js b/lib/smoke/smoke-test.js index b48afec..1be82c5 100644 --- a/lib/smoke/smoke-test.js +++ b/lib/smoke/smoke-test.js @@ -66,7 +66,7 @@ class SmokeTest { const crossBrowserTests = []; // https://github.com/GoogleChrome/puppeteer/issues/2377 - const launchOptions = (process.env.NODE_ENV === 'development') ? {args: ['--ignore-certificate-errors', '--enable-features=NetworkService']} : {}; + const launchOptions = (process.env.NODE_ENV === 'development') ? {args: ['--ignore-certificate-errors', '--enable-features=NetworkService', '--no-sandbox']} : {}; this.browser = await puppeteer.launch(launchOptions); for (let suiteOptions of configsToRun) { From fce29f0a775ae7d1b445cfd183a8830c9efdf35c Mon Sep 17 00:00:00 2001 From: James Nicholls Date: Thu, 4 Oct 2018 19:33:06 +0100 Subject: [PATCH 2/5] Try to get puppeteer running on heroku --- lib/smoke/smoke-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/smoke/smoke-test.js b/lib/smoke/smoke-test.js index 1be82c5..a72cd3b 100644 --- a/lib/smoke/smoke-test.js +++ b/lib/smoke/smoke-test.js @@ -66,7 +66,7 @@ class SmokeTest { const crossBrowserTests = []; // https://github.com/GoogleChrome/puppeteer/issues/2377 - const launchOptions = (process.env.NODE_ENV === 'development') ? {args: ['--ignore-certificate-errors', '--enable-features=NetworkService', '--no-sandbox']} : {}; + const launchOptions = (process.env.NODE_ENV === 'development') ? {args: ['--ignore-certificate-errors', '--enable-features=NetworkService', '--no-sandbox', '--disable-setuid-sandbox']} : {}; this.browser = await puppeteer.launch(launchOptions); for (let suiteOptions of configsToRun) { From 92ed1d3555a219cd6b5961d5ee8ee01515f66161 Mon Sep 17 00:00:00 2001 From: James Nicholls Date: Thu, 4 Oct 2018 20:02:18 +0100 Subject: [PATCH 3/5] Pass args to puppeteer launch when NODE_ENV is test as well Heroku CI sets NODE_ENV to test --- lib/smoke/smoke-test.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/smoke/smoke-test.js b/lib/smoke/smoke-test.js index a72cd3b..d0a6528 100644 --- a/lib/smoke/smoke-test.js +++ b/lib/smoke/smoke-test.js @@ -66,7 +66,9 @@ class SmokeTest { const crossBrowserTests = []; // https://github.com/GoogleChrome/puppeteer/issues/2377 - const launchOptions = (process.env.NODE_ENV === 'development') ? {args: ['--ignore-certificate-errors', '--enable-features=NetworkService', '--no-sandbox', '--disable-setuid-sandbox']} : {}; + const launchOptions = (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'development') ? + {args: ['--ignore-certificate-errors', '--enable-features=NetworkService', '--no-sandbox', '--disable-setuid-sandbox']} : + {}; this.browser = await puppeteer.launch(launchOptions); for (let suiteOptions of configsToRun) { From 663dd54ac1b368ecb93fa87388018824432e2762 Mon Sep 17 00:00:00 2001 From: James Nicholls Date: Thu, 4 Oct 2018 20:09:21 +0100 Subject: [PATCH 4/5] Really check for test this time --- lib/smoke/smoke-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/smoke/smoke-test.js b/lib/smoke/smoke-test.js index d0a6528..ca52b2a 100644 --- a/lib/smoke/smoke-test.js +++ b/lib/smoke/smoke-test.js @@ -66,7 +66,7 @@ class SmokeTest { const crossBrowserTests = []; // https://github.com/GoogleChrome/puppeteer/issues/2377 - const launchOptions = (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'development') ? + const launchOptions = (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test') ? {args: ['--ignore-certificate-errors', '--enable-features=NetworkService', '--no-sandbox', '--disable-setuid-sandbox']} : {}; this.browser = await puppeteer.launch(launchOptions); From 669dd4d5d7919bcc24f34abd9d9424ad6af70d2d Mon Sep 17 00:00:00 2001 From: James Nicholls Date: Tue, 6 Nov 2018 10:35:47 +0000 Subject: [PATCH 5/5] Pin puppeteer to 1.9 Temporary fix for https://github.com/Financial-Times/n-test/issues/92 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8b478d0..b6d7f0e 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "directly": "^2.0.6", "inquirer": "^5.0.1", "node-fetch": "^2.1.1", - "puppeteer": "^1.8.0", + "puppeteer": "1.9.0", "webdriverio": "^4.11.0" }, "devDependencies": {