Alberto Ceballos
Alberto Ceballos

Reputation: 33

Any way to generate a test coverage report in Karate

I´m using Karate testing framework to validate some APIs and would like to know if there is any way to generate a Test Coverage Report by using a predefined list of expected scenarios to run and validate them against the scenarios that actually exist within the Karate feature files.

Imagine that you agree to run 50 scenarios with your client but in reallity you have only developed 20 scenarios within your feature files (more than one stored in different folders)

Wonder if there is any (easy) way to:

Upvotes: 1

Views: 1178

Answers (1)

Eric Driggs
Eric Driggs

Reputation: 21

Here's a bare bones implementation of a coverage report based on comparing karate.log to an openapi/swagger json spec.

https://github.com/ericdriggs/karate-test-utils#karate-coverage-report

Endpoint coverage is a useful metric which can be auto-generated based on auto-generated spec. It also lets you exclude paths which aren't in scope for coverage, e.g. actuator, ping

Will publish jar soonish.

Open an issue if you'd like any enhancements.

MIT licensed so feel free to repurpose

Upvotes: 2

Related Questions