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.
|
@@ -82,16 +82,10 @@ async function failExecution(reason) {
|
|
|
82
82
|
process.exit(1);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
// pushComment
|
|
85
|
+
// pushComment
|
|
86
86
|
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));
|
|
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
|
-
|
|
225
|
-
|
|
226
|
-
|
|
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
|
-
//
|
|
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
|
-
}
|
|
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
|
-
//
|
|
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.
|
|
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": {
|