I am attempting to write tests in Postman for the first time. I am using the pm.test
method containing pm.expect
.
Here is my test:
//contract details tests
pm.test("Contract data is correct", function() {
pm.expect(pm.response.json().results.contractNb).to.equal("00002");
pm.expect(pm.response.json().results.progSrvcNm).to.equal("009");
});
My response appears like so:
{
"contractNb": "00002",
"progSrvcNm": "009",
"contractPartyNm": "testContract",
"terms": 30,
"startDt": "2018-01-01"
}