From 441a52ad17f95cbea9ce415329fc668a6fad547d Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 17 May 2018 16:00:43 +1000 Subject: [PATCH] DEV: add more information about failed smoke test log the http status code and path that failed --- test/smoke_test.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/smoke_test.js b/test/smoke_test.js index f166bca4084..391a3242e96 100644 --- a/test/smoke_test.js +++ b/test/smoke_test.js @@ -14,8 +14,8 @@ const path = require('path'); (async () => { const browser = await puppeteer.launch({ - // headless: false, - // slowMo: 10, + // when debugging localy setting headless to "false" can be very helpful + headless: true, args: ["--disable-local-storage"] }); const page = await browser.newPage(); @@ -53,6 +53,16 @@ const path = require('path'); page.on('console', msg => console.log(`PAGE LOG: ${msg.text}`)); + page.setRequestInterception(true); + + page.on('request', req => { return req.continue(); }); + page.on('response', resp => { + if (resp.status !== 200) { + console.log("FAILED HTTP REQUEST TO " + resp.url + " Status is: " + resp.status); + } + return resp; + }); + if (process.env.AUTH_USER && process.env.AUTH_PASSWORD) { await exec("basic authentication", () => { return page.setExtraHTTPHeaders({