Writing Parity API Tests in Postman

Parity Testing

Tests that compare legacy vs non-legacy API contracts (if systems are completely parity systems).

Test #1: Test Legacy Path

// store the responseBody for future comparisons
var oldResponse = postman.setEnvironmentVariable("unique-to-this-test", responseBody);

Test #2: Test Non-Legacy Path

// compare old response with current response
// depending on what you are doing something like the following will be good enough, but this requests the response body's to be exact.

tests['response matches previous'] = (oldResponse === responseBody);