@testomatio/reporter 2.1.0-beta.5-codeceptjs → 2.1.0

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.
@@ -50,18 +50,17 @@ function CodeceptReporter(config) {
50
50
  };
51
51
  output.debug = function (msg) {
52
52
  originalOutput.debug(msg);
53
- data_storage_js_1.dataStorage.putData('log', repeat(this?.stepShift || 0) + picocolors_1.default.cyan(msg.toString()));
53
+ data_storage_js_1.dataStorage.putData('log', repeat(this.stepShift) + picocolors_1.default.cyan(msg.toString()));
54
54
  };
55
55
  output.say = function (message, color = 'cyan') {
56
56
  originalOutput.say(message, color);
57
- const sayMsg = repeat(this?.stepShift || 0) + ` ${picocolors_1.default.bold(picocolors_1.default[color](message))}`;
57
+ const sayMsg = repeat(this.stepShift) + ` ${picocolors_1.default.bold(picocolors_1.default[color](message))}`;
58
58
  data_storage_js_1.dataStorage.putData('log', sayMsg);
59
59
  };
60
60
  output.log = function (msg) {
61
61
  originalOutput.log(msg);
62
- data_storage_js_1.dataStorage.putData('log', repeat(this?.stepShift || 0) + picocolors_1.default.gray(msg));
62
+ data_storage_js_1.dataStorage.putData('log', repeat(this.stepShift) + picocolors_1.default.gray(msg));
63
63
  };
64
- output.stepShift = 0;
65
64
  recorder.startUnlessRunning();
66
65
  const hookSteps = new Map();
67
66
  let currentHook = null;
