@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/package.json CHANGED
@@ -1,23 +1,21 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "2.0.1-beta.4",
3
+ "version": "2.0.1-beta.5-timestamp",
4
4
  "description": "Testomatio Reporter Client",
5
- "engines": {
6
- "node": ">=18"
7
- },
5
+ "main": "./lib/reporter.js",
8
6
  "typings": "typings/index.d.ts",
9
7
  "repository": "git@github.com:testomatio/reporter.git",
10
8
  "author": "Michael Bodnarchuk <davert@testomat.io>,Koushik Mohan <koushikmohan1996@gmail.com>",
11
9
  "license": "MIT",
12
- "type": "module",
13
10
  "dependencies": {
14
11
  "@aws-sdk/client-s3": "^3.279.0",
15
12
  "@aws-sdk/lib-storage": "^3.279.0",
16
- "@cucumber/cucumber": "^10.9.0",
17
- "@octokit/rest": "^21.1.1",
13
+ "@octokit/rest": "^20.1.2",
18
14
  "aws-sdk": "^2.1072.0",
19
- "gaxios": ">=6.0 || >=7.0.0-rc.4 || <8",
15
+ "axios": "^1.6.2",
16
+ "axios-retry": "^3.9.1",
20
17
  "callsite-record": "^4.1.4",
18
+ "chalk": "^4.1.0",
21
19
  "commander": "^12",
22
20
  "cross-spawn": "^7.0.3",
23
21
  "csv-writer": "^1.6.0",
@@ -35,7 +33,6 @@
35
33
  "lodash.memoize": "^4.1.2",
36
34
  "lodash.merge": "^4.6.2",
37
35
  "minimatch": "^9.0.3",
38
- "picocolors": "^1.0.1",
39
36
  "pretty-ms": "^7.0.1",
40
37
  "promise-retry": "^2.0.1",
41
38
  "strip-ansi": "^7.1.0",
@@ -44,91 +41,51 @@
44
41
  "files": [
45
42
  "bin",
46
43
  "lib",
47
- "src",
48
44
  "testcafe"
49
45
  ],
50
46
  "scripts": {
51
47
  "clear-exportdir": "rm -rf export/",
52
48
  "pretty": "npx prettier --check .",
53
49
  "pretty:fix": "prettier --write .",
54
- "lint": "eslint src",
55
- "lint:fix": "eslint src --fix",
50
+ "lint": "eslint lib",
51
+ "lint:fix": "eslint lib --fix",
56
52
  "format": "npm run lint:fix && npm run pretty:fix",
57
- "test": "mocha tests/** --ignore tests/adapter/playwright.test.js --ignore tests/adapter/codecept.test.js",
58
- "test:frameworks": "mocha tests/adapter/playwright.test.js tests/adapter/codecept.test.js",
59
- "install-example-deps": "cd example/playwright && npm install && cd ../codecept && npm install",
53
+ "test": "mocha tests/**",
60
54
  "init": "cd ./tests/adapter/examples/cucumber && npm i",
61
- "test:adapter": "node node_modules/mocha/bin/mocha './tests/adapter/index.test.js'",
55
+ "test:adapter": "mocha './tests/adapter/index.test.js'",
62
56
  "test:pipes": "mocha './tests/pipes/*_test.js'",
63
57
  "test:adapter:jest:example": "jest './tests/adapter/examples/jest/index.test.js' --config='./tests/adapter/examples/jest/jest.config.js'",
64
- "test:adapter:mocha:example": "mocha './tests/adapter/examples/mocha/index.test.js' --config='./tests/adapter/examples/mocha/mocha.config.cjs'",
65
- "test:adapter:jasmine:example": "jasmine './tests/adapter/examples/jasmine/index.test.js' --reporter=./lib/adapter/jasmine.js",
58
+ "test:adapter:mocha:example": "mocha './tests/adapter/examples/mocha/index.test.js' --config='./tests/adapter/examples/mocha/mocha.config.js'",
59
+ "test:adapter:jasmine:example": "./tests/adapter/examples/jasmine/passReporterOpts.sh && jasmine './tests/adapter/examples/jasmine/index.test.js' --reporter=./../../../lib/adapter/jasmine.js",
66
60
  "test:adapter:codecept:example": "codeceptjs run --config='./tests/adapter/examples/codecept/codecept.conf.js'",
67
61
  "test:adapter:cucumber:example": "cd ./tests/adapter/examples/cucumber && npx cucumber-js",
68
- "test:adapter:playwright:example": "npx playwright test --config='./tests/adapter/examples/playwright/playwright.config.ts'",
69
- "test:adapter:vitest:example": "npx vitest --config='./tests/adapter/examples/vitest/vitest.config.ts'",
70
- "test:storage": "npx mocha tests-storage/artifact-storage.test.js && npx mocha tests-storage/data-storage.test.js && TESTOMATIO_INTERCEPT_CONSOLE_LOGS=true npx mocha tests-storage/logger.test.js && npx mocha tests-storage/logger-2.test.js && npx mocha tests-storage/reporter-functions.test.js",
71
- "build": "rm -rf ./cjs && tsc --module commonjs && npx tsx build/scripts/edit-js-files.js && npx tsx build/scripts/edit-package-json.js && chmod +x ./build/scripts/copy-tesmplate.sh && ./build/scripts/copy-tesmplate.sh",
72
- "build:bun": "rm -rf ./cjs && bun build ./src/reporter.js ./src/bin/reportXml.js ./src/bin/startTest.js ./src/bin/uploadArtifacts.js --outdir ./cjs --target node && bun build/scripts/edit-js-files.js && bun build/scripts/edit-package-json.js && chmod +x ./build/scripts/copy-tesmplate.sh && ./build/scripts/copy-tesmplate.sh",
73
- "build:watch:bun": "rm -rf ./cjs && bun build ./src/bin/reportXml.js ./src/bin/startTest.js ./src/bin/uploadArtifacts.js --outdir ./cjs --target node --watch --onSuccess \"build/scripts/post-build.js\""
62
+ "test:adapter:vitest:example": "vitest --config='./tests/adapter/examples/vitest/vitest.config.js'",
63
+ "test:storage": "npx mocha tests-storage/artifact-storage.test.js && npx mocha tests-storage/data-storage.test.js && TESTOMATIO_INTERCEPT_CONSOLE_LOGS=true npx mocha tests-storage/logger.test.js && npx mocha tests-storage/logger-2.test.js && npx mocha tests-storage/reporter-functions.test.js"
74
64
  },
75
65
  "devDependencies": {
76
- "@playwright/test": "^1.49.1",
66
+ "@cucumber/cucumber": "^9.3.0",
77
67
  "@redocly/cli": "^1.0.0-beta.125",
78
- "@types/cross-spawn": "^6.0.6",
79
- "@types/cucumber": "^7.0.0",
80
- "@types/mocha": "^10.0.7",
81
68
  "@wdio/reporter": "^7.16.13",
82
69
  "chai": "^4.3.6",
83
- "codeceptjs": "^3.6.5",
70
+ "codeceptjs": "^3.5.11",
84
71
  "cucumber": "^6.0.7",
85
- "eslint": "^9.24.0",
72
+ "eslint": "^8.7.0",
73
+ "eslint-config-airbnb-base": "^15.0.0",
86
74
  "eslint-config-prettier": "^8.3.0",
87
75
  "eslint-plugin-import": "^2.25.4",
88
- "jasmine": "^5.2.0",
76
+ "jasmine": "^3.10.0",
89
77
  "jest": "^27.4.7",
90
78
  "jsdom": "^22.1.0",
91
- "mocha": "^9.2.0",
79
+ "mocha": "^11.1.0",
92
80
  "mock-http-server": "^1.4.5",
93
81
  "pino": "^8.15.0",
94
82
  "prettier": "^3.2.5",
95
- "puppeteer": "^22.15.0",
96
- "typescript": "^5.5.4",
97
- "vitest": "^1.6.0"
83
+ "puppeteer": "^22.15.0"
98
84
  },
99
85
  "bin": {
100
86
  "@testomatio/reporter": "./lib/bin/cli.js",
101
87
  "report-xml": "./lib/bin/reportXml.js",
102
88
  "start-test-run": "./lib/bin/startTest.js",
103
89
  "upload-artifacts": "./lib/bin/uploadArtifacts.js"
104
- },
105
- "exports": {
106
- ".": {
107
- "import": "./src/reporter.js",
108
- "require": "./lib/reporter.js",
109
- "types": "./types/types.d.ts"
110
- },
111
- "./lib/adapter/codecept/codecept.js": "./lib/adapter/codecept.js",
112
- "./lib/adapter/codecept": "./lib/adapter/codecept.js",
113
- "./codecept": "./lib/adapter/codecept.js",
114
- "./lib/adapter/cucumber/cucumber.js": "./lib/adapter/cucumber/current.js",
115
- "./cucumber": "./lib/adapter/cucumber/current.js",
116
- "./lib/adapter/cypress-plugin": "./lib/adapter/cypress-plugin/index.js",
117
- "./cypress-plugin": "./lib/adapter/cypress-plugin/index.js",
118
- "./cypress": "./lib/adapter/cypress-plugin/index.js",
119
- "./lib/adapter/jasmine.js": "./lib/adapter/jasmine.js",
120
- "./jasmine": "./lib/adapter/jasmine.js",
121
- "./lib/adapter/jest.js": "./lib/adapter/jest.js",
122
- "./jest": "./lib/adapter/jest.js",
123
- "./lib/adapter/mocha/mocha.js": "./lib/adapter/mocha.js",
124
- "./mocha": "./lib/adapter/mocha.js",
125
- "./lib/adapter/playwright.js": "./lib/adapter/playwright.js",
126
- "./nightwatch": "./lib/adapter/nightwatch.js",
127
- "./playwright": "./lib/adapter/playwright.js",
128
- "./vitest": "./lib/adapter/vitest.js",
129
- "./lib/adapter/webdriver.js": "./lib/adapter/webdriver.js",
130
- "./lib/adapter/webdriver": "./lib/adapter/webdriver.js",
131
- "./webdriver": "./lib/adapter/webdriver.js",
132
- "./wdio": "./lib/adapter/webdriver.js"
133
90
  }
134
91
  }
