lundi 19 octobre 2020

How to test and compare previous value and new value in postman?

I'm currently testing API requests. I'm dealing with a small problem. Let's say I own a /Balance request. Let's say my current balance is 10. I have made another request to my API to spend some of my balance and now it's 8. How can I check through postman testing if my API value has changed from 10 to 8. How can I let

``
pm.test("Chechking clients balance ", function () {
let  balance = pm.response.json();
pm.expect(balance.BTC).to.eql(balance.BTC);
})
``

How do I find that previous balance before transaction?

Aucun commentaire:

Enregistrer un commentaire