froth-webdriverio-framework 6.0.82 → 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.
@@ -19,7 +19,7 @@ module.exports = {
19
19
  connectionRetryTimeout: 90000,
20
20
  connectionRetryCount: 3,
21
21
 
22
-
22
+ maxInstances: 1,
23
23
  framework: 'mocha',
24
24
  mochaOpts: {
25
25
  ui: 'bdd',
@@ -82,16 +82,10 @@ async function failExecution(reason) {
82
82
  process.exit(1);
83
83
  }
84
84
 
85
- // pushComment now only updates BUFFER
85
+ // pushComment
86
86
  async function pushComment(msg) {
87
- let comments = [];
88
- try {
89
- comments = JSON.parse(BUFFER.getItem('RESULT_COMMENTS') || '[]');
90
- } catch {
91
- comments = [];
92
- }
93
- comments.push(msg);
94
- BUFFER.setItem('RESULT_COMMENTS', JSON.stringify(comments));
87
+ if (!global.TEST_COMMENTS) global.TEST_COMMENTS = [];
88
+ global.TEST_COMMENTS.push(msg);
95
89
  }
96
90
  /* ------------------ COMMON CONFIG ------------------ */
97
91
 
@@ -221,9 +215,22 @@ const commonHooks = {
221
215
  totalTestDuration += duration;
222
216
 
223
217
  const fileName = path.basename(test.file);
224
- const status = passed ? 'PASSED' : 'FAILED';
225
- const msg = `${test.title} - ${passed ? 'Passed' : error?.message || 'Failed'}`;
226
- 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
+ }
227
234
 
228
235
  const suiteDetails = JSON.parse(BUFFER.getItem('FROTHE_SUITE_DETAILS'));
229
236
  const script = suiteDetails.find(s => s.scriptName === fileName.replace('.js', ''));
@@ -285,22 +292,11 @@ const commonHooks = {
285
292
  resultdetails.excution_time = await msToTime(totalTime);
286
293
  resultdetails.excution_status = exitCode === 0 ? 'PASSED' : 'FAILED';
287
294
 
288
- // Collect all comments from BUFFER
289
- let allComments = [];
290
- // console.log("All Comments:" + JSON.parse(BUFFER.getItem('RESULT_COMMENTS')))
291
- try {
292
- allComments = JSON.parse(BUFFER.getItem('RESULT_COMMENTS'));
293
- console.log("All comments after parsing:" + JSON.stringify(allComments))
294
- } catch {
295
- allComments = [];
296
- }
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}`);
297
298
 
298
- // Add default success/failure messages if needed
299
- if (allComments.length === 0 && exitCode === 0) {
300
- console.log("All comments wer zero so adding the comments ")
301
- allComments.push('All tests passed ✅');
302
- }
303
- resultdetails.comments = allComments;
299
+ // resultdetails.comments = allComments;
304
300
 
305
301
  console.log('Comments being sent:', resultdetails.comments);
306
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.82",
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": {