Skip to content
Snippets Groups Projects
Verified Commit f9fa2270 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

chore: work on webtests

parent b595850e
No related branches found
No related tags found
No related merge requests found
......@@ -80,8 +80,6 @@ if (!config.browser) {
const failures = await page.evaluate(() => document.getElementById('mocha-stats').querySelector('li.failures em').textContent);
const duration = await page.evaluate(() => document.getElementById('mocha-stats').querySelector('li.duration em').textContent);
const error = await page.evaluate(() => document.getElementById('mocha-errors').textContent);
console.log('Tests passed:', passes);
console.log('Tests failed:', failures);
console.log('Duration:', duration);
......@@ -92,11 +90,10 @@ if (!config.browser) {
}
await page.screenshot({ path: 'screenshot.png' });
await browser.close();
const failuresAsInt = parseInt(failures);
if (error.length > 0 || failuresAsInt > 0) {
console.error('Tests failed: ', error);
if (failuresAsInt > 0) {
console.error('Tests failed');
await page.evaluate(() => {
document.querySelectorAll('.test.fail').forEach((node) => {
......@@ -104,11 +101,12 @@ if (!config.browser) {
});
});
await browser.close();
process.exit(1);
} else {
await browser.close();
console.log('Tests passed');
}
})();
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment