Closed varsharyalii closed 2 months ago
You can use jmespath assertions like https://github.com/taverntesting/tavern/blob/4396844435a74d0af4c06ca64eb1c15cf02b61ab/tests/integration/test_jmes.tavern.yaml#L215-L225 to do this but for specific situations like this it could also just be easier to write a specific external function to check this case.
Description: Consider a scenario where there is a list of items with quantities, and the goal is to assert the quantity of a specific item in a specific position without triggering a pass due to the presence of the same quantity in another position.
The provided example should only match the quantity of the third item and not inadvertently pass due to the presence of the same quantity elsewhere in the list.
I wish there was someplace I could add !index=2 or something as such This is especially causing a blocker while trying to run negative tests