mirror of
https://github.com/element-hq/element-web
synced 2024-10-26 20:55:56 +03:00
output document html on error and dont make a screenshot on submit
This commit is contained in:
parent
e50420dd1b
commit
a5c8911445
2 changed files with 13 additions and 2 deletions
13
start.js
13
start.js
|
@ -30,6 +30,7 @@ global.browser = null;
|
||||||
|
|
||||||
let consoleLogs = null;
|
let consoleLogs = null;
|
||||||
let xhrLogs = null;
|
let xhrLogs = null;
|
||||||
|
let globalPage = null;
|
||||||
|
|
||||||
async function runTests() {
|
async function runTests() {
|
||||||
console.log("running tests ...");
|
console.log("running tests ...");
|
||||||
|
@ -39,6 +40,7 @@ async function runTests() {
|
||||||
}
|
}
|
||||||
global.browser = await puppeteer.launch(options);
|
global.browser = await puppeteer.launch(options);
|
||||||
const page = await helpers.newPage();
|
const page = await helpers.newPage();
|
||||||
|
globalPage = page;
|
||||||
|
|
||||||
consoleLogs = helpers.logConsole(page);
|
consoleLogs = helpers.logConsole(page);
|
||||||
xhrLogs = helpers.logXHRRequests(page);
|
xhrLogs = helpers.logXHRRequests(page);
|
||||||
|
@ -66,12 +68,21 @@ function onSuccess() {
|
||||||
console.log('all tests finished successfully');
|
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('failure: ', err);
|
||||||
console.log('console.log output:');
|
console.log('console.log output:');
|
||||||
console.log(consoleLogs.logs());
|
console.log(consoleLogs.logs());
|
||||||
console.log('XHR requests:');
|
console.log('XHR requests:');
|
||||||
console.log(xhrLogs.logs());
|
console.log(xhrLogs.logs());
|
||||||
|
console.log('document html:');
|
||||||
|
console.log(documentHtml);
|
||||||
|
|
||||||
process.exit(-1);
|
process.exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ module.exports = async function signup(page, username, password, homeserver) {
|
||||||
const error_text = await helpers.tryGetInnertext(page, '.mx_Login_error');
|
const error_text = await helpers.tryGetInnertext(page, '.mx_Login_error');
|
||||||
assert.strictEqual(!!error_text, false);
|
assert.strictEqual(!!error_text, false);
|
||||||
//submit form
|
//submit form
|
||||||
await page.screenshot({path: "beforesubmit.png", fullPage: true});
|
//await page.screenshot({path: "beforesubmit.png", fullPage: true});
|
||||||
await registerButton.click();
|
await registerButton.click();
|
||||||
|
|
||||||
//confirm dialog saying you cant log back in without e-mail
|
//confirm dialog saying you cant log back in without e-mail
|
||||||
|
|
Loading…
Reference in a new issue