Skip to content

Commit 1d720f2

Browse files
committed
r-oldenburg -- fix for intermittent false failures
see #1344 "found a solution to several randomly appearing problems that we encountered, whenever we switched to a Backstop (docker) version > 4.4.2."
1 parent 59423e0 commit 1d720f2

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

core/util/runPuppet.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ async function captureScreenshot (page, browser, selector, selectorMap, config,
384384
}
385385

386386
var type = config.puppeteerOffscreenCaptureFix ? page : el;
387-
var params = config.puppeteerOffscreenCaptureFix ? { path: path, clip: box } : { path: path };
387+
var params = config.puppeteerOffscreenCaptureFix ? { captureBeyondViewport: false, path: path, clip: box } : { captureBeyondViewport: false, path: path };
388388

389389
await type.screenshot(params);
390390
} else {
@@ -398,8 +398,8 @@ async function captureScreenshot (page, browser, selector, selectorMap, config,
398398
};
399399

400400
const selectorsShot = async () => {
401-
return Promise.all(
402-
selectors.map(async selector => {
401+
for (let i = 0; i < selectors.length; i++) {
402+
var selector = selectors[i];
403403
filePath = selectorMap[selector].filePath;
404404
ensureDirectoryPath(filePath);
405405
try {
@@ -408,8 +408,7 @@ async function captureScreenshot (page, browser, selector, selectorMap, config,
408408
console.log(chalk.red(`Error capturing Element ${selector}`), e);
409409
return fs.copy(config.env.backstop + ERROR_SELECTOR_PATH, filePath);
410410
}
411-
})
412-
);
411+
}
413412
};
414413
await selectorsShot();
415414
}

0 commit comments

Comments
 (0)