App is related to an f&b business, I have following scenarios (api calls):
- Create Order - on creating an order of any food item (let it be X), inventory of which is updated at back-end (this value is under test, let it be P1)
- Get Inventory - (this call will fetch me the updated value of inventory of ordered item (X) i.e. inventory value, P1)
- Cancel Order - this will cancel the order, i created in my first call, and hence P1 should be rolled back.
- Get Inventory - Again i will hit this call to get the value, so as to verify that the inventory value of P1 has been updated properly.
In API call, (2) I extract P1 value using jp@gc Json Extractor and same I did for same call (4). Now as per my expectations, value obtained in both these extractors should be equal as order has been cancelled now.
To assert these values, I am using JSON Assertion , either I am making use of wrong assertion or lacking a big amount of information here.
May be there is something like I can save the value first in some variable, and then assert.