Skip to content

Commit 8a1db68

Browse files
author
Tian Feng
authored
[DEVX-1756] Upload screenshots for docker mode (#155)
1 parent 78c0dac commit 8a1db68

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/playwright-runner.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ async function createJob (suiteName, hasPassed, startTime, endTime, args, playwr
5555
console.error(`Failed to convert ${webmFiles[0]} to mp4: '${e}'`);
5656
}
5757
}
58+
const screenshots = glob.sync(path.join(assetsDir, '**', '*.{png,jpg,jpeg}'));
5859

5960
let files = [
6061
{
@@ -80,6 +81,15 @@ async function createJob (suiteName, hasPassed, startTime, endTime, args, playwr
8081
);
8182
}
8283

84+
for (const f of screenshots) {
85+
files.push(
86+
{
87+
filename: path.basename(f),
88+
data: fs.readFileSync(f),
89+
},
90+
);
91+
}
92+
8393
// Upload metrics
8494
for (let [, mt] of Object.entries(metrics)) {
8595
if (_.isEmpty(mt.data)) {

0 commit comments

Comments
 (0)