froth-webdriverio-framework 4.0.41 → 4.0.43

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.
@@ -11,6 +11,7 @@ const { error } = require('console');
11
11
  //const isBrowserStackEnabled = process.env.BROWSERSTACK;
12
12
  let starttime;
13
13
  let endtime;
14
+ let duration_tests=0;
14
15
  console.log('===== common config===== ');
15
16
  const resultdetails = {
16
17
  comments: [],
@@ -165,6 +166,8 @@ const commonconfig = {
165
166
  console.log('====> Test File Name:', fileName);
166
167
  // BUFFER.setItem("FROTH_TOTAL_DURATION", Number(BUFFER.getItem("FROTH_TOTAL_DURATION")) + duration)
167
168
  console.log(`====> Total Duration for this test: ${duration}ms`);
169
+ duration_tests += duration;
170
+ console.log(`====> Total Duration for all tests: ${duration_tests}ms`);
168
171
  console.log(`====> Status of test: ${passed}`);
169
172
 
170
173
  let scriptresult = "NOT RUN";
@@ -174,6 +177,7 @@ const commonconfig = {
174
177
  if (passed) {
175
178
  scriptresult = "PASSED"
176
179
  resultdetails.comments.push(`${test.title} - passed`);
180
+ console.log(`====> resultdetails comments: ${resultdetails.comments}`);
177
181
  }
178
182
  else if (!finalPassed || error) {
179
183
  scriptresult = "FAILED"
@@ -273,12 +277,19 @@ const commonconfig = {
273
277
  endtime = new Date().getTime();
274
278
  let totalDuration = endtime - starttime;
275
279
  console.log("====> Total Duration in after session based on start time and end time:" + totalDuration);
276
-
280
+ console.log("====> Total Duration in after session based on start time and end time:" + duration_tests );
281
+
277
282
  resultdetails.excution_status = BUFFER.getItem("RESULT_DATA") == 0 ? 'PASSED' : 'FAILED'
278
- console.log("====> Total Duration calculation:" + BUFFER.getItem("FROTH_TOTAL_DURATION") === null || BUFFER.getItem("FROTH_TOTAL_DURATION") === 0 || BUFFER.getItem("FROTH_TOTAL_DURATION") === undefined
279
- ? await convertTimetoHHMMSS(totalDuration) : await secondsToTime(BUFFER.getItem("FROTH_TOTAL_DURATION")));
280
- resultdetails.excution_time = BUFFER.getItem("FROTH_TOTAL_DURATION") === null || BUFFER.getItem("FROTH_TOTAL_DURATION") === 0 || BUFFER.getItem("FROTH_TOTAL_DURATION") === undefined ? await convertTimetoHHMMSS(totalDuration) : await secondsToTime(BUFFER.getItem("FROTH_TOTAL_DURATION"))
281
-
283
+
284
+ console.log("====> Total Duration calculation:" +
285
+ (await isValidDuration(BUFFER.getItem("FROTH_TOTAL_DURATION"))
286
+ ? (await isValidDuration(duration_tests) ? await convertTimetoHHMMSS(totalDuration) : await secondsToTime(duration_tests))
287
+ : await secondsToTime(BUFFER.getItem("FROTH_TOTAL_DURATION"))));
288
+
289
+ resultdetails.excution_time = await isValidDuration(BUFFER.getItem("FROTH_TOTAL_DURATION"))
290
+ ? (await isValidDuration(duration_tests) ? await convertTimetoHHMMSS(totalDuration) : await secondsToTime(duration_tests))
291
+ : await secondsToTime(BUFFER.getItem("FROTH_TOTAL_DURATION"));
292
+
282
293
  await exeDetails.updateExecuitonDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), BUFFER.getItem("FROTH_EXECUTION_ID"), resultdetails)
283
294
  BUFFER.clear();
284
295
 
@@ -287,8 +298,11 @@ const commonconfig = {
287
298
  }
288
299
 
289
300
  };
290
-
301
+ async function isValidDuration(val) {
302
+ return val === null && val === 0 && val === undefined;
303
+ }
291
304
  async function secondsToTime(secs) {
305
+ console.log("secs in secondsToTime :" + secs);
292
306
  let hours = Math.floor(secs / 3600);
293
307
  let minutes = Math.floor((secs % 3600) / 60);
294
308
  let seconds = secs % 60;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "4.0.41",
3
+ "version": "4.0.43",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",