Execute Postman Collection\Folder within a unit test


I have a collection in postman that I would like to integrate into my unit tests. Is there a way to do this with postman\Newman or another library?

@drummondst I have done something similar actually.
What I have done is for all my micro services, I have a maven module that contains both a collection and env templates for my supported envs.
Then I have a shell script in there as well that basically pulls down the docker image and runs the collection against the env that I pass in as an argument.

Then to take that a step further we have tied this into our CI/CD pipeline with a Jenkinsfile and then when we make a commit or merge, it executes these tests at each stage. If at any point it fails, the build fails and everything stops.

Hopefully this helps, I can try to provide you more info if needed.

1 Like