@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/utils/pipe_utils.js
CHANGED
|
@@ -1,52 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateFilterType = updateFilterType;
|
|
4
|
+
exports.parseFilterParams = parseFilterParams;
|
|
5
|
+
exports.generateFilterRequestParams = generateFilterRequestParams;
|
|
6
|
+
exports.setS3Credentials = setS3Credentials;
|
|
7
|
+
exports.statusEmoji = statusEmoji;
|
|
8
|
+
exports.fullName = fullName;
|
|
9
|
+
const fileUploader_js_1 = require("../fileUploader.js");
|
|
10
|
+
const constants_js_1 = require("../constants.js");
|
|
3
11
|
/**
|
|
4
12
|
* Set S3 credentials from the provided artifacts object.
|
|
5
13
|
* @param {Object} artifacts - The artifacts object containing S3 credentials.
|
|
6
14
|
*/
|
|
7
15
|
function setS3Credentials(artifacts) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
if (!Object.keys(artifacts).length)
|
|
17
|
+
return;
|
|
18
|
+
console.log(constants_js_1.APP_PREFIX, 'S3 were credentials obtained from Testomat.io...');
|
|
19
|
+
if (artifacts.ACCESS_KEY_ID)
|
|
20
|
+
process.env.S3_ACCESS_KEY_ID = artifacts.ACCESS_KEY_ID;
|
|
21
|
+
if (artifacts.SECRET_ACCESS_KEY)
|
|
22
|
+
process.env.S3_SECRET_ACCESS_KEY = artifacts.SECRET_ACCESS_KEY;
|
|
23
|
+
if (artifacts.REGION)
|
|
24
|
+
process.env.S3_REGION = artifacts.REGION;
|
|
25
|
+
if (artifacts.BUCKET)
|
|
26
|
+
process.env.S3_BUCKET = artifacts.BUCKET;
|
|
27
|
+
if (artifacts.ENDPOINT)
|
|
28
|
+
process.env.S3_ENDPOINT = artifacts.ENDPOINT;
|
|
29
|
+
if (artifacts.SESSION_TOKEN)
|
|
30
|
+
process.env.S3_SESSION_TOKEN = artifacts.SESSION_TOKEN;
|
|
31
|
+
if (artifacts.presign)
|
|
32
|
+
process.env.TESTOMATIO_PRIVATE_ARTIFACTS = '1';
|
|
33
|
+
fileUploader_js_1.upload.resetConfig();
|
|
19
34
|
}
|
|
20
35
|
/**
|
|
21
36
|
* Generates mode request parameters based on the input params.
|
|
22
|
-
* @param {
|
|
23
|
-
* @param {string} params.type - The type of the request (e.g., "tag").
|
|
24
|
-
* @param {string} params.id - The ID associated with the request.
|
|
25
|
-
* @param {string} params.apiKey - The API key for authentication.
|
|
37
|
+
* @param {{type: string, id?: string, apiKey: string}} params - The input parameters for the request.
|
|
26
38
|
* @returns {Object|null} - An object containing the generated request parameters, or null if the type is invalid.
|
|
27
39
|
*/
|
|
28
40
|
function generateFilterRequestParams(params) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
responseType: 'json',
|
|
47
|
-
};
|
|
41
|
+
const { type, id, apiKey } = params;
|
|
42
|
+
if (!type) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (!id) {
|
|
46
|
+
console.error(constants_js_1.APP_PREFIX, `Please make sure your settings "${type.toUpperCase()}"= "${id}" is correct!`);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
params: {
|
|
51
|
+
type,
|
|
52
|
+
id: encodeURIComponent(id),
|
|
53
|
+
api_key: apiKey,
|
|
54
|
+
},
|
|
55
|
+
responseType: 'json',
|
|
56
|
+
};
|
|
48
57
|
}
|
|
49
|
-
|
|
50
58
|
/**
|
|
51
59
|
* Parse filter parameters from a string in the format "type=id".
|
|
52
60
|
* @param {string} opts - The input string containing the filter parameters.
|
|
@@ -54,15 +62,13 @@ function generateFilterRequestParams(params) {
|
|
|
54
62
|
* The object has properties "type" and "id".
|
|
55
63
|
*/
|
|
56
64
|
function parseFilterParams(opts) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
};
|
|
65
|
+
const [type, id] = opts.split('=');
|
|
66
|
+
const validType = updateFilterType(type);
|
|
67
|
+
return {
|
|
68
|
+
type: validType,
|
|
69
|
+
id,
|
|
70
|
+
};
|
|
64
71
|
}
|
|
65
|
-
|
|
66
72
|
/**
|
|
67
73
|
* Update and validate the filter type.
|
|
68
74
|
* @param {string} type - The original filter type.
|
|
@@ -70,58 +76,59 @@ function parseFilterParams(opts) {
|
|
|
70
76
|
* Returns undefined if the type is not valid.
|
|
71
77
|
*/
|
|
72
78
|
function updateFilterType(type) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const index = filterTypes.indexOf(typeLowerCase);
|
|
91
|
-
|
|
92
|
-
return index !== -1 ? filterApi[index] : undefined;
|
|
79
|
+
const typeLowerCase = type.toLowerCase();
|
|
80
|
+
const filterTypes = ['tag-name', 'plan-id', 'label', 'jira-ticket'];
|
|
81
|
+
const filterApi = [
|
|
82
|
+
'tag',
|
|
83
|
+
'plan',
|
|
84
|
+
'label',
|
|
85
|
+
'jira',
|
|
86
|
+
// "ims-issue", //TODO: WIP
|
|
87
|
+
];
|
|
88
|
+
if (!filterTypes.includes(typeLowerCase)) {
|
|
89
|
+
console.log(constants_js_1.APP_PREFIX, `❗❗❗ Invalid "filter=${type}" start settings! Available option list: ${filterTypes}`);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const index = filterTypes.indexOf(typeLowerCase);
|
|
93
|
+
return index !== -1 ? filterApi[index] : undefined;
|
|
93
94
|
}
|
|
94
|
-
|
|
95
95
|
/**
|
|
96
96
|
* Return an emoji based on the provided status.
|
|
97
97
|
* @param {string} status - The status value ('passed', 'failed', or 'skipped').
|
|
98
98
|
* @returns {string} - An emoji corresponding to the provided status.
|
|
99
99
|
*/
|
|
100
100
|
function statusEmoji(status) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
if (status === 'passed')
|
|
102
|
+
return '🟢';
|
|
103
|
+
if (status === 'failed')
|
|
104
|
+
return '🔴';
|
|
105
|
+
if (status === 'skipped')
|
|
106
|
+
return '🟡';
|
|
107
|
+
return '';
|
|
105
108
|
}
|
|
106
|
-
|
|
107
109
|
/**
|
|
108
110
|
* Generate a full name string based on the provided test object.
|
|
109
111
|
* @param {object} t - The test object.
|
|
110
112
|
* @returns {string} - A formatted full name string for the test object.
|
|
111
113
|
*/
|
|
112
114
|
function fullName(t) {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
let line = '';
|
|
116
|
+
if (t.suite_title)
|
|
117
|
+
line = `${t.suite_title}: `;
|
|
118
|
+
line += `**${t.title}**`;
|
|
119
|
+
if (t.example)
|
|
120
|
+
line += ` \`[${Object.values(t.example)}]\``;
|
|
121
|
+
return line;
|
|
118
122
|
}
|
|
119
123
|
|
|
120
|
-
module.exports =
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
module.exports.updateFilterType = updateFilterType;
|
|
125
|
+
|
|
126
|
+
module.exports.parseFilterParams = parseFilterParams;
|
|
127
|
+
|
|
128
|
+
module.exports.generateFilterRequestParams = generateFilterRequestParams;
|
|
129
|
+
|
|
130
|
+
module.exports.setS3Credentials = setS3Credentials;
|
|
131
|
+
|
|
132
|
+
module.exports.statusEmoji = statusEmoji;
|
|
133
|
+
|
|
134
|
+
module.exports.fullName = fullName;
|