package/lib/bin/cli.js CHANGED
File without changes
File without changes
File without changes
File without changes
@@ -113,7 +113,8 @@ class TestomatioPipe {
113
113
  const resp = await this.client.request({
114
114
  method: 'GET',
115
115
  url: '/api/test_grep',
116
- ...q,
116
+ params: q.params,
117
+ responseType: q.responseType
117
118
  });
118
119
  if (Array.isArray(resp.data?.tests) && resp.data?.tests?.length > 0) {
119
120
  (0, utils_js_1.foundedTestLog)(constants_js_1.APP_PREFIX, resp.data.tests);
@@ -9,8 +9,6 @@ export default _default;
9
9
  /**
10
10
  * Stores path to file as artifact and uploads it to the S3 storage
11
11
  * @param {string | {path: string, type: string, name: string}} data - path to file or object with path, type and name
12
- * @param {any} [context=null] - optional context parameter
13
- * @returns {void}
14
12
  */
15
13
  declare function saveArtifact(data: string | {
16
14
  path: string;
@@ -19,21 +17,18 @@ declare function saveArtifact(data: string | {
19
17
  }, context?: any): void;
20
18
  /**
21
19
  * Attach log message(s) to the test report
22
- * @param {...any} args - log messages to attach
23
- * @returns {void}
20
+ * @param string
24
21
  */
25
22
  declare function logMessage(...args: any[]): void;
26
23
  /**
27
24
  * Similar to "log" function but marks message in report as a step
28
- * @param {string} message - step message
29
- * @returns {void}
25
+ * @param {string} message
30
26
  */
31
27
  declare function addStep(message: string): void;
32
28
  /**
33
29
  * Add key-value pair(s) to the test report
34
- * @param {{[key: string]: string} | string} keyValue - object { key: value } (multiple props allowed) or key (string)
35
- * @param {string|null} [value=null] - optional value when keyValue is a string
36
- * @returns {void}
30
+ * @param {{[key: string]: string} | string} keyValue object { key: value } (multiple props allowed) or key (string)
31
+ * @param {string?} value
37
32
  */
38
33
  declare function setKeyValue(keyValue: {
39
34
  [key: string]: string;
@@ -41,7 +36,6 @@ declare function setKeyValue(keyValue: {
41
36
  /**
42
37
  * Add a single label to the test report
43
38
  * @param {string} key - label key (e.g. 'severity', 'feature', or just 'smoke' for labels without values)
44
- * @param {string|null} [value=null] - optional label value (e.g. 'high', 'login')
45
- * @returns {void}
39
+ * @param {string} [value] - optional label value (e.g. 'high', 'login')
46
40
  */
47
- declare function setLabel(key: string, value?: string | null): void;
41
+ declare function setLabel(key: string, value?: string): void;
@@ -4,8 +4,6 @@ const index_js_1 = require("./services/index.js");
4
4
  /**
5
5
  * Stores path to file as artifact and uploads it to the S3 storage
6
6
  * @param {string | {path: string, type: string, name: string}} data - path to file or object with path, type and name
7
- * @param {any} [context=null] - optional context parameter
8
- * @returns {void}
9
7
  */
10
8
  function saveArtifact(data, context = null) {
11
9
  if (process.env.IS_PLAYWRIGHT)
@@ -17,8 +15,7 @@ function saveArtifact(data, context = null) {
17
15
  }
18
16
  /**
19
17
  * Attach log message(s) to the test report
20
- * @param {...any} args - log messages to attach
21
- * @returns {void}
18
+ * @param string
22
19
  */
23
20
  function logMessage(...args) {
24
21
  if (process.env.IS_PLAYWRIGHT)
@@ -27,8 +24,7 @@ function logMessage(...args) {
27
24
  }
28
25
  /**
29
26
  * Similar to "log" function but marks message in report as a step
30
- * @param {string} message - step message
31
- * @returns {void}
27
+ * @param {string} message
32
28
  */
33
29
  function addStep(message) {
34
30
  if (process.env.IS_PLAYWRIGHT)
@@ -37,9 +33,8 @@ function addStep(message) {
37
33
  }
38
34
  /**
39
35
  * Add key-value pair(s) to the test report
40
- * @param {{[key: string]: string} | string} keyValue - object { key: value } (multiple props allowed) or key (string)
41
- * @param {string|null} [value=null] - optional value when keyValue is a string
42
- * @returns {void}
36
+ * @param {{[key: string]: string} | string} keyValue object { key: value } (multiple props allowed) or key (string)
37
+ * @param {string?} value
43
38
  */
44
39
  function setKeyValue(keyValue, value = null) {
45
40
  if (process.env.IS_PLAYWRIGHT)
@@ -52,8 +47,7 @@ function setKeyValue(keyValue, value = null) {
52
47
  /**
53
48
  * Add a single label to the test report
54
49
  * @param {string} key - label key (e.g. 'severity', 'feature', or just 'smoke' for labels without values)
55
- * @param {string|null} [value=null] - optional label value (e.g. 'high', 'login')
56
- * @returns {void}
50
+ * @param {string} [value] - optional label value (e.g. 'high', 'login')
57
51
  */
58
52
  function setLabel(key, value = null) {
59
53
  if (!key || typeof key !== 'string') {
package/lib/reporter.d.ts CHANGED
@@ -1,9 +1,12 @@
1
+ export type artifact = typeof import("./reporter-functions.js");
1
2
  export const artifact: (data: string | {
2
3
  path: string;
3
4
  type: string;
4
5
  name: string;
5
6
  }, context?: any) => void;
7
+ export type log = typeof import("./reporter-functions.js");
6
8
  export const log: (...args: any[]) => void;
9
+ export type logger = typeof import("./services/index.js");
7
10
  export const logger: {
8
11
  "__#13@#originalUserLogger": {
9
12
  assert(condition?: boolean, ...data: any[]): void;
@@ -72,11 +75,14 @@ export const logger: {
72
75
  }): void;
73
76
  prettyObjects: boolean;
74
77
  };
78
+ export type meta = typeof import("./reporter-functions.js");
75
79
  export const meta: (keyValue: {
76
80
  [key: string]: string;
77
81
  } | string, value?: string | null) => void;
82
+ export type step = typeof import("./reporter-functions.js");
78
83
  export const step: (message: string) => void;
79
- export const label: (key: string, value?: string | null) => void;
84
+ export type label = typeof import("./reporter-functions.js");
85
+ export const label: (key: string, value?: string) => void;
80
86
  declare namespace _default {
81
87
  let testomatioLogger: {
82
88
  "__#13@#originalUserLogger": {
@@ -224,12 +230,6 @@ declare namespace _default {
224
230
  [key: string]: string;
225
231
  } | string, value?: string | null) => void;
226
232
  let step: (message: string) => void;
227
- let label: (key: string, value?: string | null) => void;
233
+ let label: (key: string, value?: string) => void;
228
234
  }
229
235
  export default _default;
230
- export type ArtifactFunction = typeof import("./reporter-functions.js").default.artifact;
231
- export type LogFunction = typeof import("./reporter-functions.js").default.log;
232
- export type LoggerService = typeof import("./services/index.js").services.logger;
233
- export type MetaFunction = typeof import("./reporter-functions.js").default.keyValue;
234
- export type StepFunction = typeof import("./reporter-functions.js").default.step;
235
- export type LabelFunction = typeof import("./reporter-functions.js").default.label;
package/lib/reporter.js CHANGED
@@ -15,12 +15,12 @@ exports.meta = reporter_functions_js_1.default.keyValue;
15
15
  exports.step = reporter_functions_js_1.default.step;
16
16
  exports.label = reporter_functions_js_1.default.label;
17
17
  /**
18
- * @typedef {typeof import('./reporter-functions.js').default.artifact} ArtifactFunction
19
- * @typedef {typeof import('./reporter-functions.js').default.log} LogFunction
20
- * @typedef {typeof import('./services/index.js').services.logger} LoggerService
21
- * @typedef {typeof import('./reporter-functions.js').default.keyValue} MetaFunction
22
- * @typedef {typeof import('./reporter-functions.js').default.step} StepFunction
23
- * @typedef {typeof import('./reporter-functions.js').default.label} LabelFunction
18
+ * @typedef {import('./reporter-functions.js')} artifact
19
+ * @typedef {import('./reporter-functions.js')} log
20
+ * @typedef {import('./services/index.js')} logger
21
+ * @typedef {import('./reporter-functions.js')} meta
22
+ * @typedef {import('./reporter-functions.js')} step
23
+ * @typedef {import('./reporter-functions.js')} label
24
24
  */
25
25
  module.exports = {
26
26
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "2.1.0-beta.5-codeceptjs",
3
+ "version": "2.1.0",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "engines": {
6
6
  "node": ">=18"
@@ -56,20 +56,19 @@ function CodeceptReporter(config) {
56
56
 
57
57
  output.debug = function(msg) {
58
58
  originalOutput.debug(msg);
59
- dataStorage.putData('log', repeat(this?.stepShift || 0) + pc.cyan(msg.toString()));
59
+ dataStorage.putData('log', repeat(this.stepShift) + pc.cyan(msg.toString()));
60
60
  };
61
61
 
62
62
  output.say = function(message, color = 'cyan') {
63
63
  originalOutput.say(message, color);
64
- const sayMsg = repeat(this?.stepShift || 0) + ` ${pc.bold(pc[color](message))}`;
64
+ const sayMsg = repeat(this.stepShift) + ` ${pc.bold(pc[color](message))}`;
65
65
  dataStorage.putData('log', sayMsg);
66
66
  };
67
67
 
68
68
  output.log = function(msg) {
69
69
  originalOutput.log(msg);
70
- dataStorage.putData('log', repeat(this?.stepShift || 0) + pc.gray(msg));
70
+ dataStorage.putData('log', repeat(this.stepShift) + pc.gray(msg));
71
71
  };
72
- output.stepShift = 0;
73
72
 
74
73
  recorder.startUnlessRunning();
75
74
 
@@ -119,7 +119,8 @@ class TestomatioPipe {
119
119
  const resp = await this.client.request({
120
120
  method: 'GET',
121
121
  url: '/api/test_grep',
122
- ...q,
122
+ params: q.params,
123
+ responseType: q.responseType
123
124
  });
124
125
 
125
126
  if (Array.isArray(resp.data?.tests) && resp.data?.tests?.length > 0) {
@@ -3,8 +3,6 @@ import { services } from './services/index.js';
3
3
  /**
4
4
  * Stores path to file as artifact and uploads it to the S3 storage
5
5
  * @param {string | {path: string, type: string, name: string}} data - path to file or object with path, type and name
6
- * @param {any} [context=null] - optional context parameter
7
- * @returns {void}
8
6
  */
9
7
  function saveArtifact(data, context = null) {
10
8
  if (process.env.IS_PLAYWRIGHT)
@@ -16,8 +14,7 @@ function saveArtifact(data, context = null) {
16
14
 
17
15
  /**
18
16
  * Attach log message(s) to the test report
19
- * @param {...any} args - log messages to attach
20
- * @returns {void}
17
+ * @param string
21
18
  */
22
19
  function logMessage(...args) {
23
20
  if (process.env.IS_PLAYWRIGHT) throw new Error('This function is not available in Playwright framework');
@@ -26,8 +23,7 @@ function logMessage(...args) {
26
23
 
27
24
  /**
28
25
  * Similar to "log" function but marks message in report as a step
29
- * @param {string} message - step message
30
- * @returns {void}
26
+ * @param {string} message
31
27
  */
32
28
  function addStep(message) {
33
29
  if (process.env.IS_PLAYWRIGHT)
@@ -38,9 +34,8 @@ function addStep(message) {
38
34
 
39
35
  /**
40
36
  * Add key-value pair(s) to the test report
41
- * @param {{[key: string]: string} | string} keyValue - object { key: value } (multiple props allowed) or key (string)
42
- * @param {string|null} [value=null] - optional value when keyValue is a string
43
- * @returns {void}
37
+ * @param {{[key: string]: string} | string} keyValue object { key: value } (multiple props allowed) or key (string)
38
+ * @param {string?} value
44
39
  */
45
40
  function setKeyValue(keyValue, value = null) {
46
41
  if (process.env.IS_PLAYWRIGHT)
@@ -55,8 +50,7 @@ function setKeyValue(keyValue, value = null) {
55
50
  /**
56
51
  * Add a single label to the test report
57
52
  * @param {string} key - label key (e.g. 'severity', 'feature', or just 'smoke' for labels without values)
58
- * @param {string|null} [value=null] - optional label value (e.g. 'high', 'login')
59
- * @returns {void}
53
+ * @param {string} [value] - optional label value (e.g. 'high', 'login')
60
54
  */
61
55
  function setLabel(key, value = null) {
62
56
  if (!key || typeof key !== 'string') {
package/src/reporter.js CHANGED
@@ -11,12 +11,12 @@ export const step = reporterFunctions.step;
11
11
  export const label = reporterFunctions.label;
12
12
 
13
13
  /**
14
- * @typedef {typeof import('./reporter-functions.js').default.artifact} ArtifactFunction
15
- * @typedef {typeof import('./reporter-functions.js').default.log} LogFunction
16
- * @typedef {typeof import('./services/index.js').services.logger} LoggerService
17
- * @typedef {typeof import('./reporter-functions.js').default.keyValue} MetaFunction
18
- * @typedef {typeof import('./reporter-functions.js').default.step} StepFunction
19
- * @typedef {typeof import('./reporter-functions.js').default.label} LabelFunction
14
+ * @typedef {import('./reporter-functions.js')} artifact
15
+ * @typedef {import('./reporter-functions.js')} log
16
+ * @typedef {import('./services/index.js')} logger
17
+ * @typedef {import('./reporter-functions.js')} meta
18
+ * @typedef {import('./reporter-functions.js')} step
19
+ * @typedef {import('./reporter-functions.js')} label
20
20
  */
21
21
  export default {
22
22
  /**