Hello, guys! How I can solve this: In my test, I check the response body like this:
pm.test("Should have correct response body", function () {
var expectedJson = JSON.parse(expectedBody);
var keys = Object.keys(expectedJson);
var jsonData = pm.response.json();
keys.forEach(key => pm.expect(jsonData[key]).to.eql(expectedJson[key], "Wrong value for " +
key));
});
But if I have a mismatch in value in the array I have a message where output only name of the array where was a mistake: Should have a correct response body
AssertionError: Wrong value for filterDataUi: expected { Object (locations, types, ...) } to deeply equal { Object (locations, types, ...) } ,
but I want to see here the name of key and value where was incorrect value.
For example :
AssertionError: Wrong value for batteries: expected '0.0 kWh' to deeply equal '0.1 kWh' .
It doesn’t work with arrays