Copy LCP and LS images (#3371)
This commit is contained in:
parent
959981154d
commit
e26e8fa44a
|
|
@ -49,23 +49,33 @@ module.exports = {
|
|||
// We can have multiple screenshots (taken by the user) and
|
||||
// only use the standard one
|
||||
for (let screenshot of message.data.screenshots) {
|
||||
if (screenshot.indexOf('afterPageCompleteCheck') > -1) {
|
||||
if (
|
||||
/afterPageCompleteCheck|layoutShift|largestContentfulPaint/.test(
|
||||
screenshot
|
||||
)
|
||||
) {
|
||||
const type = screenshot.substring(
|
||||
screenshot.lastIndexOf('/') + 1,
|
||||
screenshot.lastIndexOf('.')
|
||||
);
|
||||
|
||||
imagePath = screenshot;
|
||||
}
|
||||
const imageFullPath = path.join(baseDir, imagePath);
|
||||
await this.storageManager.copyFileToDir(
|
||||
imageFullPath,
|
||||
newPath +
|
||||
'/' +
|
||||
name +
|
||||
(type !== 'afterPageCompleteCheck' ? `.${type}` : '') +
|
||||
'.' +
|
||||
options.browser +
|
||||
'.' +
|
||||
connectivity +
|
||||
'.' +
|
||||
this.screenshotType
|
||||
);
|
||||
} else console.log(screenshot);
|
||||
}
|
||||
const imageFullPath = path.join(baseDir, imagePath);
|
||||
await this.storageManager.copyFileToDir(
|
||||
imageFullPath,
|
||||
newPath +
|
||||
'/' +
|
||||
name +
|
||||
'.' +
|
||||
options.browser +
|
||||
'.' +
|
||||
connectivity +
|
||||
'.' +
|
||||
this.screenshotType
|
||||
);
|
||||
}
|
||||
if (options.browsertime && options.browsertime.video) {
|
||||
const videoFullPath = path.join(baseDir, message.data.video);
|
||||
|
|
|
|||
Loading…
Reference in New Issue