froth-webdriverio-framework 4.0.34 → 4.0.35
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.
|
@@ -182,7 +182,7 @@ const commonconfig = {
|
|
|
182
182
|
|
|
183
183
|
// Log in resultdetails
|
|
184
184
|
resultdetails.comments.push(`${test.title} - failed: ${softErrorMessage}`);
|
|
185
|
-
|
|
185
|
+
global.__SOFT_FAIL__ = true;
|
|
186
186
|
// Overwrite the error param so your logic can pick it up
|
|
187
187
|
combinedError = new Error(softErrorMessage);
|
|
188
188
|
}
|
|
@@ -235,7 +235,7 @@ const commonconfig = {
|
|
|
235
235
|
after: async function (result, config, capabilities, specs) {
|
|
236
236
|
console.log('==== AFTER HOOK ====');
|
|
237
237
|
console.log('====> All tests are completed.' + result);
|
|
238
|
-
BUFFER.setItem("RESULT_DATA", result);
|
|
238
|
+
BUFFER.setItem("RESULT_DATA", global.__SOFT_FAIL__ ? 1 : result);
|
|
239
239
|
console.log("====> Result data :" + BUFFER.getItem("RESULT_DATA"))
|
|
240
240
|
/// const resultdetails = {}
|
|
241
241
|
resultdetails.excution_status = BUFFER.getItem("RESULT_DATA") == 0 ? 'PASSED' : 'FAILED'
|
|
@@ -303,7 +303,12 @@ const commonconfig = {
|
|
|
303
303
|
console.log('Execution Time:', results.duration);
|
|
304
304
|
console.log('Exit Code:', exitCode);
|
|
305
305
|
console.log('==== ALL TESTS ARE COMPLETED ====');
|
|
306
|
+
if (global.__SOFT_FAIL__) {
|
|
307
|
+
console.log('❌ One or more tests failed due to soft assertion.');
|
|
308
|
+
process.exit(1); // ✅ Force failure
|
|
309
|
+
}
|
|
306
310
|
|
|
311
|
+
return exitCode;
|
|
307
312
|
}
|
|
308
313
|
|
|
309
314
|
};
|