froth-webdriverio-framework 1.0.51 → 1.0.52

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.
@@ -106,7 +106,7 @@ const commonconfig = {
106
106
  console.log('Local storage has been cleared.');
107
107
 
108
108
  },
109
-
109
+
110
110
  afterSession: async function (config, capabilities, specs) {
111
111
 
112
112
  console.log('This is the aftersession hook');
@@ -114,7 +114,7 @@ const commonconfig = {
114
114
  const resultdetails = {}
115
115
  resultdetails.excution_status = BUFFER.getItem("RESULT_DATA") === 0 ? 'PASSED' : 'FAILED'
116
116
  console.log("Total Duration:" + BUFFER.getItem("TOTAL_DURATION"));
117
- resultdetails.excution_time = convertMillisecondsToTime(BUFFER.getItem("TOTAL_DURATION"))
117
+ resultdetails.excution_time = await secondsToTime(BUFFER.getItem("TOTAL_DURATION"))
118
118
  exeDetails.updateExecuitonDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("LOGIN_TOKEN"), BUFFER.getItem("EXECUTION_ID"), resultdetails)
119
119
  BUFFER.clear();
120
120
  // Perform any cleanup or post-test actions here
@@ -122,7 +122,7 @@ const commonconfig = {
122
122
 
123
123
  };
124
124
 
125
- function convertMillisecondsToTime(msdata) {
125
+ async function convertMillisecondsToTime(msdata) {
126
126
  const ms = parseInt(msdata.replace('ms', '').trim());
127
127
 
128
128
  let seconds = Math.floor(ms / 1000);
@@ -140,6 +140,18 @@ function convertMillisecondsToTime(msdata) {
140
140
  return `${hours}:${minutes}:${seconds}`;
141
141
  }
142
142
 
143
+ async function secondsToTime(secs) {
144
+ let hours = Math.floor(secs / 3600);
145
+ let minutes = Math.floor((secs % 3600) / 60);
146
+ let seconds = secs % 60;
147
+
148
+ // Adding leading zeros if the value is less than 10
149
+ if (hours < 10) hours = '0' + hours;
150
+ if (minutes < 10) minutes = '0' + minutes;
151
+ if (seconds < 10) seconds = '0' + seconds;
152
+
153
+ return hours + ':' + minutes + ':' + seconds;
154
+ }
143
155
  // async function main() {
144
156
  // try {
145
157
  // const frothUrl = "devapi.frothtestops.com";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "1.0.51",
3
+ "version": "1.0.52",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",