From d873910f52acf693eb4bfd390eecf3f20caae464 Mon Sep 17 00:00:00 2001 From: D Budge Date: Thu, 23 Aug 2018 12:30:30 +0100 Subject: [PATCH 1/3] Ignore certificate errors https://github.com/GoogleChrome/puppeteer/issues/2377 --- 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 d62ed1c..a2ca055 100644 --- a/lib/smoke/smoke-test.js +++ b/lib/smoke/smoke-test.js @@ -65,7 +65,7 @@ class SmokeTest { const puppetTests = []; const crossBrowserTests = []; - this.browser = await puppeteer.launch(); + this.browser = await puppeteer.launch({args: ['--ignore-certificate-errors', '--enable-features=NetworkService']}); for (let suiteOptions of configsToRun) { for (let path in suiteOptions.urls) { //eslint-disable-line guard-for-in From 7926a28de09017f5b81dba48d2b0cd2d73bdd6fa Mon Sep 17 00:00:00 2001 From: D Budge Date: Thu, 23 Aug 2018 12:33:01 +0100 Subject: [PATCH 2/3] Update smoke-test.js --- lib/smoke/smoke-test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/smoke/smoke-test.js b/lib/smoke/smoke-test.js index a2ca055..eea2b47 100644 --- a/lib/smoke/smoke-test.js +++ b/lib/smoke/smoke-test.js @@ -65,6 +65,7 @@ class SmokeTest { const puppetTests = []; const crossBrowserTests = []; + // https://github.com/GoogleChrome/puppeteer/issues/2377 this.browser = await puppeteer.launch({args: ['--ignore-certificate-errors', '--enable-features=NetworkService']}); for (let suiteOptions of configsToRun) { From a2377b60a82ede8c97ae1ef40d2b2c5d163018fb Mon Sep 17 00:00:00 2001 From: Dawn Budge Date: Fri, 31 Aug 2018 11:19:28 +0100 Subject: [PATCH 3/3] Add node development for ignoring certificates --- README.md | 2 ++ lib/smoke/smoke-test.js | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index daedaae..e94132f 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,8 @@ You can also run: This allows you to select a suite of URLs (in this case, "basic"), and open them in Chromium. This is useful for manually testing a set of URLs. +If, when running locally, you are seeing errors about certificates not being valid, set NODE_ENV to be 'development' e.g. `NODE_ENV=development;n-test smoke -H http://localhost:8080`. This will use some launch options that ignore certificate errors. + ### Expectations Checking response statii is great for checking that your application responds with _something_, but not necessarily the right thing. n-test comes with a bunch of basic things that you check for. diff --git a/lib/smoke/smoke-test.js b/lib/smoke/smoke-test.js index eea2b47..71d361d 100644 --- a/lib/smoke/smoke-test.js +++ b/lib/smoke/smoke-test.js @@ -66,7 +66,8 @@ class SmokeTest { const crossBrowserTests = []; // https://github.com/GoogleChrome/puppeteer/issues/2377 - this.browser = await puppeteer.launch({args: ['--ignore-certificate-errors', '--enable-features=NetworkService']}); + const launchOptions = (process.NODE_ENV === 'development') ? {args: ['--ignore-certificate-errors', '--enable-features=NetworkService']} : {}; + this.browser = await puppeteer.launch(launchOptions); for (let suiteOptions of configsToRun) { for (let path in suiteOptions.urls) { //eslint-disable-line guard-for-in