@@ -1,2 +0,0 @@
1
- export default CodeceptReporter;
2
- export function CodeceptReporter(config: any): void;
@@ -1,14 +0,0 @@
1
- export default CucumberReporter;
2
- export class CucumberReporter extends Formatter {
3
- constructor(options: any);
4
- failures: any[];
5
- cases: any[];
6
- client: TestomatClient;
7
- status: string;
8
- parseEnvelope(envelope: any): void;
9
- onTestCaseStarted(testCaseStarted: any): void;
10
- onTestCaseFinished(testCaseFinished: any): void;
11
- onTestRunFinished(envelope: any): void;
12
- }
13
- import { Formatter } from '@cucumber/cucumber';
14
- import TestomatClient from '../../client.js';
File without changes
@@ -1,2 +0,0 @@
1
- export default CucumberReporter;
2
- import { CucumberReporter } from './cucumber/current.js';
@@ -1,2 +0,0 @@
1
- export default testomatioReporter;
2
- declare function testomatioReporter(on: any): void;
@@ -1,11 +0,0 @@
1
- export default JasmineReporter;
2
- export class JasmineReporter {
3
- constructor(options: any);
4
- testTimeMap: {};
5
- client: TestomatClient;
6
- getDuration(test: any): number;
7
- specStarted(result: any): void;
8
- specDone(result: any): void;
9
- jasmineDone(suiteInfo: any, done: any): void;
10
- }
11
- import TestomatClient from '../client.js';
@@ -1,13 +0,0 @@
1
- export class JestReporter {
2
- constructor(globalConfig: any, options: any);
3
- _globalConfig: any;
4
- _options: any;
5
- client: TestomatClient;
6
- onRunStart(): void;
7
- onTestStart(testFile: any): void;
8
- onTestCaseStart(test: any, testCase: any): void;
9
- onTestResult(test: any, testResult: any): void;
10
- onRunComplete(contexts: any, results: any): void;
11
- }
12
- export default JestReporter;
13
- import TestomatClient from '../client.js';
@@ -1,2 +0,0 @@
1
- export default MochaReporter;
2
- declare function MochaReporter(runner: any, opts: any): void;
@@ -1,4 +0,0 @@
1
- declare namespace _default {
2
- function write(results: any, options: any, done: any): Promise<void>;
3
- }
4
- export default _default;
@@ -1,80 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const client_js_1 = __importDefault(require("../client.js"));
7
- const config_js_1 = require("../config.js");
8
- const constants_js_1 = require("../constants.js");
9
- const utils_js_1 = require("../utils/utils.js");
10
- const apiKey = config_js_1.config.TESTOMATIO;
11
- const client = new client_js_1.default({ apiKey });
12
- module.exports = {
13
- write: async (results, options, done) => {
14
- await client.createRun();
15
- const testFiles = results.modules;
16
- for (const fileName in testFiles) {
17
- // in nightwatch: object containing tests from a single file
18
- const testModule = testFiles[fileName];
19
- // passed and failed tests (tests with assertions)
20
- const completedTests = testModule.completed;
21
- // skipped tests (skipped by user or tests without assertions)
22
- const skippedTests = testModule.skipped;
23
- const tags = testModule.tags || [];
24
- // if test file contains multiple suites, the last suite name is used as a name 🤷‍♂️
25
- // no other places which contain suite name (even inside test object)
26
- const suiteTitle = testModule.name;
27
- for (const testTitle in completedTests) {
28
- const test = completedTests[testTitle];
29
- let status;
30
- switch (test.status) {
31
- case 'pass':
32
- status = constants_js_1.STATUS.PASSED;
33
- break;
34
- case 'fail':
35
- status = constants_js_1.STATUS.FAILED;
36
- break;
37
- // probably not required (because skipped tests are in separate array), but just in case
38
- case 'skip':
39
- status = constants_js_1.STATUS.SKIPPED;
40
- console.info('Skipped test is in completed tests array:', test, 'Not expected behavior.');
41
- break;
42
- default:
43
- console.error('Test status processing error:', test.status);
44
- }
45
- const testId = (0, utils_js_1.getTestomatIdFromTestTitle)(testTitle);
46
- client.addTestRun(status, {
47
- error: { name: test.assertions?.[0]?.name, message: test.assertions?.[0]?.message, stack: test.stackTrace },
48
- file: testModule.modulePath?.replace(process.cwd(), ''),
49
- message: test.assertions?.[0]?.message,
50
- rid: `${testModule.uuid || ''}_${testTitle || ''}`,
51
- stack: test.stackTrace,
52
- suite_title: suiteTitle,
53
- tags,
54
- test_id: testId,
55
- time: test.timeMs,
56
- title: testTitle,
57
- });
58
- }
59
- // just array with skipped tests titles, no any other info
60
- for (const testTitle of skippedTests) {
61
- client.addTestRun(constants_js_1.STATUS.SKIPPED, {
62
- suite_title: suiteTitle,
63
- tags,
64
- rid: `${testModule.uuid || ''}_${testTitle || ''}`,
65
- title: testTitle,
66
- });
67
- }
68
- }
69
- /**
70
- * @type {'passed' | 'failed' | 'finished'}
71
- */
72
- let runStatus = 'finished';
73
- if (results.failed)
74
- runStatus = 'failed';
75
- else if (results.passed)
76
- runStatus = 'passed';
77
- await client.updateRunStatus(runStatus);
78
- done();
79
- },
80
- };
@@ -1,14 +0,0 @@
1
- export default PlaywrightReporter;
2
- declare class PlaywrightReporter {
3
- constructor(config?: {});
4
- client: TestomatioClient;
5
- uploads: any[];
6
- onBegin(config: any, suite: any): void;
7
- suite: any;
8
- config: any;
9
- onTestBegin(testInfo: any): void;
10
- onTestEnd(test: any, result: any): void;
11
- onEnd(result: any): Promise<void>;
12
- #private;
13
- }
14
- import TestomatioClient from '../client.js';
@@ -1,35 +0,0 @@
1
- export default VitestReporter;
2
- export type VitestTest = import("../../types/types.js").VitestTest;
3
- export type VitestTestFile = import("../../types/types.js").VitestTestFile;
4
- export type VitestSuite = import("../../types/types.js").VitestSuite;
5
- export type VitestTestLogs = import("../../types/types.js").VitestTestLogs;
6
- export type ErrorWithDiff = import("../../types/vitest.types.js").ErrorWithDiff;
7
- export type STATUS = typeof import("../constants.js").STATUS;
8
- export type TestData = import("../../types/types.js").TestData;
9
- /**
10
- * @typedef {import('../../types/types.js').VitestTest} VitestTest
11
- * @typedef {import('../../types/types.js').VitestTestFile} VitestTestFile
12
- * @typedef {import('../../types/types.js').VitestSuite} VitestSuite
13
- * @typedef {import('../../types/types.js').VitestTestLogs} VitestTestLogs
14
- * @typedef {import('../../types/vitest.types.js').ErrorWithDiff} ErrorWithDiff
15
- * @typedef {typeof import('../constants.js').STATUS} STATUS
16
- * @typedef {import('../../types/types.js').TestData} TestData
17
- */
18
- export class VitestReporter {
19
- constructor(config?: {});
20
- client: TestomatioClient;
21
- /**
22
- * @type {(TestData & {status: string})[]} tests
23
- */
24
- tests: (TestData & {
25
- status: string;
26
- })[];
27
- onInit(): void;
28
- /**
29
- * @param {VitestTestFile[] | undefined} files // array with results;
30
- * @param {unknown[] | undefined} errors // errors does not contain errors from tests; probably its testrunner errors
31
- */
32
- onFinished(files: VitestTestFile[] | undefined, errors: unknown[] | undefined): Promise<void>;
33
- #private;
34
- }
35
- import { Client as TestomatioClient } from '../client.js';
@@ -1,24 +0,0 @@
1
- export default WebdriverReporter;
2
- declare class WebdriverReporter extends WDIOReporter {
3
- constructor(options: any);
4
- client: TestomatClient;
5
- _addTestPromises: any[];
6
- _isSynchronising: boolean;
7
- /**
8
- *
9
- * @param {RunnerStats} runData
10
- */
11
- onRunnerEnd(runData: RunnerStats): Promise<void>;
12
- onRunnerStart(): void;
13
- onTestStart(test: any): void;
14
- onTestEnd(test: any): void;
15
- onSuiteEnd(scerario: any): void;
16
- addTest(test: any): Promise<void>;
17
- /**
18
- * @param {import('../../types/types.js').WebdriverIOScenario} scenario
19
- */
20
- addBddScenario(scenario: import("../../types/types.js").WebdriverIOScenario): Promise<import("../../types/types.js").PipeResult[]>;
21
- }
22
- import { default as WDIOReporter } from '@wdio/reporter';
23
- import TestomatClient from '../client.js';
24
- import { RunnerStats } from '@wdio/reporter';
package/lib/bin/cli.d.ts DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
package/lib/client.d.ts DELETED
@@ -1,76 +0,0 @@
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';
package/lib/config.d.ts DELETED
@@ -1 +0,0 @@
1
- export const config: NodeJS.ProcessEnv;
@@ -1,25 +0,0 @@
1
- export const APP_PREFIX: string;
2
- export const TESTOMAT_TMP_STORAGE_DIR: string;
3
- export const CSV_HEADERS: {
4
- id: string;
5
- title: string;
6
- }[];
7
- export namespace STATUS {
8
- let PASSED: string;
9
- let FAILED: string;
10
- let SKIPPED: string;
11
- let FINISHED: string;
12
- }
13
- export namespace HTML_REPORT {
14
- let FOLDER: string;
15
- let REPORT_DEFAULT_NAME: string;
16
- let TEMPLATE_NAME: string;
17
- }
18
- export const AXIOS_TIMEOUT: number;
19
- export const testomatLogoURL: "https://avatars.githubusercontent.com/u/59105116?s=36&v=4";
20
- export namespace REPORTER_REQUEST_RETRIES {
21
- let retryTimeout: number;
22
- let retriesPerRequest: number;
23
- let maxTotalRetries: number;
24
- let withinTimeSeconds: number;
25
- }
@@ -1,34 +0,0 @@
1
- export const dataStorage: DataStorage;
2
- declare class DataStorage {
3
- static "__#12@#instance": any;
4
- /**
5
- *
6
- * @returns {DataStorage}
7
- */
8
- static getInstance(): DataStorage;
9
- context: any;
10
- setContext(context: any): void;
11
- isFileStorage: boolean;
12
- /**
13
- * Puts any data to storage (file or global variable).
14
- * If file: stores data as text, if global variable – stores as array of data.
15
- * @param {'log' | 'artifact' | 'keyvalue'} dataType
16
- * @param {*} data anything you want to store (string, object, array, etc)
17
- * @param {*} context could be testId or any context (test name, suite name, including their IDs etc)
18
- * suite name + test name is used by default
19
- * @returns
20
- */
21
- putData(dataType: "log" | "artifact" | "keyvalue", data: any, context?: any): void;
22
- /**
23
- * Returns data, stored for specific test/context (or data which was stored without test id specified).
24
- * This method will get data from global variable and/or from from file (previosly saved with put method).
25
- *
26
- * @param {'log' | 'artifact' | 'keyvalue'} dataType
27
- * @param {string} context
28
- * @returns {any []} array of data (any type), null (if no data found for context) or string (if data type is log)
29
- */
30
- getData(dataType: "log" | "artifact" | "keyvalue", context: string): any[];
31
- #private;
32
- }
33
- export function stringToMD5Hash(str: any): string;
34
- export {};
@@ -1,9 +0,0 @@
1
- export default Adapter;
2
- declare class Adapter {
3
- constructor(opts: any);
4
- opts: any;
5
- getFilePath(t: any): any;
6
- formatTest(t: any): any;
7
- formatStack(t: any): any;
8
- formatMessage(t: any): any;
9
- }
@@ -1,5 +0,0 @@
1
- export default CSharpAdapter;
2
- declare class CSharpAdapter extends Adapter {
3
- getFilePath(t: any): string;
4
- }
5
- import Adapter from './adapter.js';
@@ -1,3 +0,0 @@
1
- export default AdapterFactory;
2
- declare function AdapterFactory(lang: any, opts: any): Adapter;
3
- import Adapter from './adapter.js';
@@ -1,5 +0,0 @@
1
- export default JavaAdapter;
2
- declare class JavaAdapter extends Adapter {
3
- getFilePath(t: any): string;
4
- }
5
- import Adapter from './adapter.js';
@@ -1,4 +0,0 @@
1
- export default JavaScriptAdapter;
2
- declare class JavaScriptAdapter extends Adapter {
3
- }
4
- import Adapter from './adapter.js';
@@ -1,5 +0,0 @@
1
- export default PythonAdapter;
2
- declare class PythonAdapter extends Adapter {
3
- getFilePath(t: any): string;
4
- }
5
- import Adapter from './adapter.js';
@@ -1,4 +0,0 @@
1
- export default RubyAdapter;
2
- declare class RubyAdapter extends Adapter {
3
- }
4
- import Adapter from './adapter.js';
package/lib/output.d.ts DELETED
@@ -1,11 +0,0 @@
1
- export default Output;
2
- declare class Output {
3
- constructor(opts?: {});
4
- filterFn: any;
5
- reset(): void;
6
- log: any[];
7
- start(): void;
8
- push(line: any): void;
9
- text(): string;
10
- stop(): void;
11
- }
package/lib/package.json DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "type": "commonjs"
3
- }
@@ -1,25 +0,0 @@
1
- /**
2
- * @class BitbucketPipe
3
- * @typedef {import('../../types/types.js').Pipe} Pipe
4
- * @typedef {import('../../types/types.js').TestData} TestData
5
- */
6
- export class BitbucketPipe {
7
- constructor(params: any, store?: {});
8
- isEnabled: boolean;
9
- ENV: NodeJS.ProcessEnv;
10
- store: {};
11
- tests: any[];
12
- token: any;
13
- hiddenCommentData: string;
14
- client: Gaxios;
15
- cleanLog(log: any): Promise<string>;
16
- prepareRun(): Promise<void>;
17
- createRun(): Promise<void>;
18
- addTest(test: any): void;
19
- finishRun(runParams: any): Promise<void>;
20
- toString(): string;
21
- updateRun(): void;
22
- }
23
- export type Pipe = import("../../types/types.js").Pipe;
24
- export type TestData = import("../../types/types.js").TestData;
25
- import { Gaxios } from 'gaxios';