Surefire: testng-results.xml: Conditionally change reported status if failure is from AssertionError

Viewed 20

When running automation, we deal with 2 types of failures-

Assertion Errors: The script has run but hit an error when comparing expected data to actual data. These are valid errors.

Everything Else: All other failures are due to some error in the automation script itself, and they need investigated.

In the SureFire report "testng-results.xml" file, both types of failures result in a status="FAIL".
It would be great if we could dump one of these failure groups into a different status.

For Assertion Errors the first line of the given stack trace always has the string java.lang.AssertionError: but I don't know how to leverage that into a separate status on the report.

Has anyone messed with conditional statuses in a surefire report?

Thanks for any replies!

0 Answers
Related