@testomatio/reporter 1.6.11 → 1.6.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/adapter/playwright.js +10 -5
- package/lib/uploader.js +11 -2
- package/lib/xmlReader.js +1 -1
- package/package.json +1 -1
|
@@ -116,9 +116,13 @@ class PlaywrightReporter {
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
if (artifact.body) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
let filePath = generateTmpFilepath(artifact.name);
|
|
120
|
+
|
|
121
|
+
const extension = artifact.contentType?.split('/')[1]?.replace('jpeg', 'jpg');
|
|
122
|
+
if (extension) filePath += `.${extension}`;
|
|
123
|
+
|
|
124
|
+
fs.writeFileSync(filePath, artifact.body);
|
|
125
|
+
return filePath;
|
|
122
126
|
}
|
|
123
127
|
|
|
124
128
|
return null;
|
|
@@ -218,9 +222,10 @@ function appendStep(step, shift = 0) {
|
|
|
218
222
|
return resultStep;
|
|
219
223
|
}
|
|
220
224
|
|
|
221
|
-
function
|
|
225
|
+
function generateTmpFilepath(filename = '') {
|
|
226
|
+
filename = filename || `tmp.${crypto.randomBytes(16).toString('hex')}`;
|
|
222
227
|
const tmpdir = os.tmpdir();
|
|
223
|
-
return path.join(tmpdir,
|
|
228
|
+
return path.join(tmpdir, filename);
|
|
224
229
|
}
|
|
225
230
|
|
|
226
231
|
/**
|
package/lib/uploader.js
CHANGED
|
@@ -317,7 +317,7 @@ class S3Uploader {
|
|
|
317
317
|
async getS3LocationLink(out) {
|
|
318
318
|
const response = await out.done();
|
|
319
319
|
|
|
320
|
-
let s3Location = response?.Location;
|
|
320
|
+
let s3Location = response?.Location?.trim();
|
|
321
321
|
|
|
322
322
|
if (!s3Location) {
|
|
323
323
|
s3Location = out?.singleUploadResult?.Location;
|
|
@@ -328,6 +328,11 @@ class S3Uploader {
|
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
+
// Normalize the URL
|
|
332
|
+
if (!s3Location.startsWith('http')) {
|
|
333
|
+
s3Location = `https://${s3Location}`;
|
|
334
|
+
}
|
|
335
|
+
|
|
331
336
|
return s3Location;
|
|
332
337
|
}
|
|
333
338
|
|
|
@@ -353,10 +358,13 @@ class S3Uploader {
|
|
|
353
358
|
credentials: {
|
|
354
359
|
accessKeyId: S3_ACCESS_KEY_ID,
|
|
355
360
|
secretAccessKey: S3_SECRET_ACCESS_KEY,
|
|
356
|
-
s3ForcePathStyle: S3_FORCE_PATH_STYLE,
|
|
357
361
|
},
|
|
358
362
|
};
|
|
359
363
|
|
|
364
|
+
if (S3_FORCE_PATH_STYLE) {
|
|
365
|
+
cfg.forcePathStyle = !['false', '0'].includes(String(S3_FORCE_PATH_STYLE || '').toLowerCase());
|
|
366
|
+
}
|
|
367
|
+
|
|
360
368
|
if (S3_SESSION_TOKEN) {
|
|
361
369
|
cfg.credentials.sessionToken = S3_SESSION_TOKEN;
|
|
362
370
|
}
|
|
@@ -367,6 +375,7 @@ class S3Uploader {
|
|
|
367
375
|
|
|
368
376
|
return cfg;
|
|
369
377
|
}
|
|
378
|
+
|
|
370
379
|
}
|
|
371
380
|
|
|
372
381
|
module.exports = S3Uploader;
|
package/lib/xmlReader.js
CHANGED
|
@@ -42,7 +42,7 @@ class XmlReader {
|
|
|
42
42
|
title: TESTOMATIO_TITLE,
|
|
43
43
|
env: TESTOMATIO_ENV,
|
|
44
44
|
group_title: TESTOMATIO_RUNGROUP_TITLE,
|
|
45
|
-
detach:
|
|
45
|
+
detach: TESTOMATIO_MARK_DETACHED,
|
|
46
46
|
// batch uploading is implemented for xml already
|
|
47
47
|
isBatchEnabled: false,
|
|
48
48
|
};
|