output document html on error and dont make a screenshot on submit

pull/21833/head
Bruno Windels 2018-07-27 20:01:13 +02:00
parent e50420dd1b
commit a5c8911445
2 changed files with 13 additions and 2 deletions

View File

@ -30,6 +30,7 @@ global.browser = null;
let consoleLogs = null;
let xhrLogs = null;
let globalPage = null;
async function runTests() {
console.log("running tests ...");
@ -39,6 +40,7 @@ async function runTests() {
}
global.browser = await puppeteer.launch(options);
const page = await helpers.newPage();
globalPage = page;
consoleLogs = helpers.logConsole(page);
xhrLogs = helpers.logXHRRequests(page);
@ -66,12 +68,21 @@ function onSuccess() {
console.log('all tests finished successfully');
}
function onFailure(err) {
async function onFailure(err) {
let documentHtml = "no page";
if (globalPage) {
documentHtml = await globalPage.content();
}
console.log('failure: ', err);
console.log('console.log output:');
console.log(consoleLogs.logs());
console.log('XHR requests:');
console.log(xhrLogs.logs());
console.log('document html:');
console.log(documentHtml);
process.exit(-1);
}

View File

@ -55,7 +55,7 @@ module.exports = async function signup(page, username, password, homeserver) {
const error_text = await helpers.tryGetInnertext(page, '.mx_Login_error');
assert.strictEqual(!!error_text, false);
//submit form
await page.screenshot({path: "beforesubmit.png", fullPage: true});
//await page.screenshot({path: "beforesubmit.png", fullPage: true});
await registerButton.click();
//confirm dialog saying you cant log back in without e-mail