@testomatio/reporter 1.4.5-beta.1-report-id → 1.4.5-beta.2-report-id
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/codecept.js +15 -14
- package/package.json +1 -1
package/lib/adapter/codecept.js
CHANGED
|
@@ -129,8 +129,8 @@ function CodeceptReporter(config) {
|
|
|
129
129
|
await Promise.all(reportTestPromises);
|
|
130
130
|
|
|
131
131
|
if (upload.isArtifactsEnabled()) {
|
|
132
|
-
uploadAttachments(client, videos, '🎞️ Uploading', 'video');
|
|
133
|
-
uploadAttachments(client, traces, '📁 Uploading', 'trace');
|
|
132
|
+
await uploadAttachments(client, videos, '🎞️ Uploading', 'video');
|
|
133
|
+
await uploadAttachments(client, traces, '📁 Uploading', 'trace');
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
const status = failedTests.length === 0 ? STATUS.PASSED : STATUS.FAILED;
|
|
@@ -304,21 +304,22 @@ function CodeceptReporter(config) {
|
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
async function uploadAttachments(client, attachments, messagePrefix, attachmentType) {
|
|
307
|
-
if (attachments
|
|
308
|
-
console.log(APP_PREFIX, `Attachments: ${messagePrefix} ${attachments.length} ${attachmentType}/-s ...`);
|
|
307
|
+
if (!attachments?.length) return;
|
|
309
308
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
309
|
+
console.log(APP_PREFIX, `Attachments: ${messagePrefix} ${attachments.length} ${attachmentType} ...`);
|
|
310
|
+
|
|
311
|
+
const promises = attachments.map(async attachment => {
|
|
312
|
+
const { rid, title, path, type } = attachment;
|
|
313
|
+
const file = { path, type, title };
|
|
314
|
+
return client.addTestRun(undefined, {
|
|
315
|
+
...stripExampleFromTitle(title),
|
|
316
|
+
rid,
|
|
317
|
+
files: [file],
|
|
318
318
|
});
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
await Promise.all(promises);
|
|
319
322
|
|
|
320
|
-
await Promise.all(promises);
|
|
321
|
-
}
|
|
322
323
|
}
|
|
323
324
|
|
|
324
325
|
function getTestAndMessage(title) {
|