From e982e709bba43b6c8ff7e1438cd714f4cb53d1c5 Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Mon, 10 May 2021 10:30:52 +0200 Subject: [PATCH] Fix copy bug for LCP and LS screenshots. (#3376) --- lib/plugins/browsertime/index.js | 22 ++++++++++------------ lib/plugins/lateststorer/index.js | 4 +++- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/plugins/browsertime/index.js b/lib/plugins/browsertime/index.js index b612ad6d7..2505e933e 100644 --- a/lib/plugins/browsertime/index.js +++ b/lib/plugins/browsertime/index.js @@ -341,21 +341,19 @@ module.exports = { run.screenshots = result[resultIndex].files.screenshot[runIndex]; } else { - // Hack to make sure we take the right after page complete check - run.screenshots = [ - `${this.resultUrls.relativeSummaryPageUrl( - url, - this.allAlias[url] - )}data/screenshots/${runIndex + 1}/afterPageCompleteCheck.${ - this.screenshotType - }` - ]; - - // Push all screenshots that do not match the afterPageCompleteCheck + // Push all screenshots + run.screenshots = []; for (let screenshot of result[resultIndex].files.screenshot[ runIndex ]) { - if (screenshot.indexOf('afterPageCompleteCheck') === -1) { + if ( + screenshot.indexOf( + `${this.resultUrls.relativeSummaryPageUrl( + url, + this.allAlias[url] + )}data` + ) > -1 + ) { run.screenshots.push(screenshot); } } diff --git a/lib/plugins/lateststorer/index.js b/lib/plugins/lateststorer/index.js index bcd563151..30b1256c0 100644 --- a/lib/plugins/lateststorer/index.js +++ b/lib/plugins/lateststorer/index.js @@ -74,7 +74,9 @@ module.exports = { '.' + this.screenshotType ); - } else console.log(screenshot); + } else { + // This is a user generated screenshot, we do not copy that + } } } if (options.browsertime && options.browsertime.video) {