froth-webdriverio-framework 6.0.82 → 6.0.83
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,6 +14,8 @@ const resultdetails = {
|
|
|
14
14
|
excution_status: null,
|
|
15
15
|
excution_time: null
|
|
16
16
|
};
|
|
17
|
+
// At top of commonHooks.js
|
|
18
|
+
global.TEST_COMMENTS = [];
|
|
17
19
|
|
|
18
20
|
/* ----------------- GLOBAL ERROR HANDLERS ----------------- */
|
|
19
21
|
let globalErrorRegistered = false;
|
|
@@ -82,16 +84,10 @@ async function failExecution(reason) {
|
|
|
82
84
|
process.exit(1);
|
|
83
85
|
}
|
|
84
86
|
|
|
85
|
-
// pushComment
|
|
87
|
+
// pushComment
|
|
86
88
|
async function pushComment(msg) {
|
|
87
|
-
|
|
88
|
-
|
|
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));
|
|
89
|
+
if (!global.TEST_COMMENTS) global.TEST_COMMENTS = [];
|
|
90
|
+
global.TEST_COMMENTS.push(msg);
|
|
95
91
|
}
|
|
96
92
|
/* ------------------ COMMON CONFIG ------------------ */
|
|
97
93
|
|
|
@@ -285,21 +281,10 @@ const commonHooks = {
|
|
|
285
281
|
resultdetails.excution_time = await msToTime(totalTime);
|
|
286
282
|
resultdetails.excution_status = exitCode === 0 ? 'PASSED' : 'FAILED';
|
|
287
283
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
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
|
-
}
|
|
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}`);
|
|
297
287
|
|
|
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
288
|
resultdetails.comments = allComments;
|
|
304
289
|
|
|
305
290
|
console.log('Comments being sent:', resultdetails.comments);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "froth-webdriverio-framework",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.83",
|
|
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": {
|