Setting up contract tests in Postman
Creating contract tests is similar to creating any other API test: you need to create a collection and then make requests in that collection with tests in them. But what kind of tests do you create when you perform contract testing?
The idea of contract tests is to describe all the different parts of the API that you need, but not to do things such as look at how to use them in a workflow or other aspects of testing. Contract tests are a good way to set the minimum bar for what needs to be working, but you will need to do additional testing beyond them for it to be effective. Of course, as with any other testing that’s done in Postman, you will need to create a collection for your contract tests.
Creating a contract testing collection
Any collection can be used for contract testing, but if you start from an API specification, Postman provides some nice shortcuts for you. In Chapter 3, we made an OpenAPI specification file and...