@testomatio/reporter 2.0.1-beta.4 → 2.0.1-beta.5-timestamp

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.
Files changed (148) hide show
  1. package/lib/adapter/codecept.js +335 -293
  2. package/lib/adapter/cucumber/current.js +203 -195
  3. package/lib/adapter/cucumber/legacy.js +155 -130
  4. package/lib/adapter/cucumber.js +16 -5
  5. package/lib/adapter/cypress-plugin/index.js +105 -91
  6. package/lib/adapter/jasmine.js +53 -54
  7. package/lib/adapter/jest.js +99 -97
  8. package/lib/adapter/mocha.js +141 -112
  9. package/lib/adapter/playwright.js +231 -199
  10. package/lib/adapter/vitest.js +149 -150
  11. package/lib/adapter/webdriver.js +121 -144
  12. package/lib/bin/cli.js +211 -229
  13. package/lib/bin/reportXml.js +52 -51
  14. package/lib/bin/startTest.js +95 -83
  15. package/lib/bin/uploadArtifacts.js +61 -56
  16. package/lib/client.js +465 -424
  17. package/lib/config.js +23 -18
  18. package/lib/constants.js +44 -50
  19. package/lib/data-storage.js +188 -216
  20. package/lib/junit-adapter/adapter.js +20 -17
  21. package/lib/junit-adapter/csharp.js +14 -28
  22. package/lib/junit-adapter/index.js +25 -27
  23. package/lib/junit-adapter/java.js +53 -41
  24. package/lib/junit-adapter/javascript.js +27 -30
  25. package/lib/junit-adapter/python.js +37 -38
  26. package/lib/junit-adapter/ruby.js +8 -11
  27. package/lib/output.js +52 -44
  28. package/lib/pipe/bitbucket.js +230 -223
  29. package/lib/pipe/csv.js +126 -113
  30. package/lib/pipe/debug.js +99 -118
  31. package/lib/pipe/github.js +213 -218
  32. package/lib/pipe/gitlab.js +206 -183
  33. package/lib/pipe/html.js +321 -258
  34. package/lib/pipe/index.js +66 -94
  35. package/lib/pipe/testomatio.js +474 -429
  36. package/lib/reporter-functions.js +26 -28
  37. package/lib/reporter.js +29 -34
  38. package/lib/services/artifacts.js +51 -55
  39. package/lib/services/index.js +12 -14
  40. package/lib/services/key-values.js +53 -56
  41. package/lib/services/logger.js +245 -226
  42. package/lib/template/testomatio.hbs +1366 -1026
  43. package/lib/uploader.js +364 -295
  44. package/lib/utils/pipe_utils.js +85 -89
  45. package/lib/utils/utils.js +307 -398
  46. package/lib/xmlReader.js +532 -525
  47. package/package.json +21 -64
  48. package/lib/adapter/codecept.d.ts +0 -2
  49. package/lib/adapter/cucumber/current.d.ts +0 -14
  50. package/lib/adapter/cucumber/legacy.d.ts +0 -0
  51. package/lib/adapter/cucumber.d.ts +0 -2
  52. package/lib/adapter/cypress-plugin/index.d.ts +0 -2
  53. package/lib/adapter/jasmine.d.ts +0 -11
  54. package/lib/adapter/jest.d.ts +0 -13
  55. package/lib/adapter/mocha.d.ts +0 -2
  56. package/lib/adapter/nightwatch.d.ts +0 -4
  57. package/lib/adapter/nightwatch.js +0 -80
  58. package/lib/adapter/playwright.d.ts +0 -14
  59. package/lib/adapter/vitest.d.ts +0 -35
  60. package/lib/adapter/webdriver.d.ts +0 -24
  61. package/lib/bin/cli.d.ts +0 -2
  62. package/lib/bin/reportXml.d.ts +0 -2
  63. package/lib/bin/startTest.d.ts +0 -2
  64. package/lib/bin/uploadArtifacts.d.ts +0 -2
  65. package/lib/client.d.ts +0 -76
  66. package/lib/config.d.ts +0 -1
  67. package/lib/constants.d.ts +0 -25
  68. package/lib/data-storage.d.ts +0 -34
  69. package/lib/junit-adapter/adapter.d.ts +0 -9
  70. package/lib/junit-adapter/csharp.d.ts +0 -5
  71. package/lib/junit-adapter/index.d.ts +0 -3
  72. package/lib/junit-adapter/java.d.ts +0 -5
  73. package/lib/junit-adapter/javascript.d.ts +0 -4
  74. package/lib/junit-adapter/python.d.ts +0 -5
  75. package/lib/junit-adapter/ruby.d.ts +0 -4
  76. package/lib/output.d.ts +0 -11
  77. package/lib/package.json +0 -3
  78. package/lib/pipe/bitbucket.d.ts +0 -25
  79. package/lib/pipe/csv.d.ts +0 -47
  80. package/lib/pipe/debug.d.ts +0 -29
  81. package/lib/pipe/github.d.ts +0 -30
  82. package/lib/pipe/gitlab.d.ts +0 -25
  83. package/lib/pipe/html.d.ts +0 -35
  84. package/lib/pipe/index.d.ts +0 -1
  85. package/lib/pipe/testomatio.d.ts +0 -71
  86. package/lib/replay.d.ts +0 -31
  87. package/lib/replay.js +0 -237
  88. package/lib/reporter-functions.d.ts +0 -34
  89. package/lib/reporter.d.ts +0 -232
  90. package/lib/services/artifacts.d.ts +0 -33
  91. package/lib/services/index.d.ts +0 -9
  92. package/lib/services/key-values.d.ts +0 -27
  93. package/lib/services/logger.d.ts +0 -64
  94. package/lib/uploader.d.ts +0 -60
  95. package/lib/utils/pipe_utils.d.ts +0 -41
  96. package/lib/utils/utils.d.ts +0 -54
  97. package/lib/xmlReader.d.ts +0 -92
  98. package/src/adapter/codecept.js +0 -373
  99. package/src/adapter/cucumber/current.js +0 -228
  100. package/src/adapter/cucumber/legacy.js +0 -158
  101. package/src/adapter/cucumber.js +0 -4
  102. package/src/adapter/cypress-plugin/index.js +0 -110
  103. package/src/adapter/jasmine.js +0 -60
  104. package/src/adapter/jest.js +0 -107
  105. package/src/adapter/mocha.cjs +0 -2
  106. package/src/adapter/mocha.js +0 -156
  107. package/src/adapter/nightwatch.js +0 -88
  108. package/src/adapter/playwright.js +0 -254
  109. package/src/adapter/vitest.js +0 -183
  110. package/src/adapter/webdriver.js +0 -142
  111. package/src/bin/cli.js +0 -348
  112. package/src/bin/reportXml.js +0 -77
  113. package/src/bin/startTest.js +0 -124
  114. package/src/bin/uploadArtifacts.js +0 -91
  115. package/src/client.js +0 -508
  116. package/src/config.js +0 -30
  117. package/src/constants.js +0 -53
  118. package/src/data-storage.js +0 -204
  119. package/src/junit-adapter/adapter.js +0 -23
  120. package/src/junit-adapter/csharp.js +0 -28
  121. package/src/junit-adapter/index.js +0 -28
  122. package/src/junit-adapter/java.js +0 -58
  123. package/src/junit-adapter/javascript.js +0 -31
  124. package/src/junit-adapter/python.js +0 -42
  125. package/src/junit-adapter/ruby.js +0 -10
  126. package/src/output.js +0 -57
  127. package/src/pipe/bitbucket.js +0 -252
  128. package/src/pipe/csv.js +0 -140
  129. package/src/pipe/debug.js +0 -119
  130. package/src/pipe/github.js +0 -232
  131. package/src/pipe/gitlab.js +0 -247
  132. package/src/pipe/html.js +0 -373
  133. package/src/pipe/index.js +0 -71
  134. package/src/pipe/testomatio.js +0 -504
  135. package/src/replay.js +0 -245
  136. package/src/reporter-functions.js +0 -55
  137. package/src/reporter.cjs_decprecated +0 -21
  138. package/src/reporter.js +0 -33
  139. package/src/services/artifacts.js +0 -59
  140. package/src/services/index.js +0 -13
  141. package/src/services/key-values.js +0 -59
  142. package/src/services/logger.js +0 -315
  143. package/src/template/emptyData.svg +0 -23
  144. package/src/template/testomatio.hbs +0 -1081
  145. package/src/uploader.js +0 -376
  146. package/src/utils/pipe_utils.js +0 -119
  147. package/src/utils/utils.js +0 -416
  148. package/src/xmlReader.js +0 -614
