Added new ref images
@@ -23,6 +23,7 @@ module.exports = {
|
|||||||
height: 768,
|
height: 768,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
onReadyScript: 'puppeteer/onReady.js',
|
||||||
scenarios: [
|
scenarios: [
|
||||||
...createScenariosFromUrls(urls),
|
...createScenariosFromUrls(urls),
|
||||||
{
|
{
|
||||||
@@ -55,6 +56,7 @@ module.exports = {
|
|||||||
engineOptions: {
|
engineOptions: {
|
||||||
browser: 'chromium',
|
browser: 'chromium',
|
||||||
timeout: 30000,
|
timeout: 30000,
|
||||||
|
args: ['--no-sandbox', '--disable-setuid-sandbox', '--force-device-scale-factor=1'],
|
||||||
},
|
},
|
||||||
report: ['browser'],
|
report: ['browser'],
|
||||||
debug: false,
|
debug: false,
|
||||||
|
|||||||
|
After Width: | Height: | Size: 135 KiB |
|
After Width: | Height: | Size: 100 KiB |
|
After Width: | Height: | Size: 119 KiB |
|
After Width: | Height: | Size: 340 KiB |
|
After Width: | Height: | Size: 501 KiB |
|
After Width: | Height: | Size: 124 KiB |
|
After Width: | Height: | Size: 90 KiB |
|
After Width: | Height: | Size: 457 KiB |
|
After Width: | Height: | Size: 358 KiB |
|
After Width: | Height: | Size: 225 KiB |
|
After Width: | Height: | Size: 121 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 119 KiB |
|
After Width: | Height: | Size: 532 KiB |
|
After Width: | Height: | Size: 104 KiB |
|
After Width: | Height: | Size: 353 KiB |
|
After Width: | Height: | Size: 104 KiB |
|
After Width: | Height: | Size: 929 KiB |
|
After Width: | Height: | Size: 174 KiB |
|
After Width: | Height: | Size: 174 KiB |
|
After Width: | Height: | Size: 157 KiB |
|
After Width: | Height: | Size: 473 KiB |
|
After Width: | Height: | Size: 219 KiB |
|
After Width: | Height: | Size: 111 KiB |
|
After Width: | Height: | Size: 181 KiB |
|
After Width: | Height: | Size: 236 KiB |
|
After Width: | Height: | Size: 104 KiB |
|
After Width: | Height: | Size: 140 KiB |
|
After Width: | Height: | Size: 124 KiB |
|
After Width: | Height: | Size: 121 KiB |
|
After Width: | Height: | Size: 380 KiB |
|
After Width: | Height: | Size: 455 KiB |
|
After Width: | Height: | Size: 466 KiB |
|
After Width: | Height: | Size: 122 KiB |
|
After Width: | Height: | Size: 261 KiB |
|
After Width: | Height: | Size: 122 KiB |
|
After Width: | Height: | Size: 107 KiB |
|
After Width: | Height: | Size: 135 KiB |
|
After Width: | Height: | Size: 210 KiB |
|
After Width: | Height: | Size: 96 KiB |
|
After Width: | Height: | Size: 125 KiB |
|
After Width: | Height: | Size: 110 KiB |
|
After Width: | Height: | Size: 100 KiB |
|
After Width: | Height: | Size: 104 KiB |
|
After Width: | Height: | Size: 167 KiB |
|
After Width: | Height: | Size: 99 KiB |
|
After Width: | Height: | Size: 112 KiB |
|
After Width: | Height: | Size: 313 KiB |
|
After Width: | Height: | Size: 452 KiB |
35
backstop_data/engine_scripts/puppeteer/onReady.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
module.exports = async (page, scenario, vp) => {
|
||||||
|
console.log('SCENARIO > ' + scenario.label);
|
||||||
|
|
||||||
|
await page.evaluate(async () => {
|
||||||
|
const selectors = Array.from(document.images);
|
||||||
|
await Promise.all(selectors.map(img => {
|
||||||
|
if (img.complete) return;
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
img.addEventListener('load', resolve);
|
||||||
|
img.addEventListener('error', resolve);
|
||||||
|
setTimeout(resolve, 5000);
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
|
||||||
|
await page.waitForSelector('.usa-banner__header-flag', {
|
||||||
|
visible: true,
|
||||||
|
timeout: 10000
|
||||||
|
});
|
||||||
|
|
||||||
|
await page.evaluate(() => {
|
||||||
|
const flagImg = document.querySelector('.usa-banner__header-flag');
|
||||||
|
if (flagImg && !flagImg.complete) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
flagImg.onload = resolve;
|
||||||
|
flagImg.onerror = resolve;
|
||||||
|
setTimeout(resolve, 3000);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 500));
|
||||||
|
|
||||||
|
console.log('All images loaded and layout stable for: ' + scenario.label);
|
||||||
|
};
|
||||||