How to fail the Build if any of our scenario or feature fails in Karate Framework?

567 Views Asked by At

I'm hitting an API Using karate framework. I see maven build as success even after it generate 500 internal server error with failed scenario details.

I want to make maven build status as FAILURE if I see other than 200 status code

1

There are 1 best solutions below

0
On

Refer to the docs on parallel execution: https://github.com/intuit/karate#junit-5-parallel-execution

It is your responsibility to either fail using JUnit or depending on your CI, it would detect the report XML / JSON files and mark the build status accordingly.

assertEquals(0, results.getFailCount(), results.getErrorMessages());