froth-webdriverio-framework 4.0.45 → 4.0.46
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/froth_configs/commonconfig.js +18 -12
- package/package.json +1 -1
|
@@ -16,7 +16,7 @@ console.log('===== common config===== ');
|
|
|
16
16
|
const resultdetails = {
|
|
17
17
|
comments: [],
|
|
18
18
|
excution_status: null, // Pass/Fail
|
|
19
|
-
excution_time:
|
|
19
|
+
excution_time: 0, // Execution time in milliseconds
|
|
20
20
|
};
|
|
21
21
|
// Description: This file contains the common configuration for the webdriverio framework.
|
|
22
22
|
const commonconfig = {
|
|
@@ -262,20 +262,22 @@ const commonconfig = {
|
|
|
262
262
|
|
|
263
263
|
endtime = new Date().getTime();
|
|
264
264
|
let totalDuration = endtime - starttime;
|
|
265
|
+
console.log("====> Total Duration taken for :" + BUFFER.getItem("FROTH_TOTAL_DURATION"));
|
|
265
266
|
console.log("====> Total Duration in after session based on start time and end time:" + totalDuration);
|
|
266
|
-
console.log("====> Total Duration in after session based on
|
|
267
|
+
console.log("====> Total Duration in after session based on summing up the test execution times:" + duration_tests);
|
|
267
268
|
|
|
268
269
|
resultdetails.excution_status = BUFFER.getItem("RESULT_DATA") == 0 ? 'PASSED' : 'FAILED'
|
|
269
270
|
|
|
270
|
-
|
|
271
|
-
(await isValidDuration(
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
271
|
+
if(await isValidDuration(BUFFER.getItem("FROTH_TOTAL_DURATION")))
|
|
272
|
+
if(await isValidDuration(duration_tests))
|
|
273
|
+
resultdetails.excution_time = await convertTimetoHHMMSS(totalDuration);
|
|
274
|
+
else
|
|
275
|
+
resultdetails.excution_time = await secondsToTime(duration_tests)
|
|
276
|
+
else
|
|
277
|
+
resultdetails.excution_time = await secondsToTime(BUFFER.getItem("FROTH_TOTAL_DURATION"));
|
|
278
|
+
|
|
279
|
+
console.log("====> Total Duration calculation:" +resultdetails.excution_time);
|
|
280
|
+
|
|
279
281
|
await exeDetails.updateExecuitonDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), BUFFER.getItem("FROTH_EXECUTION_ID"), resultdetails)
|
|
280
282
|
|
|
281
283
|
// Perform any cleanup or post-test actions here
|
|
@@ -299,7 +301,11 @@ const commonconfig = {
|
|
|
299
301
|
|
|
300
302
|
};
|
|
301
303
|
async function isValidDuration(val) {
|
|
302
|
-
|
|
304
|
+
console.log("val in isValidDuration:" + val);
|
|
305
|
+
// Check if the value is null, 0, or undefined
|
|
306
|
+
let isValid = val === null || val === 0 || val === undefined;
|
|
307
|
+
console.log("isValid in isValidDuration:" + isValid);
|
|
308
|
+
return isValid;
|
|
303
309
|
}
|
|
304
310
|
async function secondsToTime(secs) {
|
|
305
311
|
console.log("secs in secondsToTime :" + secs);
|