froth-webdriverio-framework 6.0.85 → 6.0.87
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.
|
@@ -134,9 +134,13 @@ async function updateExecuitonDetails(frothUrl, token, id, resultdetails) {
|
|
|
134
134
|
formData.append('excution_time', resultdetails.excution_time);
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
if (
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
if (resultdetails.comments === null)
|
|
138
|
+
console.log("Comments is null")
|
|
139
|
+
else if (resultdetails.comments.length === 0)
|
|
140
|
+
console.log("Comments is empty")
|
|
141
|
+
else
|
|
142
|
+
formData.append('comments', resultdetails.comments.join('<br>'))
|
|
143
|
+
|
|
140
144
|
|
|
141
145
|
console.log('📤 Payload sent to API:', JSON.stringify(resultdetails, null, 2));
|
|
142
146
|
const response = await fetch(url, {
|
|
@@ -241,7 +241,7 @@ const commonHooks = {
|
|
|
241
241
|
BUFFER.getItem('FROTH_LOGIN_TOKEN'),
|
|
242
242
|
script.scriptId,
|
|
243
243
|
script.platform.toLowerCase(),
|
|
244
|
-
|
|
244
|
+
scriptresult
|
|
245
245
|
);
|
|
246
246
|
},
|
|
247
247
|
|
|
@@ -258,8 +258,8 @@ const commonHooks = {
|
|
|
258
258
|
afterSession: async (config, capabilities, specs, exitCode) => {
|
|
259
259
|
console.log('==== AFTER SESSION ====');
|
|
260
260
|
// Do not calculate time here; we will use WDIO's total duration in onComplete
|
|
261
|
-
console.log('⏱ Leaving execution time calculation for onComplete hook'+resultdetails.comments);
|
|
262
|
-
|
|
261
|
+
console.log('⏱ Leaving execution time calculation for onComplete hook' + resultdetails.comments);
|
|
262
|
+
BUFFER.setItem('ALL_COMMENTS', resultdetails.comments);
|
|
263
263
|
|
|
264
264
|
},
|
|
265
265
|
|
|
@@ -293,16 +293,24 @@ const commonHooks = {
|
|
|
293
293
|
resultdetails.excution_time = await msToTime(totalTime);
|
|
294
294
|
resultdetails.excution_status = exitCode === 0 ? 'PASSED' : 'FAILED';
|
|
295
295
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
// if (exitCode !== 0 && allComments.length === 0) allComments.push(`Execution failed with exit code ${exitCode}`);
|
|
299
|
-
|
|
300
|
-
// resultdetails.comments = allComments;
|
|
301
|
-
|
|
302
|
-
console.log('Comments being sent:', resultdetails.comments.length==0?'':JSON.stringify(resultdetails.comments));
|
|
296
|
+
console.log('Comments being sent:', BUFFER.getItem('ALL_COMMENTS'));
|
|
297
|
+
resultdetails.comments.push(BUFFER.getItem('ALL_COMMENTS'))
|
|
303
298
|
console.log('⏱ Final execution time (ms):', totalTime);
|
|
304
299
|
console.log('⏱ Final execution time (hh:mm:ss):', resultdetails.excution_time);
|
|
305
300
|
|
|
301
|
+
const allComments = [];
|
|
302
|
+
for (const runnerId in results.runners) {
|
|
303
|
+
const runner = results.runners[runnerId];
|
|
304
|
+
if (runner.tests) {
|
|
305
|
+
runner.tests.forEach(t => {
|
|
306
|
+
const msg = t.error ? `${t.title} - ${t.error.message}` : `${t.title} - Passed`;
|
|
307
|
+
allComments.push(msg);
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
resultdetails.comments = allComments;
|
|
312
|
+
console.log('Comments being sent before and aftersession:', resultdetails.comments );
|
|
313
|
+
|
|
306
314
|
await safeUpdateExecution();
|
|
307
315
|
BUFFER.clear();
|
|
308
316
|
return exitCode;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "froth-webdriverio-framework",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.87",
|
|
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": {
|