Hello ,
Thanks for the quick response.
There is, however, a catch with the above approach which I observed, please correct me if I'm wrong-
It seems the scope of changing/chaining the scenarios is limited within the test itself.
I.e. Each test is always matching with the "Started" scenario first and always returning the first response.
So, unless there is a call to that endpoint in that same test, ie. if the same test hits the endpoint 3 times only then the different scenarios are picked up.
Hence, I'm not sure if scenarios could be useful for this use case.
Please correct me if I'm wrong.
-------------------------------------------------------------
Here is the mappings file I was using--
{
"mappings": [
{
"scenarioName": "API1",
"requiredScenarioState": "Started",
"newScenarioState": "test1done",
"request": {"method": "PUT","urlPath": "/v1/endpoint"},
"response": {status": 200},
{
"scenarioName": "API1",
"requiredScenarioState": "test1done",
"newScenarioState": "test2done",
"request": {"method": "PUT","urlPath": "/v1/endpoint"},
"response": {"status": 400},
{
"scenarioName": "API1",
"requiredScenarioState": "test2done",
"newScenarioState": "test3done",
"request": {"method": "PUT","urlPath": "/v1/endpoint"},
"response": {"status": 500}
}
]
}
And I have 3 Different tests, each of which are hitting the same endpoint but expecting different response for their specific testcase.
Thanks
Rishav