froth-webdriverio-framework 6.0.85 → 6.0.86

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.
@@ -134,9 +134,13 @@ async function updateExecuitonDetails(frothUrl, token, id, resultdetails) {
134
134
  formData.append('excution_time', resultdetails.excution_time);
135
135
  }
136
136
 
137
- if (Array.isArray(resultdetails.comments) && resultdetails.comments.length!=0) {
138
- formData.append('comments', resultdetails.comments.join('<br>'));
139
- }
137
+ if (resultdetails.comments === null)
138
+ console.log("Comments is null")
139
+ else if (resultdetails.comments.length === 0)
140
+ console.log("Comments is empty")
141
+ else
142
+ formData.append('comments', resultdetails.comments.join('<br>'))
143
+
140
144
 
141
145
  console.log('📤 Payload sent to API:', JSON.stringify(resultdetails, null, 2));
142
146
  const response = await fetch(url, {
@@ -241,7 +241,7 @@ const commonHooks = {
241
241
  BUFFER.getItem('FROTH_LOGIN_TOKEN'),
242
242
  script.scriptId,
243
243
  script.platform.toLowerCase(),
244
- status
244
+ scriptresult
245
245
  );
246
246
  },
247
247
 
@@ -258,7 +258,7 @@ const commonHooks = {
258
258
  afterSession: async (config, capabilities, specs, exitCode) => {
259
259
  console.log('==== AFTER SESSION ====');
260
260
  // Do not calculate time here; we will use WDIO's total duration in onComplete
261
- console.log('⏱ Leaving execution time calculation for onComplete hook'+resultdetails.comments);
261
+ console.log('⏱ Leaving execution time calculation for onComplete hook' + resultdetails.comments);
262
262
 
263
263
 
264
264
  },
@@ -298,8 +298,13 @@ const commonHooks = {
298
298
  // if (exitCode !== 0 && allComments.length === 0) allComments.push(`Execution failed with exit code ${exitCode}`);
299
299
 
300
300
  // resultdetails.comments = allComments;
301
+ if (resultdetails.comments === null)
302
+ console.log("Comments is null")
303
+ else if (resultdetails.comments.length === 0)
304
+ console.log("Comments is empty")
305
+ else
306
+ console.log('Comments being sent:', resultdetails.comments);
301
307
 
302
- console.log('Comments being sent:', resultdetails.comments.length==0?'':JSON.stringify(resultdetails.comments));
303
308
  console.log('⏱ Final execution time (ms):', totalTime);
304
309
  console.log('⏱ Final execution time (hh:mm:ss):', resultdetails.excution_time);
305
310
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "6.0.85",
3
+ "version": "6.0.86",
4
4
  "readme": "WendriverIO Integration with [BrowserStack](https://www.browserstack.com)",
5
5
  "description": "Selenium examples for WebdriverIO and BrowserStack App Automate",
6
6
  "scripts": {