@testomatio/reporter 2.0.1-beta.5-timestamp → 2.0.1-beta.6
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/README.md +1 -0
- package/lib/adapter/codecept.d.ts +2 -0
- package/lib/adapter/codecept.js +293 -335
- package/lib/adapter/cucumber/current.d.ts +14 -0
- package/lib/adapter/cucumber/current.js +195 -203
- package/lib/adapter/cucumber/legacy.d.ts +0 -0
- package/lib/adapter/cucumber/legacy.js +130 -155
- package/lib/adapter/cucumber.d.ts +2 -0
- package/lib/adapter/cucumber.js +5 -16
- package/lib/adapter/cypress-plugin/index.d.ts +2 -0
- package/lib/adapter/cypress-plugin/index.js +91 -105
- package/lib/adapter/jasmine.d.ts +11 -0
- package/lib/adapter/jasmine.js +54 -53
- package/lib/adapter/jest.d.ts +13 -0
- package/lib/adapter/jest.js +97 -99
- package/lib/adapter/mocha.d.ts +2 -0
- package/lib/adapter/mocha.js +112 -141
- package/lib/adapter/nightwatch.d.ts +4 -0
- package/lib/adapter/nightwatch.js +80 -0
- package/lib/adapter/playwright.d.ts +14 -0
- package/lib/adapter/playwright.js +199 -231
- package/lib/adapter/vitest.d.ts +35 -0
- package/lib/adapter/vitest.js +150 -149
- package/lib/adapter/webdriver.d.ts +24 -0
- package/lib/adapter/webdriver.js +144 -121
- package/lib/bin/cli.d.ts +2 -0
- package/lib/bin/cli.js +229 -211
- package/lib/bin/reportXml.d.ts +2 -0
- package/lib/bin/reportXml.js +51 -52
- package/lib/bin/startTest.d.ts +2 -0
- package/lib/bin/startTest.js +83 -95
- package/lib/bin/uploadArtifacts.d.ts +2 -0
- package/lib/bin/uploadArtifacts.js +56 -61
- package/lib/client.d.ts +76 -0
- package/lib/client.js +429 -465
- package/lib/config.d.ts +1 -0
- package/lib/config.js +18 -23
- package/lib/constants.d.ts +25 -0
- package/lib/constants.js +50 -44
- package/lib/data-storage.d.ts +34 -0
- package/lib/data-storage.js +216 -188
- package/lib/junit-adapter/adapter.d.ts +9 -0
- package/lib/junit-adapter/adapter.js +17 -20
- package/lib/junit-adapter/csharp.d.ts +5 -0
- package/lib/junit-adapter/csharp.js +28 -14
- package/lib/junit-adapter/index.d.ts +3 -0
- package/lib/junit-adapter/index.js +27 -25
- package/lib/junit-adapter/java.d.ts +5 -0
- package/lib/junit-adapter/java.js +41 -53
- package/lib/junit-adapter/javascript.d.ts +4 -0
- package/lib/junit-adapter/javascript.js +30 -27
- package/lib/junit-adapter/python.d.ts +5 -0
- package/lib/junit-adapter/python.js +38 -37
- package/lib/junit-adapter/ruby.d.ts +4 -0
- package/lib/junit-adapter/ruby.js +11 -8
- package/lib/output.d.ts +11 -0
- package/lib/output.js +44 -52
- package/lib/package.json +3 -0
- package/lib/pipe/bitbucket.d.ts +25 -0
- package/lib/pipe/bitbucket.js +223 -230
- package/lib/pipe/csv.d.ts +47 -0
- package/lib/pipe/csv.js +113 -126
- package/lib/pipe/debug.d.ts +29 -0
- package/lib/pipe/debug.js +125 -99
- package/lib/pipe/github.d.ts +30 -0
- package/lib/pipe/github.js +218 -213
- package/lib/pipe/gitlab.d.ts +25 -0
- package/lib/pipe/gitlab.js +183 -206
- package/lib/pipe/html.d.ts +35 -0
- package/lib/pipe/html.js +258 -321
- package/lib/pipe/index.d.ts +1 -0
- package/lib/pipe/index.js +94 -66
- package/lib/pipe/testomatio.d.ts +71 -0
- package/lib/pipe/testomatio.js +429 -474
- package/lib/replay.d.ts +31 -0
- package/lib/replay.js +255 -0
- package/lib/reporter-functions.d.ts +34 -0
- package/lib/reporter-functions.js +28 -26
- package/lib/reporter.d.ts +232 -0
- package/lib/reporter.js +34 -29
- package/lib/services/artifacts.d.ts +33 -0
- package/lib/services/artifacts.js +55 -51
- package/lib/services/index.d.ts +9 -0
- package/lib/services/index.js +14 -12
- package/lib/services/key-values.d.ts +27 -0
- package/lib/services/key-values.js +56 -53
- package/lib/services/logger.d.ts +64 -0
- package/lib/services/logger.js +226 -245
- package/lib/template/testomatio.hbs +1026 -1366
- package/lib/uploader.d.ts +60 -0
- package/lib/uploader.js +295 -364
- package/lib/utils/pipe_utils.d.ts +41 -0
- package/lib/utils/pipe_utils.js +89 -85
- package/lib/utils/utils.d.ts +54 -0
- package/lib/utils/utils.js +398 -307
- package/lib/xmlReader.d.ts +92 -0
- package/lib/xmlReader.js +525 -532
- package/package.json +64 -21
- package/src/adapter/codecept.js +373 -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/nightwatch.js +88 -0
- package/src/adapter/playwright.js +254 -0
- package/src/adapter/vitest.js +183 -0
- package/src/adapter/webdriver.js +142 -0
- package/src/bin/cli.js +348 -0
- package/src/bin/reportXml.js +77 -0
- package/src/bin/startTest.js +124 -0
- package/src/bin/uploadArtifacts.js +91 -0
- package/src/client.js +515 -0
- package/src/config.js +30 -0
- package/src/constants.js +53 -0
- package/src/data-storage.js +204 -0
- package/src/junit-adapter/adapter.js +23 -0
- package/src/junit-adapter/csharp.js +28 -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 +252 -0
- package/src/pipe/csv.js +140 -0
- package/src/pipe/debug.js +125 -0
- package/src/pipe/github.js +232 -0
- package/src/pipe/gitlab.js +247 -0
- package/src/pipe/html.js +373 -0
- package/src/pipe/index.js +71 -0
- package/src/pipe/testomatio.js +504 -0
- package/src/replay.js +262 -0
- package/src/reporter-functions.js +55 -0
- package/src/reporter.cjs_decprecated +21 -0
- package/src/reporter.js +33 -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 +315 -0
- package/src/template/emptyData.svg +23 -0
- package/src/template/testomatio.hbs +1081 -0
- package/src/uploader.js +376 -0
- package/src/utils/pipe_utils.js +119 -0
- package/src/utils/utils.js +416 -0
- package/src/xmlReader.js +614 -0
package/lib/pipe/index.js
CHANGED
|
@@ -1,69 +1,97 @@
|
|
|
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
|
-
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
|
-
}
|
|
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]; } };
|
|
41
7
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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'));
|
|
93
|
+
}
|
|
94
|
+
return pipes;
|
|
67
95
|
}
|
|
68
96
|
|
|
69
|
-
module.exports =
|
|
97
|
+
module.exports.pipesFactory = pipesFactory;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export default TestomatioPipe;
|
|
2
|
+
export type Pipe = import("../../types/types.js").Pipe;
|
|
3
|
+
export type TestData = import("../../types/types.js").TestData;
|
|
4
|
+
/**
|
|
5
|
+
* @typedef {import('../../types/types.js').Pipe} Pipe
|
|
6
|
+
* @typedef {import('../../types/types.js').TestData} TestData
|
|
7
|
+
* @class TestomatioPipe
|
|
8
|
+
* @implements {Pipe}
|
|
9
|
+
*/
|
|
10
|
+
declare class TestomatioPipe implements Pipe {
|
|
11
|
+
constructor(params: any, store: any);
|
|
12
|
+
batch: {
|
|
13
|
+
isEnabled: any;
|
|
14
|
+
intervalFunction: any;
|
|
15
|
+
intervalTime: number;
|
|
16
|
+
tests: any[];
|
|
17
|
+
batchIndex: number;
|
|
18
|
+
numberOfTimesCalledWithoutTests: number;
|
|
19
|
+
};
|
|
20
|
+
retriesTimestamps: any[];
|
|
21
|
+
reportingCanceledDueToReqFailures: boolean;
|
|
22
|
+
notReportedTestsCount: number;
|
|
23
|
+
isEnabled: boolean;
|
|
24
|
+
url: any;
|
|
25
|
+
apiKey: any;
|
|
26
|
+
parallel: any;
|
|
27
|
+
store: any;
|
|
28
|
+
title: any;
|
|
29
|
+
sharedRun: boolean;
|
|
30
|
+
sharedRunTimeout: boolean;
|
|
31
|
+
groupTitle: any;
|
|
32
|
+
env: string;
|
|
33
|
+
label: string;
|
|
34
|
+
client: Gaxios;
|
|
35
|
+
proceed: string;
|
|
36
|
+
jiraId: string;
|
|
37
|
+
runId: any;
|
|
38
|
+
createNewTests: any;
|
|
39
|
+
hasUnmatchedTests: boolean;
|
|
40
|
+
requestFailures: number;
|
|
41
|
+
/**
|
|
42
|
+
* Asynchronously prepares and retrieves the Testomat.io test grepList based on the provided options.
|
|
43
|
+
* @param {Object} opts - The options for preparing the test grepList.
|
|
44
|
+
* @returns {Promise<string[]>} - An array containing the retrieved
|
|
45
|
+
* test grepList, or an empty array if no tests are found or the request is disabled.
|
|
46
|
+
* @throws {Error} - Throws an error if there was a problem while making the request.
|
|
47
|
+
*/
|
|
48
|
+
prepareRun(opts: any): Promise<string[]>;
|
|
49
|
+
/**
|
|
50
|
+
* Creates a new run on Testomat.io
|
|
51
|
+
* @param {{isBatchEnabled?: boolean}} params
|
|
52
|
+
* @returns Promise<void>
|
|
53
|
+
*/
|
|
54
|
+
createRun(params?: {
|
|
55
|
+
isBatchEnabled?: boolean;
|
|
56
|
+
}): Promise<void>;
|
|
57
|
+
runUrl: string;
|
|
58
|
+
runPublicUrl: any;
|
|
59
|
+
/**
|
|
60
|
+
* Adds a test to the batch uploader (or reports a single test if batch uploading is disabled)
|
|
61
|
+
*/
|
|
62
|
+
addTest(data: any): Promise<void | import("gaxios").GaxiosResponse<any>>;
|
|
63
|
+
/**
|
|
64
|
+
* @param {import('../../types/types.js').RunData} params
|
|
65
|
+
* @returns
|
|
66
|
+
*/
|
|
67
|
+
finishRun(params: import("../../types/types.js").RunData): Promise<void>;
|
|
68
|
+
toString(): string;
|
|
69
|
+
#private;
|
|
70
|
+
}
|
|
71
|
+
import { Gaxios } from 'gaxios';
|