in lib/downloadAllSessionScreenshots.js [79:100]
function downloadScreenshots(browsername, browserversion, matches) {
return new Promise((resolve, reject) => {
let idx = 0;
if (matches === null) return;
async.eachLimit(matches, 1, (url, next) => {
const pageName = utils.getPageNameByIndex(idx);
const filePath = `${paths.SCREENSHOTS_TMP}/${browsername}_${browserversion}_${pageName}.jpeg`;
downloadScreenshot(url, filePath, (err) => {
if (err) console.error(`An error occurred while downloading the screenshot: ${err}`);
idx++;
next();
});
}, (err) => {
console.log(`Screenshots downloaded for ${browsername} ${browserversion}`);
resolve();
});
});
}