froth-webdriverio-framework 4.0.44 → 4.0.45
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 +20 -20
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ const { error } = require('console');
|
|
|
11
11
|
//const isBrowserStackEnabled = process.env.BROWSERSTACK;
|
|
12
12
|
let starttime;
|
|
13
13
|
let endtime;
|
|
14
|
-
|
|
14
|
+
let duration_tests = 0;
|
|
15
15
|
console.log('===== common config===== ');
|
|
16
16
|
const resultdetails = {
|
|
17
17
|
comments: [],
|
|
@@ -166,7 +166,7 @@ const commonconfig = {
|
|
|
166
166
|
console.log('====> Test File Name:', fileName);
|
|
167
167
|
// BUFFER.setItem("FROTH_TOTAL_DURATION", Number(BUFFER.getItem("FROTH_TOTAL_DURATION")) + duration)
|
|
168
168
|
console.log(`====> Total Duration for this test: ${duration}ms`);
|
|
169
|
-
|
|
169
|
+
duration_tests += duration;
|
|
170
170
|
console.log(`====> Total Duration for all tests: ${duration_tests}ms`);
|
|
171
171
|
console.log(`====> Status of test: ${passed}`);
|
|
172
172
|
|
|
@@ -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) {
|
|
@@ -260,38 +260,38 @@ const commonconfig = {
|
|
|
260
260
|
resultdetails.comments.push(`Execution failed with exit code: ${reason}`);
|
|
261
261
|
});
|
|
262
262
|
|
|
263
|
-
// Perform any cleanup or post-test actions here
|
|
264
|
-
},
|
|
265
|
-
|
|
266
|
-
onComplete: async function (exitCode, config, capabilities, results) {
|
|
267
|
-
console.log('==== ON COMPLETE HOOK ====');
|
|
268
|
-
console.log('====> Results:', results);
|
|
269
|
-
console.log('==== Test Results Summary ======');
|
|
270
|
-
console.log('Total Tests:', results.total);
|
|
271
|
-
console.log('Passed:', results.passed);
|
|
272
|
-
console.log('Failed:', results.failed);
|
|
273
|
-
console.log('Skipped:', results.skipped);
|
|
274
|
-
console.log('Execution Time:', results.duration);
|
|
275
|
-
console.log('Exit Code:', exitCode);
|
|
276
|
-
|
|
277
263
|
endtime = new Date().getTime();
|
|
278
264
|
let totalDuration = endtime - starttime;
|
|
279
265
|
console.log("====> Total Duration in after session based on start time and end time:" + totalDuration);
|
|
280
|
-
console.log("====> Total Duration in after session based on start time and end time:" +
|
|
266
|
+
console.log("====> Total Duration in after session based on start time and end time:" + duration_tests);
|
|
281
267
|
|
|
282
268
|
resultdetails.excution_status = BUFFER.getItem("RESULT_DATA") == 0 ? 'PASSED' : 'FAILED'
|
|
283
269
|
|
|
284
270
|
console.log("====> Total Duration calculation:" +
|
|
285
271
|
(await isValidDuration(BUFFER.getItem("FROTH_TOTAL_DURATION"))
|
|
286
|
-
? (await isValidDuration(
|
|
272
|
+
? (await isValidDuration(duration_tests) ? await convertTimetoHHMMSS(totalDuration) : await secondsToTime(duration_tests))
|
|
287
273
|
: await secondsToTime(BUFFER.getItem("FROTH_TOTAL_DURATION"))));
|
|
288
274
|
|
|
289
275
|
resultdetails.excution_time = await isValidDuration(BUFFER.getItem("FROTH_TOTAL_DURATION"))
|
|
290
|
-
? (await isValidDuration(
|
|
276
|
+
? (await isValidDuration(duration_tests) ? await convertTimetoHHMMSS(totalDuration) : await secondsToTime(duration_tests))
|
|
291
277
|
: await secondsToTime(BUFFER.getItem("FROTH_TOTAL_DURATION"));
|
|
292
278
|
|
|
293
279
|
await exeDetails.updateExecuitonDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), BUFFER.getItem("FROTH_EXECUTION_ID"), resultdetails)
|
|
280
|
+
|
|
281
|
+
// Perform any cleanup or post-test actions here
|
|
294
282
|
BUFFER.clear();
|
|
283
|
+
},
|
|
284
|
+
|
|
285
|
+
onComplete: async function (exitCode, config, capabilities, results) {
|
|
286
|
+
console.log('==== ON COMPLETE HOOK ====');
|
|
287
|
+
console.log('====> Results:', results);
|
|
288
|
+
console.log('==== Test Results Summary ======');
|
|
289
|
+
console.log('Total Tests:', results.total);
|
|
290
|
+
console.log('Passed:', results.passed);
|
|
291
|
+
console.log('Failed:', results.failed);
|
|
292
|
+
console.log('Skipped:', results.skipped);
|
|
293
|
+
console.log('Execution Time:', results.duration);
|
|
294
|
+
console.log('Exit Code:', exitCode);
|
|
295
295
|
|
|
296
296
|
console.log('==== ALL TESTS ARE COMPLETED ====');
|
|
297
297
|
return exitCode;
|