froth-webdriverio-framework 6.0.72 → 6.0.73
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 +25 -2
- package/package.json +1 -1
|
@@ -216,13 +216,13 @@ const commonHooks = {
|
|
|
216
216
|
},
|
|
217
217
|
|
|
218
218
|
/* ==== AFTER SESSION ==== */
|
|
219
|
-
afterSession: async (config, capabilities, specs,exitCode) => {
|
|
219
|
+
afterSession: async (config, capabilities, specs, exitCode) => {
|
|
220
220
|
console.log('==== AFTER SESSION ====');
|
|
221
221
|
const endTime = Date.now();
|
|
222
222
|
if (!suiteStartTime) suiteStartTime = endTime;
|
|
223
223
|
|
|
224
224
|
const totalTime = Math.max(endTime - suiteStartTime, totalTestDuration);
|
|
225
|
-
|
|
225
|
+
// resultdetails.excution_status = exitCode === 0 ? 'PASSED' : 'FAILED';
|
|
226
226
|
resultdetails.excution_time = msToTime(totalTime);
|
|
227
227
|
|
|
228
228
|
console.log('⏱ Final execution time:', resultdetails.excution_time);
|
|
@@ -264,7 +264,30 @@ const commonHooks = {
|
|
|
264
264
|
if (exitCode !== 0 && resultdetails.comments.length === 0) {
|
|
265
265
|
resultdetails.comments.push(`Execution failed with exit code ${exitCode}`);
|
|
266
266
|
}
|
|
267
|
+
// ✅ Set final status
|
|
268
|
+
resultdetails.excution_status = exitCode === 0 ? 'PASSED' : 'FAILED';
|
|
269
|
+
|
|
270
|
+
// ✅ If execution failed but no comments, add default comment
|
|
271
|
+
if (exitCode !== 0 && resultdetails.comments.length === 0) {
|
|
272
|
+
resultdetails.comments.push(`Execution failed with exit code ${exitCode}`);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// ✅ Make sure excution_time is set (if not, fallback)
|
|
276
|
+
if (!resultdetails.excution_time || resultdetails.excution_time === 'NaN:NaN:NaN') {
|
|
277
|
+
const fallbackTime = totalTestDuration || 0;
|
|
278
|
+
resultdetails.excution_time = msToTime(fallbackTime);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
console.log('📤 Updating DB with final execution details');
|
|
282
|
+
console.log('Status:', resultdetails.excution_status);
|
|
283
|
+
console.log('Duration:', resultdetails.excution_time);
|
|
267
284
|
|
|
285
|
+
// await exeDetails.updateExecuitonDetails(
|
|
286
|
+
// BUFFER.getItem('ORGANISATION_DOMAIN_URL'),
|
|
287
|
+
// BUFFER.getItem('FROTH_LOGIN_TOKEN'),
|
|
288
|
+
// BUFFER.getItem('FROTH_EXECUTION_ID'),
|
|
289
|
+
// resultdetails
|
|
290
|
+
// );
|
|
268
291
|
await safeUpdateExecution();
|
|
269
292
|
BUFFER.clear();
|
|
270
293
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "froth-webdriverio-framework",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.73",
|
|
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": {
|