froth-webdriverio-framework 6.0.79 → 6.0.81
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.
|
@@ -4,8 +4,8 @@ async function getBSBuildDetails(sessionType, bsUsername, bsPassword) {
|
|
|
4
4
|
|
|
5
5
|
const basicAuth = btoa(`${bsUsername}:${bsPassword}`);
|
|
6
6
|
const buildName = sessionType === 'app-automate'
|
|
7
|
-
? `Mobile_Build
|
|
8
|
-
: `Web_Build
|
|
7
|
+
? `Mobile_Build- ${process.env.FROTH_TESTOPS_BUILD_NAME}`
|
|
8
|
+
: `Web_Build- ${process.env.FROTH_TESTOPS_BUILD_NAME}`;
|
|
9
9
|
|
|
10
10
|
console.log(`BrowserStack build name: ${buildName}`);
|
|
11
11
|
|
|
@@ -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
|
+
let comments = [];
|
|
88
|
+
try {
|
|
89
|
+
comments = JSON.parse(BUFFER.getItem('RESULT_COMMENTS') || '[]');
|
|
90
|
+
} catch {
|
|
91
|
+
comments = [];
|
|
92
|
+
}
|
|
87
93
|
comments.push(msg);
|
|
88
|
-
BUFFER.setItem('RESULT_COMMENTS', comments);
|
|
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 ========== */
|
|
@@ -202,7 +223,7 @@ const commonHooks = {
|
|
|
202
223
|
const fileName = path.basename(test.file);
|
|
203
224
|
const status = passed ? 'PASSED' : 'FAILED';
|
|
204
225
|
const msg = `${test.title} - ${passed ? 'Passed' : error?.message || 'Failed'}`;
|
|
205
|
-
pushComment(msg);
|
|
226
|
+
await pushComment(msg);
|
|
206
227
|
|
|
207
228
|
const suiteDetails = JSON.parse(BUFFER.getItem('FROTHE_SUITE_DETAILS'));
|
|
208
229
|
const script = suiteDetails.find(s => s.scriptName === fileName.replace('.js', ''));
|
|
@@ -264,16 +285,24 @@ const commonHooks = {
|
|
|
264
285
|
resultdetails.excution_time = await msToTime(totalTime);
|
|
265
286
|
resultdetails.excution_status = exitCode === 0 ? 'PASSED' : 'FAILED';
|
|
266
287
|
|
|
267
|
-
const allComments = BUFFER.getItem('RESULT_COMMENTS') || [];
|
|
268
288
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
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 = [];
|
|
272
297
|
}
|
|
273
|
-
|
|
274
|
-
|
|
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 ✅');
|
|
275
303
|
}
|
|
276
304
|
resultdetails.comments = allComments;
|
|
305
|
+
|
|
277
306
|
console.log('Comments being sent:', resultdetails.comments);
|
|
278
307
|
console.log('⏱ Final execution time (ms):', totalTime);
|
|
279
308
|
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.81",
|
|
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": {
|