froth-webdriverio-framework 7.0.40 → 7.0.42

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.
@@ -41,6 +41,7 @@ function registerGlobalErrorHandlers() {
41
41
  async function safeUpdateExecution() {
42
42
  try {
43
43
  if (executionUpdated) return;
44
+ console.log("Status of execution Updated:" + executionUpdated)
44
45
  executionUpdated = true;
45
46
 
46
47
  try {
@@ -294,7 +295,9 @@ const commonHooks = {
294
295
  resultdetails.excution_time = await msToTime(totalTime);
295
296
 
296
297
  console.log("Exit code after session===>" + exitCode)
297
- exitCode = exitCode ?? 0;
298
+ if (exitCode === undefined || exitCode === null) {
299
+ exitCode = 1 // treat as failure
300
+ }
298
301
  resultdetails.excution_status = exitCode === 0 ? 'PASSED' : 'FAILED';
299
302
 
300
303
  console.log('Comments being sent:', resultdetails.comments);
@@ -302,7 +305,7 @@ const commonHooks = {
302
305
  console.log('⏱ Final execution time (ms):', totalTime);
303
306
  console.log('⏱ Final execution time (hh:mm:ss):', resultdetails.excution_time);
304
307
  await safeUpdateExecution();
305
- BUFFER.clear();
308
+
306
309
 
307
310
  },
308
311
 
@@ -328,12 +331,13 @@ const commonHooks = {
328
331
  onComplete: async (exitCode, _, __, results) => {
329
332
  console.log('==== ON COMPLETE ====');
330
333
  console.log(`Total: ${results.total || 0}, Passed: ${results.passed || 0}, Failed: ${results.failed || 0}`);
331
- exitCode = exitCode ?? 0;
334
+ if (exitCode === undefined || exitCode === null) {
335
+ exitCode = 1 // treat as failure
336
+ }
332
337
  resultdetails.excution_status = exitCode === 0 ? 'PASSED' : 'FAILED';
333
338
 
334
339
  await safeUpdateExecution();
335
-
336
-
340
+ BUFFER.clear();
337
341
  return exitCode;
338
342
  },
339
343
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "7.0.40",
3
+ "version": "7.0.42",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",