froth-webdriverio-framework 6.0.83 → 6.0.84

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.
@@ -14,8 +14,6 @@ const resultdetails = {
14
14
  excution_status: null,
15
15
  excution_time: null
16
16
  };
17
- // At top of commonHooks.js
18
- global.TEST_COMMENTS = [];
19
17
 
20
18
  /* ----------------- GLOBAL ERROR HANDLERS ----------------- */
21
19
  let globalErrorRegistered = false;
@@ -217,9 +215,22 @@ const commonHooks = {
217
215
  totalTestDuration += duration;
218
216
 
219
217
  const fileName = path.basename(test.file);
220
- const status = passed ? 'PASSED' : 'FAILED';
221
- const msg = `${test.title} - ${passed ? 'Passed' : error?.message || 'Failed'}`;
222
- await pushComment(msg);
218
+ let scriptresult = "NOT RUN";
219
+ // Default assumption: test passed (unless soft assertion failed)
220
+ let finalPassed = passed;
221
+
222
+ if (passed) {
223
+ scriptresult = "PASSED"
224
+ resultdetails.comments.push(`${test.title} - passed`);
225
+ console.log(`====> resultdetails comments: ${resultdetails.comments}`);
226
+ }
227
+ else if (!finalPassed || error) {
228
+ scriptresult = "FAILED"
229
+ console.log(`====> Failed or error while executing the test: ${error ? error.message : "Test failed"}`);
230
+ if (!resultdetails.comments.some(comment => typeof comment === 'string' && comment.includes(test.title)))
231
+ resultdetails.comments.push(`${test.title} - failed: ${error ? error.message : "Test failed"}`);
232
+
233
+ }
223
234
 
224
235
  const suiteDetails = JSON.parse(BUFFER.getItem('FROTHE_SUITE_DETAILS'));
225
236
  const script = suiteDetails.find(s => s.scriptName === fileName.replace('.js', ''));
@@ -281,11 +292,11 @@ const commonHooks = {
281
292
  resultdetails.excution_time = await msToTime(totalTime);
282
293
  resultdetails.excution_status = exitCode === 0 ? 'PASSED' : 'FAILED';
283
294
 
284
- const allComments = global.TEST_COMMENTS || [];
285
- if (allComments.length === 0 && exitCode === 0) allComments.push('All tests passed ✅');
286
- if (exitCode !== 0 && allComments.length === 0) allComments.push(`Execution failed with exit code ${exitCode}`);
295
+ // const allComments = global.TEST_COMMENTS || [];
296
+ // if (allComments.length === 0 && exitCode === 0) allComments.push('All tests passed ✅');
297
+ // if (exitCode !== 0 && allComments.length === 0) allComments.push(`Execution failed with exit code ${exitCode}`);
287
298
 
288
- resultdetails.comments = allComments;
299
+ // resultdetails.comments = allComments;
289
300
 
290
301
  console.log('Comments being sent:', resultdetails.comments);
291
302
  console.log('⏱ Final execution time (ms):', totalTime);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "6.0.83",
3
+ "version": "6.0.84",
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": {