mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:01:14 +08:00
DEV: add more information about failed smoke test
log the http status code and path that failed
This commit is contained in:
@ -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({
|
||||
|
Reference in New Issue
Block a user