I’m currently working on a project that needs to regularly test our API before pushing into production. I see Postman offers the ability to add this to your CI/CD pipeline. Does anyone have any solid online examples for best practices?
What we do on my team is run newman as a step in the pipeline.
We parameterize the collection and environment ids in the pipeline and just have it run. The command looks like this:
newman run https://api.getpostman.com/collections/$POSTMAN_COLLECTION_ID?apikey=$POSTMAN_API_KEY --environment https://api.getpostman.com/environments/$POSTMAN_ENV_ID?apikey=$POSTMAN_API_KEY
If any tests fail, it causes the build to fail.