package/lib/pipe/index.js CHANGED
@@ -1,97 +1,69 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.pipesFactory = pipesFactory;
40
- const fs_1 = __importDefault(require("fs"));
41
- const path_1 = __importDefault(require("path"));
42
- const picocolors_1 = __importDefault(require("picocolors"));
43
- const constants_js_1 = require("../constants.js");
44
- const testomatio_js_1 = __importDefault(require("./testomatio.js"));
45
- const github_js_1 = __importDefault(require("./github.js"));
46
- const gitlab_js_1 = __importDefault(require("./gitlab.js"));
47
- const csv_js_1 = __importDefault(require("./csv.js"));
48
- const html_js_1 = __importDefault(require("./html.js"));
49
- const bitbucket_js_1 = require("./bitbucket.js");
50
- const debug_js_1 = require("./debug.js");
51
- async function pipesFactory(params, opts) {
52
- const extraPipes = [];
53
- // Add extra pipes into package.json file:
54
- // "testomatio": {
55
- // "pipes": ["my-module-pipe", "./local/js/file/pipe"]
56
- // }
57
- const packageJsonFile = path_1.default.join(process.cwd(), 'package.json');
58
- if (fs_1.default.existsSync(packageJsonFile)) {
59
- const packageJson = JSON.parse(fs_1.default.readFileSync(packageJsonFile).toString());
60
- const pipeDefs = packageJson?.testomatio?.pipes || [];
61
- for (const pipeDef of pipeDefs) {
62
- let PipeClass;
63
- try {
64
- PipeClass = await Promise.resolve(`${pipeDef}`).then(s => __importStar(require(s)));
65
- }
66
- catch (err) {
67
- console.log(constants_js_1.APP_PREFIX, `Can't load module Testomatio pipe module from ${pipeDef}`);
68
- continue;
69
- }
70
- try {
71
- extraPipes.push(new PipeClass(params, opts));
72
- }
73
- catch (err) {
74
- console.log(constants_js_1.APP_PREFIX, `Can't instantiate Testomatio for ${pipeDef}`, err);
75
- continue;
76
- }
77
- }
78
- }
79
- const pipes = [
80
- new testomatio_js_1.default(params, opts),
81
- new github_js_1.default(params, opts),
82
- new gitlab_js_1.default(params, opts),
83
- new csv_js_1.default(params, opts),
84
- new html_js_1.default(params, opts),
85
- new bitbucket_js_1.BitbucketPipe(params, opts),
86
- new debug_js_1.DebugPipe(params, opts),
87
- ...extraPipes,
88
- ];
89
- const pipesEnabled = pipes.filter(p => p.isEnabled);
90
- console.log(constants_js_1.APP_PREFIX, picocolors_1.default.cyan('Pipes:'), picocolors_1.default.cyan(pipesEnabled.map(p => p.toString()).join(', ') || 'No pipes enabled'));
91
- if (!pipesEnabled.length) {
92
- console.log(constants_js_1.APP_PREFIX, picocolors_1.default.dim('If you want to use Testomatio reporter, pass your token as TESTOMATIO env variable'));
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const chalk = require('chalk');
4
+ const { APP_PREFIX } = require('../constants');
5
+ const TestomatioPipe = require('./testomatio');
6
+ const GitHubPipe = require('./github');
7
+ const GitLabPipe = require('./gitlab');
8
+ const CsvPipe = require('./csv');
9
+ const HtmlPipe = require('./html');
10
+ const BitbucketPipe = require('./bitbucket');
11
+ const DebugPipe = require('./debug');
12
+
13
+ function PipeFactory(params, opts) {
14
+ const extraPipes = [];
15
+
16
+ // Add extra pipes into package.json file:
17
+ // "testomatio": {
18
+ // "pipes": ["my-module-pipe", "./local/js/file/pipe"]
19
+ // }
20
+
21
+ const packageJsonFile = path.join(process.cwd(), 'package.json');
22
+ if (fs.existsSync(packageJsonFile)) {
23
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonFile).toString());
24
+ const pipeDefs = packageJson?.testomatio?.pipes || [];
25
+
26
+ for (const pipeDef of pipeDefs) {
27
+ let PipeClass;
28
+ try {
29
+ PipeClass = require(pipeDef);
30
+ } catch (err) {
31
+ console.log(APP_PREFIX, `Can't load module Testomatio pipe module from ${pipeDef}`);
32
+ continue;
33
+ }
34
+
35
+ try {
36
+ extraPipes.push(new PipeClass(params, opts));
37
+ } catch (err) {
38
+ console.log(APP_PREFIX, `Can't instantiate Testomatio for ${pipeDef}`, err);
39
+ continue;
40
+ }
93
41
  }
94
- return pipes;
42
+ }
43
+
44
+ const pipes = [
45
+ new TestomatioPipe(params, opts),
46
+ new GitHubPipe(params, opts),
47
+ new GitLabPipe(params, opts),
48
+ new CsvPipe(params, opts),
49
+ new HtmlPipe(params, opts),
50
+ new BitbucketPipe(params, opts),
51
+ new DebugPipe(params, opts),
52
+ ...extraPipes,
53
+ ];
54
+
55
+ console.log(
56
+ APP_PREFIX,
57
+ chalk.cyan('Pipes:'),
58
+ chalk.cyan(
59
+ pipes
60
+ .filter(p => p.isEnabled)
61
+ .map(p => p.toString())
62
+ .join(', ') || 'No pipes enabled',
63
+ ),
64
+ );
65
+
66
+ return pipes;
95
67
  }
96
68
 
97
- module.exports.pipesFactory = pipesFactory;
69
+ module.exports = PipeFactory;