ZenWave360 / karate-ide

The Best OpenSource IDE for KarateDSL.
https://marketplace.visualstudio.com/items?itemName=KarateIDE.karate-ide
Other
9 stars 4 forks source link

Clarifications #29

Closed Mohitkrishna12 closed 1 year ago

Mohitkrishna12 commented 1 year ago

Hi @ivangsa , Each api in the open api spec has (200,400,401 etc) response status codes. Karate-ide generated features file has covered these in scenario outline. But when I run the feature I am getting 200 for all response scenarios and getting failed. Is there anyway to handle these scenarios automatically. Like passing invalid data in params/request body to get 400 error.

I have handle 401 scenario by checking the status code and passing wrong token in karate-auth.js file.

ivangsa commented 1 year ago

Hi @Mohitkrishna12

I understand what you mean,

the tests generator creates placeholder tests with some random data, and that saves a lot of time... but it doesn't remove the necesity to edit the data to match your domain model, including "not passing the validations"...

Obviously it's also not guaranted that generated tests pass for 200 status code... You need to edit the data...