@testomatio/reporter 2.6.1 → 2.6.3

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 CHANGED
@@ -10,7 +10,7 @@ Testomat.io Reporter (this npm package) supports:
10
10
 
11
11
  - 🏄 Integarion with all popular [JavaScript/TypeScript frameworks](./docs/frameworks.md)
12
12
  - 🗄️ Screenshots, videos, traces [uploaded into S3 bucket](./docs/artifacts.md)
13
- - 🔎 [Stack traces](./docs/stacktrace.md) and error messages
13
+ - 🔎 [Stack traces](https://github.com/testomatio/reporter/blob/2.x/docs/stacktrace.md) and error messages
14
14
  - 🐙 [GitHub](./docs/pipes/github.md), [GitLab](./docs/pipes/gitlab.md) & [Bitbucket](./docs/pipes/bitbucket.md) integration
15
15
  - 🚅 Realtime reports
16
16
  - 🗃️ Other test frameworks supported via [JUnit XML](./docs/junit.md)
@@ -20,7 +20,7 @@ Testomat.io Reporter (this npm package) supports:
20
20
  - 💯 Free & open-source.
21
21
  - 📊 Public and private Run reports on cloud via [Testomat.io App](https://testomat.io) 👇
22
22
 
23
- <img width="1920" height="1085" alt="image" src="https://github.com/user-attachments/assets/cf823e8b-1305-4ed2-a7c5-712efec12ceb" />
23
+ ![testomatio-reporter](./docs/images/testomatio-reporter.png)
24
24
 
25
25
  ## How It Works
26
26
 
@@ -65,7 +65,7 @@ yarn add @testomatio/reporter --dev
65
65
  | | | |
66
66
  |-------------------------------------------------|-----------------------------------------------|-----------------------------------------------------------|
67
67
  | [Playwright](./docs/frameworks.md#playwright) | [CodeceptJS](./docs/frameworks.md#codeceptjs) | [Cypress](./docs/frameworks.md#cypress) |
68
- | [Jest](./docs/frameworks.md#jest) | [Mocha](./docs/frameworks.md#mocha) | [WebDriverIO](./docs/frameworks.md#webdriverIO) |
68
+ | [Jest](./docs/frameworks.md#jest) | [Mocha](./docs/frameworks.md#mocha) | [WebDriverIO](./docs/frameworks.md#webdriverio) |
69
69
  | [TestCafe](./docs/frameworks.md#testcafe) | [Detox](./docs/frameworks.md#detox) | [Codeception](https://github.com/testomatio/php-reporter) |
70
70
  | [Newman (Postman)](./docs/frameworks.md#newman) | [JUnit](./docs/junit.md#junit) | [NUnit](./docs/junit.md#nunit) |
71
71
  | [PyTest](./docs/junit.md#pytest) | [PHPUnit](./docs/junit.md#phpunit) | [Protractor](./docs/frameworks.md#protractor) |
@@ -77,7 +77,7 @@ or **any [other via JUnit](./docs/junit.md)** report....
77
77
  - [Create report on Testomat.io](./docs/pipes/testomatio.md).
78
78
  - [Create brief summary report for GitHub Pull Request](./docs/pipes/github.md) 👇
79
79
  - [Create brief summary report for GitLab Merge Request](./docs/pipes/gitlab.md).
80
- - [Configure other pipes](./docs/pipes/md) for other ways to process test results output.
80
+ - [Configure other pipes](./docs/pipes.md) for other ways to process test results output.
81
81
 
82
82
  ![GitHub report](./docs/pipes/images/github.png)
83
83
 
@@ -1,6 +1,6 @@
1
1
  export const dataStorage: DataStorage;
2
2
  declare class DataStorage {
3
- static "__#13@#instance": any;
3
+ static "__#private@#instance": any;
4
4
  /**
5
5
  *
6
6
  * @returns {DataStorage}
package/lib/pipe/debug.js CHANGED
@@ -18,7 +18,7 @@ class DebugPipe {
18
18
  this.isEnabled = !!process.env.TESTOMATIO_DEBUG || !!process.env.DEBUG;
19
19
  if (this.isEnabled) {
20
20
  this.batch = {
21
- isEnabled: this.params.isBatchEnabled ?? !process.env.TESTOMATIO_DISABLE_BATCH_UPLOAD ?? true,
21
+ isEnabled: this.params.isBatchEnabled ?? !process.env.TESTOMATIO_DISABLE_BATCH_UPLOAD,
22
22
  intervalFunction: null,
23
23
  intervalTime: 5000,
24
24
  tests: [],
@@ -23,7 +23,7 @@ if (process.env.TESTOMATIO_RUN)
23
23
  class TestomatioPipe {
24
24
  constructor(params, store) {
25
25
  this.batch = {
26
- isEnabled: params?.isBatchEnabled ?? !process.env.TESTOMATIO_DISABLE_BATCH_UPLOAD ?? true,
26
+ isEnabled: params?.isBatchEnabled ?? !process.env.TESTOMATIO_DISABLE_BATCH_UPLOAD,
27
27
  intervalFunction: null, // will be created in createRun by setInterval function
28
28
  intervalTime: 5000, // how often tests are sent
29
29
  tests: [], // array of tests in batch
@@ -80,16 +80,10 @@ class TestomatioPipe {
80
80
  shouldRetry: error => {
81
81
  if (!error.response)
82
82
  return false;
83
- switch (error.response?.status) {
84
- case 400: // Bad request (probably wrong API key)
85
- case 404: // Test not matched
86
- case 429: // Rate limit exceeded
87
- case 500: // Internal server error
88
- return false;
89
- default:
90
- break;
91
- }
92
- return error.response?.status >= 401; // Retry on 401+ and 5xx
83
+ // no need to retry on 4xx errors, because they caused by user mistake, thus retrying will not help
84
+ // 500 could also be related to both user or server mistake, but decided not to retry for now
85
+ // this code code be changed to retry 500 too if needed
86
+ return error.response?.status >= 501; // Retry only on server errors
93
87
  },
94
88
  },
95
89
  });
package/lib/reporter.d.ts CHANGED
@@ -12,59 +12,43 @@ export const artifact: (data: string | {
12
12
  }, context?: any) => void;
13
13
  export const log: (...args: any[]) => void;
14
14
  export const logger: {
15
- "__#14@#originalUserLogger": {
15
+ "__#private@#originalUserLogger": {
16
16
  assert(condition?: boolean, ...data: any[]): void;
17
- assert(value: any, message?: string, ...optionalParams: any[]): void;
18
17
  clear(): void;
19
- clear(): void;
20
- count(label?: string): void;
21
18
  count(label?: string): void;
22
19
  countReset(label?: string): void;
23
- countReset(label?: string): void;
24
20
  debug(...data: any[]): void;
25
- debug(message?: any, ...optionalParams: any[]): void;
26
21
  dir(item?: any, options?: any): void;
27
- dir(obj: any, options?: import("util").InspectOptions): void;
28
- dirxml(...data: any[]): void;
29
22
  dirxml(...data: any[]): void;
30
23
  error(...data: any[]): void;
31
- error(message?: any, ...optionalParams: any[]): void;
32
24
  group(...data: any[]): void;
33
- group(...label: any[]): void;
34
25
  groupCollapsed(...data: any[]): void;
35
- groupCollapsed(...label: any[]): void;
36
- groupEnd(): void;
37
26
  groupEnd(): void;
38
27
  info(...data: any[]): void;
39
- info(message?: any, ...optionalParams: any[]): void;
40
28
  log(...data: any[]): void;
41
- log(message?: any, ...optionalParams: any[]): void;
42
29
  table(tabularData?: any, properties?: string[]): void;
43
- table(tabularData: any, properties?: readonly string[]): void;
44
- time(label?: string): void;
45
30
  time(label?: string): void;
46
31
  timeEnd(label?: string): void;
47
- timeEnd(label?: string): void;
48
32
  timeLog(label?: string, ...data: any[]): void;
49
- timeLog(label?: string, ...data: any[]): void;
50
- timeStamp(label?: string): void;
51
33
  timeStamp(label?: string): void;
52
34
  trace(...data: any[]): void;
53
- trace(message?: any, ...optionalParams: any[]): void;
54
35
  warn(...data: any[]): void;
55
- warn(message?: any, ...optionalParams: any[]): void;
56
- Console: console.ConsoleConstructor;
36
+ Console: {
37
+ prototype: import("node:console").Console;
38
+ new (stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): import("node:console").Console;
39
+ new (options: import("node:console").ConsoleOptions): import("node:console").Console;
40
+ };
57
41
  profile(label?: string): void;
58
42
  profileEnd(label?: string): void;
59
43
  };
60
- "__#14@#userLoggerWithOverridenMethods": any;
44
+ "__#private@#userLoggerWithOverridenMethods": any;
61
45
  logLevel: string;
62
46
  step(strings: any, ...values: any[]): void;
63
47
  getLogs(context: string): string[];
64
- "__#14@#stringifyLogs"(...args: any[]): string;
65
- "__#14@#formatMessage"(strings: any, ...args: any[]): string;
48
+ "__#private@#stringifyLogs"(...args: any[]): string;
49
+ "__#private@#formatMessage"(strings: any, ...args: any[]): string;
66
50
  _templateLiteralLog(strings: any, ...args: any[]): void;
67
- "__#14@#logWrapper"(argsArray: any, level: any): void;
51
+ "__#private@#logWrapper"(argsArray: any, level: any): void;
68
52
  assert(...args: any[]): void;
69
53
  debug(...args: any[]): void;
70
54
  error(...args: any[]): void;
@@ -93,59 +77,43 @@ export const linkTest: (...testIds: (string | string[])[]) => void;
93
77
  export const linkJira: (...jiraIds: (string | string[])[]) => void;
94
78
  declare namespace _default {
95
79
  export let testomatioLogger: {
96
- "__#14@#originalUserLogger": {
80
+ "__#private@#originalUserLogger": {
97
81
  assert(condition?: boolean, ...data: any[]): void;
98
- assert(value: any, message?: string, ...optionalParams: any[]): void;
99
- clear(): void;
100
82
  clear(): void;
101
83
  count(label?: string): void;
102
- count(label?: string): void;
103
- countReset(label?: string): void;
104
84
  countReset(label?: string): void;
105
85
  debug(...data: any[]): void;
106
- debug(message?: any, ...optionalParams: any[]): void;
107
86
  dir(item?: any, options?: any): void;
108
- dir(obj: any, options?: import("util").InspectOptions): void;
109
- dirxml(...data: any[]): void;
110
87
  dirxml(...data: any[]): void;
111
88
  error(...data: any[]): void;
112
- error(message?: any, ...optionalParams: any[]): void;
113
89
  group(...data: any[]): void;
114
- group(...label: any[]): void;
115
90
  groupCollapsed(...data: any[]): void;
116
- groupCollapsed(...label: any[]): void;
117
- groupEnd(): void;
118
91
  groupEnd(): void;
119
92
  info(...data: any[]): void;
120
- info(message?: any, ...optionalParams: any[]): void;
121
93
  log(...data: any[]): void;
122
- log(message?: any, ...optionalParams: any[]): void;
123
94
  table(tabularData?: any, properties?: string[]): void;
124
- table(tabularData: any, properties?: readonly string[]): void;
125
- time(label?: string): void;
126
95
  time(label?: string): void;
127
96
  timeEnd(label?: string): void;
128
- timeEnd(label?: string): void;
129
- timeLog(label?: string, ...data: any[]): void;
130
97
  timeLog(label?: string, ...data: any[]): void;
131
98
  timeStamp(label?: string): void;
132
- timeStamp(label?: string): void;
133
99
  trace(...data: any[]): void;
134
- trace(message?: any, ...optionalParams: any[]): void;
135
100
  warn(...data: any[]): void;
136
- warn(message?: any, ...optionalParams: any[]): void;
137
- Console: console.ConsoleConstructor;
101
+ Console: {
102
+ prototype: import("node:console").Console;
103
+ new (stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): import("node:console").Console;
104
+ new (options: import("node:console").ConsoleOptions): import("node:console").Console;
105
+ };
138
106
  profile(label?: string): void;
139
107
  profileEnd(label?: string): void;
140
108
  };
141
- "__#14@#userLoggerWithOverridenMethods": any;
109
+ "__#private@#userLoggerWithOverridenMethods": any;
142
110
  logLevel: string;
143
111
  step(strings: any, ...values: any[]): void;
144
112
  getLogs(context: string): string[];
145
- "__#14@#stringifyLogs"(...args: any[]): string;
146
- "__#14@#formatMessage"(strings: any, ...args: any[]): string;
113
+ "__#private@#stringifyLogs"(...args: any[]): string;
114
+ "__#private@#formatMessage"(strings: any, ...args: any[]): string;
147
115
  _templateLiteralLog(strings: any, ...args: any[]): void;
148
- "__#14@#logWrapper"(argsArray: any, level: any): void;
116
+ "__#private@#logWrapper"(argsArray: any, level: any): void;
149
117
  assert(...args: any[]): void;
150
118
  debug(...args: any[]): void;
151
119
  error(...args: any[]): void;
@@ -168,59 +136,43 @@ declare namespace _default {
168
136
  }, context?: any) => void;
169
137
  export let log: (...args: any[]) => void;
170
138
  export let logger: {
171
- "__#14@#originalUserLogger": {
139
+ "__#private@#originalUserLogger": {
172
140
  assert(condition?: boolean, ...data: any[]): void;
173
- assert(value: any, message?: string, ...optionalParams: any[]): void;
174
- clear(): void;
175
141
  clear(): void;
176
142
  count(label?: string): void;
177
- count(label?: string): void;
178
- countReset(label?: string): void;
179
143
  countReset(label?: string): void;
180
144
  debug(...data: any[]): void;
181
- debug(message?: any, ...optionalParams: any[]): void;
182
145
  dir(item?: any, options?: any): void;
183
- dir(obj: any, options?: import("util").InspectOptions): void;
184
- dirxml(...data: any[]): void;
185
146
  dirxml(...data: any[]): void;
186
147
  error(...data: any[]): void;
187
- error(message?: any, ...optionalParams: any[]): void;
188
148
  group(...data: any[]): void;
189
- group(...label: any[]): void;
190
149
  groupCollapsed(...data: any[]): void;
191
- groupCollapsed(...label: any[]): void;
192
- groupEnd(): void;
193
150
  groupEnd(): void;
194
151
  info(...data: any[]): void;
195
- info(message?: any, ...optionalParams: any[]): void;
196
152
  log(...data: any[]): void;
197
- log(message?: any, ...optionalParams: any[]): void;
198
153
  table(tabularData?: any, properties?: string[]): void;
199
- table(tabularData: any, properties?: readonly string[]): void;
200
- time(label?: string): void;
201
154
  time(label?: string): void;
202
155
  timeEnd(label?: string): void;
203
- timeEnd(label?: string): void;
204
- timeLog(label?: string, ...data: any[]): void;
205
156
  timeLog(label?: string, ...data: any[]): void;
206
157
  timeStamp(label?: string): void;
207
- timeStamp(label?: string): void;
208
158
  trace(...data: any[]): void;
209
- trace(message?: any, ...optionalParams: any[]): void;
210
159
  warn(...data: any[]): void;
211
- warn(message?: any, ...optionalParams: any[]): void;
212
- Console: console.ConsoleConstructor;
160
+ Console: {
161
+ prototype: import("node:console").Console;
162
+ new (stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): import("node:console").Console;
163
+ new (options: import("node:console").ConsoleOptions): import("node:console").Console;
164
+ };
213
165
  profile(label?: string): void;
214
166
  profileEnd(label?: string): void;
215
167
  };
216
- "__#14@#userLoggerWithOverridenMethods": any;
168
+ "__#private@#userLoggerWithOverridenMethods": any;
217
169
  logLevel: string;
218
170
  step(strings: any, ...values: any[]): void;
219
171
  getLogs(context: string): string[];
220
- "__#14@#stringifyLogs"(...args: any[]): string;
221
- "__#14@#formatMessage"(strings: any, ...args: any[]): string;
172
+ "__#private@#stringifyLogs"(...args: any[]): string;
173
+ "__#private@#formatMessage"(strings: any, ...args: any[]): string;
222
174
  _templateLiteralLog(strings: any, ...args: any[]): void;
223
- "__#14@#logWrapper"(argsArray: any, level: any): void;
175
+ "__#private@#logWrapper"(argsArray: any, level: any): void;
224
176
  assert(...args: any[]): void;
225
177
  debug(...args: any[]): void;
226
178
  error(...args: any[]): void;
@@ -3,7 +3,7 @@ export const artifactStorage: ArtifactStorage;
3
3
  * Artifact storage is supposed to store file paths
4
4
  */
5
5
  declare class ArtifactStorage {
6
- static "__#15@#instance": any;
6
+ static "__#private@#instance": any;
7
7
  /**
8
8
  * Singleton
9
9
  * @returns {ArtifactStorage}
@@ -1,6 +1,6 @@
1
1
  export const keyValueStorage: KeyValueStorage;
2
2
  declare class KeyValueStorage {
3
- static "__#16@#instance": any;
3
+ static "__#private@#instance": any;
4
4
  /**
5
5
  *
6
6
  * @returns {KeyValueStorage}
@@ -1,6 +1,6 @@
1
1
  export const linkStorage: LinkStorage;
2
2
  declare class LinkStorage {
3
- static "__#17@#instance": any;
3
+ static "__#private@#instance": any;
4
4
  /**
5
5
  *
6
6
  * @returns {LinkStorage}
@@ -5,7 +5,7 @@ export const logger: Logger;
5
5
  * Supports different syntaxes to satisfy any user preferences.
6
6
  */
7
7
  declare class Logger {
8
- static "__#14@#instance": any;
8
+ static "__#private@#instance": any;
9
9
  /**
10
10
  *
11
11
  * @returns {Logger}
@@ -25,4 +25,5 @@ export function formatError(error: Error & {
25
25
  actual?: any;
26
26
  expected?: any;
27
27
  }, message?: string): string;
28
- export function stripColors(str: string): string;
28
+ export const stripColors: typeof stripVTControlCharacters;
29
+ import { stripVTControlCharacters } from 'util';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "2.6.1",
3
+ "version": "2.6.3",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "engines": {
6
6
  "node": ">=18"
@@ -44,6 +44,9 @@
44
44
  "strip-ansi": "7.1.0",
45
45
  "uuid": "^9.0.0"
46
46
  },
47
+ "overrides": {
48
+ "fast-xml-parser": "^5.3.4"
49
+ },
47
50
  "files": [
48
51
  "bin",
49
52
  "lib",
package/src/pipe/debug.js CHANGED
@@ -15,7 +15,7 @@ export class DebugPipe {
15
15
  this.isEnabled = !!process.env.TESTOMATIO_DEBUG || !!process.env.DEBUG;
16
16
  if (this.isEnabled) {
17
17
  this.batch = {
18
- isEnabled: this.params.isBatchEnabled ?? !process.env.TESTOMATIO_DISABLE_BATCH_UPLOAD ?? true,
18
+ isEnabled: this.params.isBatchEnabled ?? !process.env.TESTOMATIO_DISABLE_BATCH_UPLOAD,
19
19
  intervalFunction: null,
20
20
  intervalTime: 5000,
21
21
  tests: [],
@@ -26,7 +26,7 @@ if (process.env.TESTOMATIO_RUN) process.env.runId = process.env.TESTOMATIO_RUN;
26
26
  class TestomatioPipe {
27
27
  constructor(params, store) {
28
28
  this.batch = {
29
- isEnabled: params?.isBatchEnabled ?? !process.env.TESTOMATIO_DISABLE_BATCH_UPLOAD ?? true,
29
+ isEnabled: params?.isBatchEnabled ?? !process.env.TESTOMATIO_DISABLE_BATCH_UPLOAD,
30
30
  intervalFunction: null, // will be created in createRun by setInterval function
31
31
  intervalTime: 5000, // how often tests are sent
32
32
  tests: [], // array of tests in batch
@@ -87,16 +87,10 @@ class TestomatioPipe {
87
87
  httpMethodsToRetry: ['GET', 'PUT', 'HEAD', 'OPTIONS', 'DELETE', 'POST'],
88
88
  shouldRetry: error => {
89
89
  if (!error.response) return false;
90
- switch (error.response?.status) {
91
- case 400: // Bad request (probably wrong API key)
92
- case 404: // Test not matched
93
- case 429: // Rate limit exceeded
94
- case 500: // Internal server error
95
- return false;
96
- default:
97
- break;
98
- }
99
- return error.response?.status >= 401; // Retry on 401+ and 5xx
90
+ // no need to retry on 4xx errors, because they caused by user mistake, thus retrying will not help
91
+ // 500 could also be related to both user or server mistake, but decided not to retry for now
92
+ // this code code be changed to retry 500 too if needed
93
+ return error.response?.status >= 501; // Retry only on server errors
100
94
  },
101
95
  },
102
96
  });