@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/bin/startTest.js
CHANGED
|
@@ -1,118 +1,106 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const cross_spawn_1 = require("cross-spawn");
|
|
8
|
+
const commander_1 = require("commander");
|
|
9
|
+
const picocolors_1 = __importDefault(require("picocolors"));
|
|
10
|
+
const client_js_1 = __importDefault(require("../client.js"));
|
|
11
|
+
const constants_js_1 = require("../constants.js");
|
|
12
|
+
const utils_js_1 = require("../utils/utils.js");
|
|
13
|
+
const config_js_1 = require("../config.js");
|
|
14
|
+
const dotenv_1 = __importDefault(require("dotenv"));
|
|
15
|
+
const version = (0, utils_js_1.getPackageVersion)();
|
|
16
|
+
console.log(picocolors_1.default.cyan(picocolors_1.default.bold(` 🤩 Testomat.io Reporter v${version}`)));
|
|
17
|
+
const program = new commander_1.Command();
|
|
12
18
|
program
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
.option('-c, --command <cmd>', 'Test runner command')
|
|
20
|
+
.option('--launch', 'Start a new run and return its ID')
|
|
21
|
+
.option('--finish', 'Finish Run by its ID')
|
|
22
|
+
.option('--env-file <envfile>', 'Load environment variables from env file')
|
|
23
|
+
.option('--filter <filter>', 'Additional execution filter')
|
|
24
|
+
.action(async (opts) => {
|
|
19
25
|
const { launch, finish, filter } = opts;
|
|
20
26
|
let { command } = opts;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const apiKey = process.env['INPUT_TESTOMATIO-KEY'] || config.TESTOMATIO;
|
|
27
|
+
if (opts.envFile)
|
|
28
|
+
dotenv_1.default.config({ path: opts.envFile });
|
|
29
|
+
const apiKey = process.env['INPUT_TESTOMATIO-KEY'] || config_js_1.config.TESTOMATIO;
|
|
25
30
|
const title = process.env.TESTOMATIO_TITLE;
|
|
26
|
-
|
|
27
31
|
if (launch) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return;
|
|
32
|
+
console.log('Starting a new Run on Testomat.io...');
|
|
33
|
+
const client = new client_js_1.default({ apiKey });
|
|
34
|
+
client.createRun().then(() => {
|
|
35
|
+
console.log(process.env.runId);
|
|
36
|
+
process.exit(0);
|
|
37
|
+
});
|
|
38
|
+
return;
|
|
36
39
|
}
|
|
37
|
-
|
|
38
40
|
if (finish) {
|
|
39
|
-
|
|
40
|
-
console
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
41
|
+
// TODO: add error in case of TESTOMATIO environment variable is not set
|
|
42
|
+
// because command is fine in console, but actually (on testomat.io) run is not finished
|
|
43
|
+
if (!process.env.TESTOMATIO_RUN) {
|
|
44
|
+
console.log('TESTOMATIO_RUN environment variable must be set.');
|
|
45
|
+
return process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
console.log('Finishing Run on Testomat.io...');
|
|
48
|
+
const client = new client_js_1.default({ apiKey });
|
|
49
|
+
// @ts-ignore
|
|
50
|
+
client.updateRunStatus(constants_js_1.STATUS.FINISHED).then(() => {
|
|
51
|
+
console.log(picocolors_1.default.yellow(`Run ${process.env.TESTOMATIO_RUN} was finished`));
|
|
52
|
+
process.exit(0);
|
|
53
|
+
});
|
|
54
|
+
return;
|
|
53
55
|
}
|
|
54
|
-
|
|
55
56
|
let exitCode = 0;
|
|
56
|
-
|
|
57
57
|
if (!command.split) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
process.exitCode = 255;
|
|
59
|
+
console.log(constants_js_1.APP_PREFIX, `No command provided. Use -c option to launch a test runner.`);
|
|
60
|
+
return;
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
const client = new TestomatClient({ apiKey, title, parallel: true });
|
|
64
|
-
|
|
62
|
+
const client = new client_js_1.default({ apiKey, title, parallel: true });
|
|
65
63
|
if (filter) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
64
|
+
const [pipe, ...optsArray] = filter.split(':');
|
|
65
|
+
const pipeOptions = optsArray.join(':');
|
|
66
|
+
try {
|
|
67
|
+
const tests = await client.prepareRun({ pipe, pipeOptions });
|
|
68
|
+
if (!tests || tests.length === 0) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const grep = ` --grep (${tests.join('|')})`;
|
|
72
|
+
command += grep;
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
console.log(constants_js_1.APP_PREFIX, err);
|
|
74
76
|
}
|
|
75
|
-
|
|
76
|
-
const grep = ` --grep (${tests.join('|')})`;
|
|
77
|
-
command += grep;
|
|
78
|
-
} catch (err) {
|
|
79
|
-
console.log(APP_PREFIX, err);
|
|
80
|
-
}
|
|
81
77
|
}
|
|
82
|
-
|
|
83
78
|
const testCmds = command.split(' ');
|
|
84
|
-
console.log(APP_PREFIX, `🚀 Running`,
|
|
85
|
-
|
|
79
|
+
console.log(constants_js_1.APP_PREFIX, `🚀 Running`, picocolors_1.default.green(command));
|
|
86
80
|
if (!apiKey) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return;
|
|
81
|
+
const cmd = (0, cross_spawn_1.spawn)(testCmds[0], testCmds.slice(1), { stdio: 'inherit' });
|
|
82
|
+
cmd.on('close', code => {
|
|
83
|
+
console.log(constants_js_1.APP_PREFIX, '⚠️ ', `Runner exited with ${picocolors_1.default.bold(code)}, report is ignored`);
|
|
84
|
+
if (code > exitCode)
|
|
85
|
+
exitCode = code;
|
|
86
|
+
process.exitCode = exitCode;
|
|
87
|
+
});
|
|
88
|
+
return;
|
|
97
89
|
}
|
|
98
|
-
|
|
99
90
|
client.createRun().then(() => {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
});
|
|
91
|
+
const cmd = (0, cross_spawn_1.spawn)(testCmds[0], testCmds.slice(1), { stdio: 'inherit' });
|
|
92
|
+
cmd.on('close', code => {
|
|
93
|
+
const emoji = code === 0 ? '🟢' : '🔴';
|
|
94
|
+
console.log(constants_js_1.APP_PREFIX, emoji, `Runner exited with ${picocolors_1.default.bold(code)}`);
|
|
95
|
+
const status = code === 0 ? 'passed' : 'failed';
|
|
96
|
+
client.updateRunStatus(status, true);
|
|
97
|
+
if (code > exitCode)
|
|
98
|
+
exitCode = code;
|
|
99
|
+
process.exitCode = exitCode;
|
|
100
|
+
});
|
|
111
101
|
});
|
|
112
|
-
|
|
113
|
-
|
|
102
|
+
});
|
|
114
103
|
if (process.argv.length <= 2) {
|
|
115
|
-
|
|
104
|
+
program.outputHelp();
|
|
116
105
|
}
|
|
117
|
-
|
|
118
106
|
program.parse(process.argv);
|
|
@@ -1,87 +1,82 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const picocolors_1 = __importDefault(require("picocolors"));
|
|
9
|
+
const debug_1 = __importDefault(require("debug"));
|
|
10
|
+
const client_js_1 = __importDefault(require("../client.js"));
|
|
11
|
+
const constants_js_1 = require("../constants.js");
|
|
12
|
+
const utils_js_1 = require("../utils/utils.js");
|
|
13
|
+
const config_js_1 = require("../config.js");
|
|
14
|
+
const utils_js_2 = require("../utils/utils.js");
|
|
15
|
+
const dotenv_1 = __importDefault(require("dotenv"));
|
|
16
|
+
const debug = (0, debug_1.default)('@testomatio/reporter:upload-cli');
|
|
17
|
+
const version = (0, utils_js_1.getPackageVersion)();
|
|
18
|
+
console.log(picocolors_1.default.cyan(picocolors_1.default.bold(` 🤩 Testomat.io Reporter v${version}`)));
|
|
19
|
+
const program = new commander_1.Command();
|
|
13
20
|
program
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
21
|
+
.option('--env-file <envfile>', 'Load environment variables from env file')
|
|
22
|
+
.option('--force', 'Re-upload artifacts even if they were uploaded before')
|
|
23
|
+
.action(async (opts) => {
|
|
17
24
|
if (opts.envFile) {
|
|
18
|
-
|
|
19
|
-
} else {
|
|
20
|
-
// try to load from env file
|
|
21
|
-
require('dotenv').config(); // eslint-disable-line
|
|
25
|
+
dotenv_1.default.config({ path: opts.envFile });
|
|
22
26
|
}
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
else {
|
|
28
|
+
dotenv_1.default.config();
|
|
29
|
+
}
|
|
30
|
+
const apiKey = config_js_1.config.TESTOMATIO;
|
|
25
31
|
process.env.TESTOMATIO_DISABLE_ARTIFACTS = '';
|
|
26
|
-
const runId = process.env.TESTOMATIO_RUN || process.env.runId || readLatestRunId();
|
|
27
|
-
|
|
32
|
+
const runId = process.env.TESTOMATIO_RUN || process.env.runId || (0, utils_js_2.readLatestRunId)();
|
|
28
33
|
if (!runId) {
|
|
29
|
-
|
|
30
|
-
|
|
34
|
+
console.log('TESTOMATIO_RUN environment variable must be set or restored from a previous run.');
|
|
35
|
+
return process.exit(1);
|
|
31
36
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
isBatchEnabled: false,
|
|
37
|
+
const client = new client_js_1.default({
|
|
38
|
+
apiKey,
|
|
39
|
+
runId,
|
|
40
|
+
isBatchEnabled: false,
|
|
37
41
|
});
|
|
38
42
|
let testruns = client.uploader.readUploadedFiles(process.env.TESTOMATIO_RUN);
|
|
39
|
-
|
|
40
43
|
const numTotalArtifacts = testruns.length;
|
|
41
|
-
|
|
42
44
|
debug('Found testruns:', testruns);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
if (!opts.force)
|
|
46
|
+
testruns = testruns.filter(tr => !tr.uploaded);
|
|
46
47
|
if (!testruns.length) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
console.log(constants_js_1.APP_PREFIX, 'Total artifacts:', numTotalArtifacts);
|
|
49
|
+
if (numTotalArtifacts) {
|
|
50
|
+
console.log(constants_js_1.APP_PREFIX, 'No new artifacts to upload');
|
|
51
|
+
console.log(constants_js_1.APP_PREFIX, 'To re-upload artifacts run this command with --force flag');
|
|
52
|
+
}
|
|
53
|
+
process.exit(0);
|
|
53
54
|
}
|
|
54
|
-
|
|
55
55
|
const testrunsByRid = testruns.reduce((acc, { rid, file }) => {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
if (!acc[rid]) {
|
|
57
|
+
acc[rid] = [];
|
|
58
|
+
}
|
|
59
|
+
if (!acc[rid].includes(file))
|
|
60
|
+
acc[rid].push(file);
|
|
61
|
+
return acc;
|
|
61
62
|
}, {});
|
|
62
|
-
|
|
63
63
|
// we need to obtain S3 credentials
|
|
64
64
|
await client.createRun();
|
|
65
|
-
|
|
66
65
|
client.uploader.checkEnabled();
|
|
67
66
|
client.uploader.disableLogStorage();
|
|
68
|
-
|
|
69
67
|
for (const rid in testrunsByRid) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
const files = testrunsByRid[rid];
|
|
69
|
+
await client.addTestRun(undefined, {
|
|
70
|
+
rid,
|
|
71
|
+
files,
|
|
72
|
+
});
|
|
75
73
|
}
|
|
76
|
-
|
|
77
|
-
console.log(APP_PREFIX, client.uploader.successfulUploads.length, 'artifacts uploaded');
|
|
74
|
+
console.log(constants_js_1.APP_PREFIX, client.uploader.successfulUploads.length, 'artifacts uploaded');
|
|
78
75
|
if (client.uploader.failedUploads.length) {
|
|
79
|
-
|
|
76
|
+
console.log(constants_js_1.APP_PREFIX, client.uploader.failedUploads.length, 'artifacts failed to upload');
|
|
80
77
|
}
|
|
81
|
-
|
|
82
|
-
|
|
78
|
+
});
|
|
83
79
|
if (process.argv.length <= 1) {
|
|
84
|
-
|
|
80
|
+
program.outputHelp();
|
|
85
81
|
}
|
|
86
|
-
|
|
87
82
|
program.parse(process.argv);
|
package/lib/client.d.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export default Client;
|
|
2
|
+
export type TestData = import("../types/types.js").TestData;
|
|
3
|
+
export type PipeResult = import("../types/types.js").PipeResult;
|
|
4
|
+
/**
|
|
5
|
+
* @typedef {import('../types/types.js').TestData} TestData
|
|
6
|
+
* @typedef {import('../types/types.js').PipeResult} PipeResult
|
|
7
|
+
*/
|
|
8
|
+
export class Client {
|
|
9
|
+
/**
|
|
10
|
+
* Create a Testomat client instance
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
constructor(params?: {});
|
|
14
|
+
paramsForPipesFactory: {};
|
|
15
|
+
pipeStore: {};
|
|
16
|
+
runId: `${string}-${string}-${string}-${string}-${string}`;
|
|
17
|
+
queue: Promise<void>;
|
|
18
|
+
version: any;
|
|
19
|
+
executionList: Promise<void>;
|
|
20
|
+
uploader: S3Uploader;
|
|
21
|
+
/**
|
|
22
|
+
* Asynchronously prepares the execution list for running tests through various pipes.
|
|
23
|
+
* Each pipe in the client is checked for enablement,
|
|
24
|
+
* and if all pipes are disabled, the function returns a resolved Promise.
|
|
25
|
+
* Otherwise, it executes the `prepareRun` method for each enabled pipe and collects the results.
|
|
26
|
+
* The results are then filtered to remove any undefined values.
|
|
27
|
+
* If no valid results are found, the function returns undefined.
|
|
28
|
+
* Otherwise, it returns the first non-empty array from the filtered results.
|
|
29
|
+
*
|
|
30
|
+
* @param {Object} params - The options for preparing the test execution list.
|
|
31
|
+
* @param {string} params.pipe - Name of the executed pipe.
|
|
32
|
+
* @param {string} params.pipeOptions - Filter option.
|
|
33
|
+
* @returns {Promise<any>} - A Promise that resolves to an
|
|
34
|
+
* array containing the prepared execution list,
|
|
35
|
+
* or resolves to undefined if no valid results are found or if all pipes are disabled.
|
|
36
|
+
*/
|
|
37
|
+
prepareRun(params: {
|
|
38
|
+
pipe: string;
|
|
39
|
+
pipeOptions: string;
|
|
40
|
+
}): Promise<any>;
|
|
41
|
+
pipes: any[];
|
|
42
|
+
/**
|
|
43
|
+
* Used to create a new Test run
|
|
44
|
+
*
|
|
45
|
+
* @returns {Promise<any>} - resolves to Run id which should be used to update / add test
|
|
46
|
+
*/
|
|
47
|
+
createRun(params: any): Promise<any>;
|
|
48
|
+
/**
|
|
49
|
+
* Updates test status and its data
|
|
50
|
+
*
|
|
51
|
+
* @param {string|undefined} status
|
|
52
|
+
* @param {TestData} [testData]
|
|
53
|
+
* @returns {Promise<PipeResult[]>}
|
|
54
|
+
*/
|
|
55
|
+
addTestRun(status: string | undefined, testData?: TestData): Promise<PipeResult[]>;
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
* Updates the status of the current test run and finishes the run.
|
|
59
|
+
* @param {'passed' | 'failed' | 'skipped' | 'finished'} status - The status of the current test run.
|
|
60
|
+
* Must be one of "passed", "failed", or "finished"
|
|
61
|
+
* @param {boolean} [isParallel] - Whether the current test run was executed in parallel with other tests.
|
|
62
|
+
* @returns {Promise<any>} - A Promise that resolves when finishes the run.
|
|
63
|
+
*/
|
|
64
|
+
updateRunStatus(status: "passed" | "failed" | "skipped" | "finished", isParallel?: boolean): Promise<any>;
|
|
65
|
+
/**
|
|
66
|
+
* Returns the formatted stack including the stack trace, steps, and logs.
|
|
67
|
+
* @returns {string}
|
|
68
|
+
*/
|
|
69
|
+
formatLogs({ error, steps, logs }: {
|
|
70
|
+
error: any;
|
|
71
|
+
steps: any;
|
|
72
|
+
logs: any;
|
|
73
|
+
}): string;
|
|
74
|
+
formatError(error: any, message: any): string;
|
|
75
|
+
}
|
|
76
|
+
import { S3Uploader } from './uploader.js';
|