@testomatio/reporter 1.0.0-beta.3 → 1.0.0-beta.4
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 +15 -8
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ const TestomatioClient = require('../client');
|
|
|
8
8
|
const { isArtifactsEnabled } = require('../fileUploader');
|
|
9
9
|
const { parseTest } = require('../util');
|
|
10
10
|
|
|
11
|
+
const reportTestPromises = [];
|
|
11
12
|
|
|
12
13
|
class TestomatioReporter {
|
|
13
14
|
constructor(config = {}) {
|
|
@@ -25,7 +26,7 @@ class TestomatioReporter {
|
|
|
25
26
|
onTestEnd(test, result) {
|
|
26
27
|
if (!this.client) return;
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
let testId = parseTest(test.title);
|
|
29
30
|
|
|
30
31
|
const { title } = test;
|
|
31
32
|
const { error, duration } = result;
|
|
@@ -36,24 +37,30 @@ class TestomatioReporter {
|
|
|
36
37
|
for (const step of result.steps) {
|
|
37
38
|
appendStep(step, steps);
|
|
38
39
|
}
|
|
39
|
-
|
|
40
|
-
this.
|
|
41
|
-
testId, title, suite_title, files: result.attachments.filter((a) => a.body || a.path)
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
this.client.addTestRun(checkStatus(result.status), {
|
|
40
|
+
|
|
41
|
+
const reportTestPromise = this.client.addTestRun(checkStatus(result.status), {
|
|
45
42
|
error,
|
|
46
43
|
test_id: testId,
|
|
47
44
|
suite_title,
|
|
48
45
|
title,
|
|
49
46
|
steps: steps.join('\n'),
|
|
50
47
|
time: duration,
|
|
51
|
-
})
|
|
48
|
+
}).then(pipes => {
|
|
49
|
+
testId = pipes.filter(p => p.pipe.includes('Testomatio'))[0]?.result?.data?.test_id;
|
|
50
|
+
|
|
51
|
+
this.uploads.push({
|
|
52
|
+
testId, title, suite_title, files: result.attachments.filter((a) => a.body || a.path)
|
|
53
|
+
})
|
|
54
|
+
});;
|
|
55
|
+
|
|
56
|
+
reportTestPromises.push(reportTestPromise);
|
|
52
57
|
}
|
|
53
58
|
|
|
54
59
|
async onEnd(result) {
|
|
55
60
|
if (!this.client) return;
|
|
56
61
|
|
|
62
|
+
await Promise.all(reportTestPromises);
|
|
63
|
+
|
|
57
64
|
if (this.uploads.length && isArtifactsEnabled()) {
|
|
58
65
|
console.log(APP_PREFIX, `🎞️ Uploading ${this.uploads.length} files...`);
|
|
59
66
|
|