Gaurav Kinra
Gaurav Kinra

Reputation: 203

Can we have different scenario for one api in karate?

Lets say I have one api and there are different scenarios to check in that one api.So for this can we add different scenarios in one feature file without calling api again and again.

Upvotes: 1

Views: 468

Answers (1)

Peter Thomas
Peter Thomas

Reputation: 58098

You can certainly have multiple scenarios in one feature file.

And if you get a response back and you can do all the assertions you have in mind against this single response - you don't need to call again. Maybe you need a single scenario.

If you are expecting all your boundary conditions and non-happy paths to be achieved without making multiple HTTP calls, I'm sorry - I don't think any framework will do that magic for you.

Upvotes: 1

Related Questions