@testomatio/reporter 0.5.0-beta.1 → 0.5.0-beta.2
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.
|
@@ -12,17 +12,19 @@ const testomatioReporter = on => {
|
|
|
12
12
|
on('after:spec', async (_spec, results) => {
|
|
13
13
|
const addSpecTestsPromises = [];
|
|
14
14
|
|
|
15
|
+
const videos = [results.video];
|
|
16
|
+
|
|
15
17
|
for (const test of results.tests) {
|
|
16
18
|
const latestAttempt = test.attempts[test.attempts.length - 1];
|
|
17
|
-
console.log({ latestAttempt })
|
|
18
19
|
const time = latestAttempt.duration;
|
|
19
20
|
const error = latestAttempt.error;
|
|
20
21
|
|
|
21
22
|
const title = test.title[1]; // [0] - spec title, [1] - test title
|
|
22
23
|
const testId = parseTest(title);
|
|
23
24
|
|
|
24
|
-
const
|
|
25
|
-
|
|
25
|
+
const screenshots = results.screenshots
|
|
26
|
+
.filter(screenshot => screenshot.path.includes(title))
|
|
27
|
+
.map(screenshot => screenshot.path);
|
|
26
28
|
const files = [...videos, ...screenshots];
|
|
27
29
|
|
|
28
30
|
const state = test.state === 'passed' ? TRConstants.PASSED : TRConstants.FAILED;
|