@testomatio/reporter 1.6.0-beta-2-artifacts → 2.0.0-beta-esm
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 +288 -330
- package/lib/adapter/cucumber/current.js +195 -203
- package/lib/adapter/cucumber/legacy.js +130 -155
- package/lib/adapter/cucumber.js +5 -16
- package/lib/adapter/cypress-plugin/index.js +91 -105
- package/lib/adapter/jasmine/jasmine.js +63 -0
- package/lib/adapter/jasmine.js +54 -53
- package/lib/adapter/jest.js +97 -99
- package/lib/adapter/mocha/mocha.js +125 -0
- package/lib/adapter/mocha.js +111 -140
- package/lib/adapter/playwright.js +168 -200
- package/lib/adapter/vitest.js +144 -143
- package/lib/adapter/webdriver.js +113 -97
- package/lib/bin/reportXml.js +49 -49
- package/lib/bin/startTest.js +80 -97
- package/lib/client.js +344 -385
- package/lib/config.js +16 -21
- package/lib/constants.js +49 -43
- package/lib/data-storage.js +206 -188
- package/lib/fileUploader.js +245 -0
- package/lib/junit-adapter/adapter.js +17 -20
- package/lib/junit-adapter/csharp.js +18 -14
- package/lib/junit-adapter/index.js +27 -25
- package/lib/junit-adapter/java.js +41 -53
- package/lib/junit-adapter/javascript.js +30 -27
- package/lib/junit-adapter/python.js +38 -37
- package/lib/junit-adapter/ruby.js +11 -8
- package/lib/output.js +44 -52
- package/lib/package.json +1 -0
- package/lib/pipe/bitbucket.js +208 -227
- package/lib/pipe/csv.js +111 -124
- package/lib/pipe/github.js +184 -211
- package/lib/pipe/gitlab.js +164 -205
- package/lib/pipe/html.js +253 -312
- package/lib/pipe/index.js +83 -63
- package/lib/pipe/testomatio.js +391 -454
- package/lib/reporter-functions.js +16 -20
- package/lib/reporter.js +47 -17
- package/lib/services/artifacts.js +55 -51
- package/lib/services/index.js +14 -12
- package/lib/services/key-values.js +56 -53
- package/lib/services/logger.js +227 -245
- package/lib/utils/chalk.js +10 -0
- package/lib/utils/pipe_utils.js +91 -84
- package/lib/utils/utils.js +289 -273
- package/lib/xmlReader.js +480 -519
- package/package.json +57 -19
- package/src/adapter/codecept.js +369 -0
- package/src/adapter/cucumber/current.js +228 -0
- package/src/adapter/cucumber/legacy.js +158 -0
- package/src/adapter/cucumber.js +4 -0
- package/src/adapter/cypress-plugin/index.js +110 -0
- package/src/adapter/jasmine.js +60 -0
- package/src/adapter/jest.js +107 -0
- package/src/adapter/mocha.cjs +2 -0
- package/src/adapter/mocha.js +156 -0
- package/src/adapter/playwright.js +222 -0
- package/src/adapter/vitest.js +183 -0
- package/src/adapter/webdriver.js +111 -0
- package/src/bin/reportXml.js +67 -0
- package/src/bin/startTest.js +119 -0
- package/src/client.js +423 -0
- package/src/config.js +30 -0
- package/src/constants.js +49 -0
- package/src/data-storage.js +204 -0
- package/src/fileUploader.js +307 -0
- package/src/junit-adapter/adapter.js +23 -0
- package/src/junit-adapter/csharp.js +16 -0
- package/src/junit-adapter/index.js +28 -0
- package/src/junit-adapter/java.js +58 -0
- package/src/junit-adapter/javascript.js +31 -0
- package/src/junit-adapter/python.js +42 -0
- package/src/junit-adapter/ruby.js +10 -0
- package/src/output.js +57 -0
- package/src/pipe/bitbucket.js +254 -0
- package/src/pipe/csv.js +140 -0
- package/src/pipe/github.js +234 -0
- package/src/pipe/gitlab.js +229 -0
- package/src/pipe/html.js +366 -0
- package/src/pipe/index.js +73 -0
- package/src/pipe/testomatio.js +498 -0
- package/src/reporter-functions.js +44 -0
- package/src/reporter.cjs +22 -0
- package/src/reporter.js +24 -0
- package/src/services/artifacts.js +59 -0
- package/src/services/index.js +13 -0
- package/src/services/key-values.js +59 -0
- package/src/services/logger.js +314 -0
- package/src/template/emptyData.svg +23 -0
- package/src/template/testomatio.hbs +1421 -0
- package/src/utils/chalk.js +13 -0
- package/src/utils/pipe_utils.js +127 -0
- package/src/utils/utils.js +341 -0
- package/src/xmlReader.js +551 -0
- package/lib/bin/cli.js +0 -216
- package/lib/bin/uploadArtifacts.js +0 -86
- package/lib/uploader.js +0 -312
package/lib/pipe/index.js
CHANGED
|
@@ -1,67 +1,87 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const GitLabPipe = require('./gitlab');
|
|
8
|
-
const CsvPipe = require('./csv');
|
|
9
|
-
const HtmlPipe = require('./html');
|
|
10
|
-
const BitbucketPipe = require('./bitbucket');
|
|
11
|
-
|
|
12
|
-
function PipeFactory(params, opts) {
|
|
13
|
-
const extraPipes = [];
|
|
14
|
-
|
|
15
|
-
// Add extra pipes into package.json file:
|
|
16
|
-
// "testomatio": {
|
|
17
|
-
// "pipes": ["my-module-pipe", "./local/js/file/pipe"]
|
|
18
|
-
// }
|
|
19
|
-
|
|
20
|
-
const packageJsonFile = path.join(process.cwd(), 'package.json');
|
|
21
|
-
if (fs.existsSync(packageJsonFile)) {
|
|
22
|
-
const packageJson = JSON.parse(fs.readFileSync(packageJsonFile).toString());
|
|
23
|
-
const pipeDefs = packageJson?.testomatio?.pipes || [];
|
|
24
|
-
|
|
25
|
-
for (const pipeDef of pipeDefs) {
|
|
26
|
-
let PipeClass;
|
|
27
|
-
try {
|
|
28
|
-
PipeClass = require(pipeDef);
|
|
29
|
-
} catch (err) {
|
|
30
|
-
console.log(APP_PREFIX, `Can't load module Testomatio pipe module from ${pipeDef}`);
|
|
31
|
-
continue;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
try {
|
|
35
|
-
extraPipes.push(new PipeClass(params, opts));
|
|
36
|
-
} catch (err) {
|
|
37
|
-
console.log(APP_PREFIX, `Can't instantiate Testomatio for ${pipeDef}`, err);
|
|
38
|
-
continue;
|
|
39
|
-
}
|
|
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]; } };
|
|
40
7
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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 (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.pipesFactory = pipesFactory;
|
|
30
|
+
const fs_1 = __importDefault(require("fs"));
|
|
31
|
+
const path_1 = __importDefault(require("path"));
|
|
32
|
+
const picocolors_1 = __importDefault(require("picocolors"));
|
|
33
|
+
const constants_js_1 = require("../constants.js");
|
|
34
|
+
const testomatio_js_1 = __importDefault(require("./testomatio.js"));
|
|
35
|
+
const github_js_1 = __importDefault(require("./github.js"));
|
|
36
|
+
const gitlab_js_1 = __importDefault(require("./gitlab.js"));
|
|
37
|
+
const csv_js_1 = __importDefault(require("./csv.js"));
|
|
38
|
+
const html_js_1 = __importDefault(require("./html.js"));
|
|
39
|
+
const bitbucket_js_1 = require("./bitbucket.js");
|
|
40
|
+
async function pipesFactory(params, opts) {
|
|
41
|
+
const extraPipes = [];
|
|
42
|
+
// Add extra pipes into package.json file:
|
|
43
|
+
// "testomatio": {
|
|
44
|
+
// "pipes": ["my-module-pipe", "./local/js/file/pipe"]
|
|
45
|
+
// }
|
|
46
|
+
const packageJsonFile = path_1.default.join(process.cwd(), 'package.json');
|
|
47
|
+
if (fs_1.default.existsSync(packageJsonFile)) {
|
|
48
|
+
const packageJson = JSON.parse(fs_1.default.readFileSync(packageJsonFile).toString());
|
|
49
|
+
const pipeDefs = packageJson?.testomatio?.pipes || [];
|
|
50
|
+
for (const pipeDef of pipeDefs) {
|
|
51
|
+
let PipeClass;
|
|
52
|
+
try {
|
|
53
|
+
PipeClass = await Promise.resolve(`${pipeDef}`).then(s => __importStar(require(s)));
|
|
54
|
+
}
|
|
55
|
+
catch (err) {
|
|
56
|
+
console.log(constants_js_1.APP_PREFIX, `Can't load module Testomatio pipe module from ${pipeDef}`);
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
extraPipes.push(new PipeClass(params, opts));
|
|
61
|
+
}
|
|
62
|
+
catch (err) {
|
|
63
|
+
console.log(constants_js_1.APP_PREFIX, `Can't instantiate Testomatio for ${pipeDef}`, err);
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
const pipes = [
|
|
69
|
+
new testomatio_js_1.default(params, opts),
|
|
70
|
+
new github_js_1.default(params, opts),
|
|
71
|
+
new gitlab_js_1.default(params, opts),
|
|
72
|
+
new csv_js_1.default(params, opts),
|
|
73
|
+
new html_js_1.default(params, opts),
|
|
74
|
+
new bitbucket_js_1.BitbucketPipe(params, opts),
|
|
75
|
+
...extraPipes,
|
|
76
|
+
];
|
|
77
|
+
const pipesEnabled = pipes.filter(p => p.isEnabled);
|
|
78
|
+
console.log(constants_js_1.APP_PREFIX, picocolors_1.default.cyan('Pipes:'), picocolors_1.default.cyan(pipesEnabled
|
|
59
79
|
.map(p => p.toString())
|
|
60
|
-
.join(', ') || 'No pipes enabled'
|
|
61
|
-
)
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
80
|
+
.join(', ') || 'No pipes enabled'));
|
|
81
|
+
if (!pipesEnabled.length) {
|
|
82
|
+
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'));
|
|
83
|
+
}
|
|
84
|
+
return pipes;
|
|
65
85
|
}
|
|
66
86
|
|
|
67
|
-
module.exports =
|
|
87
|
+
module.exports.pipesFactory = pipesFactory;
|