froth-webdriverio-framework 6.0.81 → 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,22 +281,10 @@ const commonHooks = {
|
|
|
285
281
|
resultdetails.excution_time = await msToTime(totalTime);
|
|
286
282
|
resultdetails.excution_status = exitCode === 0 ? 'PASSED' : 'FAILED';
|
|
287
283
|
|
|
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}`);
|
|
288
287
|
|
|
289
|
-
console.log("All Comments:" + allComments)
|
|
290
|
-
// Collect all comments from BUFFER
|
|
291
|
-
let allComments = [];
|
|
292
|
-
try {
|
|
293
|
-
allComments = JSON.parse(BUFFER.getItem('RESULT_COMMENTS'));
|
|
294
|
-
console.log("All comments after parsing:" + JSON.stringify(allComments))
|
|
295
|
-
} catch {
|
|
296
|
-
allComments = [];
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
// Add default success/failure messages if needed
|
|
300
|
-
if (allComments.length === 0 && exitCode === 0) {
|
|
301
|
-
console.log("All comments wer zero so adding the comments ")
|
|
302
|
-
allComments.push('All tests passed ✅');
|
|
303
|
-
}
|
|
304
288
|
resultdetails.comments = allComments;
|
|
305
289
|
|
|
306
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": {
|