@msalaam/xray-qe-toolkit 1.3.1 → 1.3.2

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.
@@ -23,9 +23,12 @@
23
23
  * @returns {object} Xray JSON format
24
24
  */
25
25
  export function convertPlaywrightToXray(playwrightJson, options = {}) {
26
- const startTime = new Date(playwrightJson.config?.metadata?.actualWorkers ?
27
- Date.now() - getTotalDuration(playwrightJson) : Date.now()).toISOString();
28
- const finishTime = new Date().toISOString();
26
+ // Use current time as fallback for timestamps
27
+ const now = Date.now();
28
+ const totalDuration = getTotalDuration(playwrightJson);
29
+
30
+ const startTime = new Date(now - totalDuration).toISOString();
31
+ const finishTime = new Date(now).toISOString();
29
32
 
30
33
  const xrayJson = {
31
34
  info: {
@@ -185,10 +188,22 @@ function convertTest(test, spec, suite, options) {
185
188
 
186
189
  // Add start/finish times if available
187
190
  if (result.startTime) {
188
- xrayTest.start = new Date(result.startTime).toISOString();
189
- }
190
- if (result.startTime && result.duration) {
191
- xrayTest.finish = new Date(result.startTime + result.duration).toISOString();
191
+ try {
192
+ const startDate = new Date(result.startTime);
193
+ if (!isNaN(startDate.getTime())) {
194
+ xrayTest.start = startDate.toISOString();
195
+
196
+ // Calculate finish time if we have duration
197
+ if (result.duration) {
198
+ const finishDate = new Date(startDate.getTime() + result.duration);
199
+ if (!isNaN(finishDate.getTime())) {
200
+ xrayTest.finish = finishDate.toISOString();
201
+ }
202
+ }
203
+ }
204
+ } catch (error) {
205
+ // Skip invalid timestamps silently
206
+ }
192
207
  }
193
208
 
194
209
  // Add error details if test failed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@msalaam/xray-qe-toolkit",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "Full QE workflow toolkit for Xray Cloud integration — test management, Postman generation, CI pipeline scaffolding, and browser-based review gates for API regression projects.",
5
5
  "type": "module",
6
6
  "bin": {