froth-webdriverio-framework 6.0.80 → 6.0.82
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.
- package/froth_configs/commonhook.js +38 -10
- package/package.json +1 -1
|
@@ -82,10 +82,16 @@ async function failExecution(reason) {
|
|
|
82
82
|
process.exit(1);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
// pushComment now only updates BUFFER
|
|
85
86
|
async function pushComment(msg) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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));
|
|
89
95
|
}
|
|
90
96
|
/* ------------------ COMMON CONFIG ------------------ */
|
|
91
97
|
|
|
@@ -191,6 +197,21 @@ const commonHooks = {
|
|
|
191
197
|
/* ========== BEFORE TEST ========== */
|
|
192
198
|
beforeTest: async (test) => {
|
|
193
199
|
console.log(`▶️ START TEST: ${test.title}`);
|
|
200
|
+
|
|
201
|
+
// Update script status to IN_PROGRESS
|
|
202
|
+
// const fileName = path.basename(test.file);
|
|
203
|
+
// const suiteDetails = JSON.parse(BUFFER.getItem('FROTHE_SUITE_DETAILS'));
|
|
204
|
+
// const script = suiteDetails.find(s => s.scriptName === fileName.replace('.js', ''));
|
|
205
|
+
|
|
206
|
+
// if (script) {
|
|
207
|
+
// await exeDetails.updateScriptExecutionStatus(
|
|
208
|
+
// BUFFER.getItem('ORGANISATION_DOMAIN_URL'),
|
|
209
|
+
// BUFFER.getItem('FROTH_LOGIN_TOKEN'),
|
|
210
|
+
// script.scriptId,
|
|
211
|
+
// script.platform.toLowerCase(),
|
|
212
|
+
// 'IN_PROGRESS'
|
|
213
|
+
// );
|
|
214
|
+
// }
|
|
194
215
|
},
|
|
195
216
|
|
|
196
217
|
/* ========== AFTER TEST ========== */
|
|
@@ -264,16 +285,23 @@ const commonHooks = {
|
|
|
264
285
|
resultdetails.excution_time = await msToTime(totalTime);
|
|
265
286
|
resultdetails.excution_status = exitCode === 0 ? 'PASSED' : 'FAILED';
|
|
266
287
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
allComments.
|
|
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 = [];
|
|
272
296
|
}
|
|
273
|
-
|
|
274
|
-
|
|
297
|
+
|
|
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 ✅');
|
|
275
302
|
}
|
|
276
303
|
resultdetails.comments = allComments;
|
|
304
|
+
|
|
277
305
|
console.log('Comments being sent:', resultdetails.comments);
|
|
278
306
|
console.log('⏱ Final execution time (ms):', totalTime);
|
|
279
307
|
console.log('⏱ Final execution time (hh:mm:ss):', resultdetails.excution_time);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "froth-webdriverio-framework",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.82",
|
|
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": {
|