mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 00:16:15 -04:00
frontend tests: add helper.logDebugMsg function to help get information from tests that do not have support for console.json on SauceLabs
This commit is contained in:
parent
ca4cc2d7c0
commit
c228283c17
4 changed files with 23 additions and 0 deletions
|
@ -226,3 +226,15 @@ helper.clearPad = async () => {
|
||||||
await helper.waitForPromise(() => helper.commits.length > commitsBefore);
|
await helper.waitForPromise(() => helper.commits.length > commitsBefore);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Writes to an (hidden) element which is dropped into the console output of a workflow run
|
||||||
|
*
|
||||||
|
* This is useful for debugging failed tests when there is no console log output available on
|
||||||
|
* SauceLabs (e.g. Safari)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
helper.logDebugMsg = (msg) => {
|
||||||
|
const elem = $('#debuglogs');
|
||||||
|
elem.append(`\n${msg}`);
|
||||||
|
};
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="console"></div>
|
<div id="console"></div>
|
||||||
|
<div id="debuglogs"></div>
|
||||||
<div id="split-view">
|
<div id="split-view">
|
||||||
<div id="mocha"></div>
|
<div id="mocha"></div>
|
||||||
<div id="separator"></div>
|
<div id="separator"></div>
|
||||||
|
|
|
@ -13,6 +13,10 @@ body {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#debuglogs {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
#split-view {
|
#split-view {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
|
@ -54,6 +54,11 @@ const sauceTestWorker = async.queue(async ({name, pfx, testSettings}) => {
|
||||||
.setFirefoxOptions(firefoxOptions)
|
.setFirefoxOptions(firefoxOptions)
|
||||||
.build();
|
.build();
|
||||||
const url = `https://saucelabs.com/jobs/${(await driver.getSession()).getId()}`;
|
const url = `https://saucelabs.com/jobs/${(await driver.getSession()).getId()}`;
|
||||||
|
const debugOutput = () => {
|
||||||
|
const console = document.getElementById('debuglogs'); // eslint-disable-line no-undef
|
||||||
|
if (console == null) return '';
|
||||||
|
return console.innerText;
|
||||||
|
};
|
||||||
try {
|
try {
|
||||||
await driver.get('http://localhost:9001/tests/frontend/');
|
await driver.get('http://localhost:9001/tests/frontend/');
|
||||||
log(`Remote sauce test started! ${url}`, pfx);
|
log(`Remote sauce test started! ${url}`, pfx);
|
||||||
|
@ -89,6 +94,7 @@ const sauceTestWorker = async.queue(async ({name, pfx, testSettings}) => {
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
log(`Remote sauce test finished! ${url}`, pfx);
|
log(`Remote sauce test finished! ${url}`, pfx);
|
||||||
|
log(`Debug logs of ${pfx}: ${await driver.executeScript(debugOutput)}`);
|
||||||
await driver.quit();
|
await driver.quit();
|
||||||
}
|
}
|
||||||
}, 6); // run 6 tests in parrallel
|
}, 6); // run 6 tests in parrallel
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue