froth-webdriverio-framework 4.0.33 → 4.0.34

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.
@@ -171,6 +171,8 @@ const commonconfig = {
171
171
  let scriptresult = "NOT RUN";
172
172
  // Default assumption: test passed (unless soft assertion failed)
173
173
  let finalPassed = passed;
174
+ let combinedError = error;
175
+
174
176
  // Check soft assertion failures
175
177
  const softErrors = browser.testErrors || [];
176
178
  if (softErrors.length > 0) {
@@ -182,17 +184,17 @@ const commonconfig = {
182
184
  resultdetails.comments.push(`${test.title} - failed: ${softErrorMessage}`);
183
185
 
184
186
  // Overwrite the error param so your logic can pick it up
185
- error = new Error(softErrorMessage);
187
+ combinedError = new Error(softErrorMessage);
186
188
  }
187
189
  if (finalPassed) {
188
190
  scriptresult = "PASSED"
189
191
  resultdetails.comments.push(`${test.title} - passed`);
190
192
  }
191
- else if (!finalPassed || error) {
193
+ else if (!finalPassed || combinedError) {
192
194
  scriptresult = "FAILED"
193
- // if (!resultdetails.comments.some(comment => typeof comment === 'string' && comment.includes(test.title)))
194
- console.log(`====> Failed or error while executing the test: ${error ? error.message : "Test failed"}`);
195
- resultdetails.comments.push(`${test.title} - failed: ${error ? error.message : "Test failed"}`);
195
+ console.log(`====> Failed or error while executing the test: ${combinedError ? combinedError.message : "Test failed"}`);
196
+ if (!resultdetails.comments.some(comment => typeof comment === 'string' && comment.includes(test.title)))
197
+ resultdetails.comments.push(`${test.title} - failed: ${combinedError ? combinedError.message : "Test failed"}`);
196
198
 
197
199
  }
198
200
 
@@ -209,7 +211,10 @@ const commonconfig = {
209
211
  jwtScript.scriptId,
210
212
  jwtScript.platform.toLowerCase(),
211
213
  scriptresult)
212
-
214
+ // ✅ Force test failure if soft errors exist
215
+ if (softErrors.length > 0) {
216
+ throw combinedError; // 👈 this is what forces the test to fail in WDIO
217
+ }
213
218
 
214
219
  },
215
220
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "4.0.33",
3
+ "version": "4.0.34",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",