newman-reporter-qase 2.0.4 → 2.0.5

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/changelog.md CHANGED
@@ -1,3 +1,9 @@
1
+ # qase-newman@2.0.5
2
+
3
+ ## What's new
4
+
5
+ Enhanced handling of start and end times for tests and steps, ensuring greater accuracy in reporting.
6
+
1
7
  # qase-newman@2.0.4
2
8
 
3
9
  ## What's new
package/dist/reporter.js CHANGED
@@ -11,6 +11,14 @@ const qase_javascript_commons_1 = require("qase-javascript-commons");
11
11
  * @class NewmanQaseReporter
12
12
  */
13
13
  class NewmanQaseReporter {
14
+ /**
15
+ * @type {RegExp}
16
+ */
17
+ static qaseIdRegExp = /\/\/\s*?[qQ]ase:\s?((?:[\d]+[\s,]{0,})+)/;
18
+ /**
19
+ * @type {RegExp}
20
+ */
21
+ static qaseParamRegExp = /qase\.parameters:\s*([\w.]+(?:\s*,\s*[\w.]+)*)/i;
14
22
  /**
15
23
  * @param {EventList} eventList
16
24
  * @returns {number[]}
@@ -70,6 +78,31 @@ class NewmanQaseReporter {
70
78
  }
71
79
  return titles;
72
80
  }
81
+ /**
82
+ * @type {ReporterInterface}
83
+ * @private
84
+ */
85
+ reporter;
86
+ /**
87
+ * @type {Map<string, TestResultType>}
88
+ * @private
89
+ */
90
+ pendingResultMap = new Map();
91
+ /**
92
+ * @type {Map<string, number>}
93
+ * @private
94
+ */
95
+ timerMap = new Map();
96
+ /**
97
+ * @type {Record<string, string>[]}
98
+ * @private
99
+ */
100
+ parameters = [];
101
+ /**
102
+ * @type {boolean}
103
+ * @private
104
+ */
105
+ autoCollectParams;
73
106
  /**
74
107
  * @param {EventEmitter} emitter
75
108
  * @param {NewmanQaseOptionsType} options
@@ -77,21 +110,6 @@ class NewmanQaseReporter {
77
110
  * @param {ConfigLoaderInterface} configLoader
78
111
  */
79
112
  constructor(emitter, options, collectionOptions, configLoader = new qase_javascript_commons_1.ConfigLoader(configSchema_1.configSchema)) {
80
- /**
81
- * @type {Map<string, TestResultType>}
82
- * @private
83
- */
84
- this.pendingResultMap = new Map();
85
- /**
86
- * @type {Map<string, number>}
87
- * @private
88
- */
89
- this.timerMap = new Map();
90
- /**
91
- * @type {Record<string, string>[]}
92
- * @private
93
- */
94
- this.parameters = [];
95
113
  const config = configLoader.load();
96
114
  this.reporter = qase_javascript_commons_1.QaseReporter.getInstance({
97
115
  ...(0, qase_javascript_commons_1.composeOptions)(options, config),
@@ -173,6 +191,8 @@ class NewmanQaseReporter {
173
191
  if (timer) {
174
192
  const now = Date.now();
175
193
  pendingResult.execution.duration = now - timer;
194
+ pendingResult.execution.start_time = timer / 1000;
195
+ pendingResult.execution.end_time = now / 1000;
176
196
  }
177
197
  pendingResult.params = this.prepareParameters(item, exec.cursor.iteration);
178
198
  void this.reporter.addTestResult(pendingResult);
@@ -289,11 +309,3 @@ class NewmanQaseReporter {
289
309
  }
290
310
  }
291
311
  exports.NewmanQaseReporter = NewmanQaseReporter;
292
- /**
293
- * @type {RegExp}
294
- */
295
- NewmanQaseReporter.qaseIdRegExp = /\/\/\s*?[qQ]ase:\s?((?:[\d]+[\s,]{0,})+)/;
296
- /**
297
- * @type {RegExp}
298
- */
299
- NewmanQaseReporter.qaseParamRegExp = /qase\.parameters:\s*([\w.]+(?:\s*,\s*[\w.]+)*)/i;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "newman-reporter-qase",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "Qase TMS Newman Reporter",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",