@testomatio/reporter 0.5.1 → 0.5.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.
package/Changelog.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.5.2
2
+
3
+ * Fixed multiple upload of artifacts in Cypress.io
4
+
1
5
  # 0.5.1
2
6
 
3
7
  * Fixed Cypress.io to report tests inside nested suites
@@ -15,7 +15,9 @@ const testomatioReporter = on => {
15
15
  const videos = [results.video];
16
16
 
17
17
  for (const test of results.tests) {
18
- const latestAttempt = test.attempts[test.attempts.length - 1];
18
+ const lastAttemptIndex = test.attempts.length - 1;
19
+ const latestAttempt = test.attempts[lastAttemptIndex];
20
+
19
21
  const time = latestAttempt.duration;
20
22
  const error = latestAttempt.error;
21
23
 
@@ -23,11 +25,19 @@ const testomatioReporter = on => {
23
25
  const suiteTitle = test.title.pop();
24
26
 
25
27
  const testId = parseTest(title);
26
- const suiteId = '';
28
+ const suiteId = parseSuite(suiteTitle);
29
+
30
+ if (error) {
31
+ error.inspect = function() {
32
+ return this.codeFrame.frame;
33
+ }
34
+ }
27
35
 
28
36
  const screenshots = results.screenshots
29
37
  .filter(screenshot => screenshot.path.includes(title))
38
+ .filter(screenshot => screenshot.testAttemptIndex === lastAttemptIndex)
30
39
  .map(screenshot => screenshot.path);
40
+
31
41
  const files = [...videos, ...screenshots];
32
42
 
33
43
  const state = test.state === 'passed' ? TRConstants.PASSED : TRConstants.FAILED;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "main": "./lib/reporter.js",
6
6
  "repository": "git@github.com:testomatio/reporter.git",