I have below requirements, if anyone can help in understanding how I can achieve that.
- Conditionally want to change the path
- Conditionally want to change the payload
- Conditionally validate different response structure
- Conditionally skip an API call and move to next API call in a scenario containing multiple API hits
Stating example below on what I want to achieve, can we do this in karate syntax in feature file?
path = 'v2/myapi/getlist'
else if (environment == stg)
path = 'v1/myapi/getlist'```
similarly for payload and response validation as both might differ based on the environment we are executing test in.
Also want to conditionally skip an API call
```if(environment == dev)
Given path
When method get
Then match 200```
Want to execute above api call only if environment is dev but skip and continue to next api call if it is any other environment
It would be really helpful if someone can help to achieve this