newman-reporter-qase 2.0.3 → 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,20 @@
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
+
7
+ # qase-newman@2.0.4
8
+
9
+ ## What's new
10
+
11
+ Resolved error when uploading results due to bad request:
12
+
13
+ ```log
14
+ Error: Error on uploading results: Bad request. Body:
15
+ {"message":"The execution.start time must be at least 1732623290. (and 1 more error)","errors":{"execution.start_time":["The execution.start time must be at least 1732623290."],"execution.end_time":["The execution.end time must be at least 1732623290."]}}
16
+ ```
17
+
1
18
  # qase-newman@2.0.3
2
19
 
3
20
  ## What's new
@@ -27,7 +44,7 @@ For more information about the new features and a guide for migration from v1, r
27
44
 
28
45
  ## What's new
29
46
 
30
- Add support for suites in test results.
47
+ Add support for suites in test results.
31
48
 
32
49
  # qase-newman@2.0.0-beta.1
33
50
 
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),
@@ -135,8 +153,8 @@ class NewmanQaseReporter {
135
153
  author: null,
136
154
  execution: {
137
155
  status: qase_javascript_commons_1.TestStatusEnum.passed,
138
- start_time: 0,
139
- end_time: 0,
156
+ start_time: null,
157
+ end_time: null,
140
158
  duration: 0,
141
159
  stacktrace: null,
142
160
  thread: null,
@@ -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.3",
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",