froth-webdriverio-framework 4.0.47 → 4.0.50

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.
@@ -239,7 +239,7 @@ const commonconfig = {
239
239
  });
240
240
 
241
241
  }
242
-
242
+
243
243
  },
244
244
 
245
245
  afterSession: async function (config, capabilities, specs) {
@@ -269,25 +269,24 @@ const commonconfig = {
269
269
  resultdetails.excution_status = BUFFER.getItem("RESULT_DATA") == 0 ? 'PASSED' : 'FAILED'
270
270
  const frothDuration = BUFFER.getItem("FROTH_TOTAL_DURATION");
271
271
 
272
- if(await isInvalidDuration(frothDuration)){
273
- console.log("inside froth duration");
272
+ if (await isInvalidDuration(frothDuration)) {
273
+ // console.log("inside froth duration");
274
274
  if (await isInvalidDuration(duration_tests)) {
275
- console.log("inside froth duration_tests");
276
-
277
- resultdetails.excution_time = await convertTimetoHHMMSS(totalDuration);
278
- } else {
279
- console.log("inside froth totalDuration");
280
- resultdetails.excution_time = await millisecondsToTime(duration_tests);
275
+ // console.log("inside froth duration_tests");
276
+ if (totalDuration > duration_tests)
277
+ resultdetails.excution_time = await millisecondsToTime(totalDuration);
278
+ else
279
+ resultdetails.excution_time = await millisecondsToTime(duration_tests);
281
280
  }
282
281
  } else {
283
282
  console.log("inside froth duration else");
284
283
  resultdetails.excution_time = await secondsToTime(frothDuration);
285
284
  }
286
285
 
287
- console.log("====> Total Duration calculation:" +resultdetails.excution_time);
288
-
286
+ console.log("====> Total Duration calculation:" + resultdetails.excution_time);
287
+
289
288
  await exeDetails.updateExecuitonDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), BUFFER.getItem("FROTH_EXECUTION_ID"), resultdetails)
290
-
289
+
291
290
  // Perform any cleanup or post-test actions here
292
291
  BUFFER.clear();
293
292
  },
@@ -311,8 +310,16 @@ const commonconfig = {
311
310
  async function isInvalidDuration(val) {
312
311
  console.log("val in isValidDuration:" + val);
313
312
  // Check if the value is null, 0, or undefined
314
- let isValid = val === null || val === 0 || val === undefined;
313
+ let isValid;
314
+ if (typeof val === 'string') {
315
+ val = val.trim().toLowerCase();
316
+ isValid = val === "null" || val === "0" || val === "undefined";
317
+
318
+ } else
319
+ isValid = val === null || val === 0 || val === undefined;
320
+
315
321
  console.log("isValid in isValidDuration:" + isValid);
322
+
316
323
  return isValid;
317
324
  }
318
325
  async function secondsToTime(secs) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "4.0.47",
3
+ "version": "4.0.50",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",