Newman is a tool that automates the execution of Postman requests from the command line, which will quickly allow us to integrate it into a CI/CD pipeline.
To simplify its integration into a pipeline, we go to the first step in the directory that contains the JSON files that were exported from Postman, and create an npm configuration file—package.json.
This will have the following content:
{
"name": "postman",
"version": "1.0.0",
"description": "postmanrestapi",
"scripts": {
"testapilocal": "newman run DemoBook.postman_collection.json -e Local.postman_environment.json -r junit,cli --reporter-junit-export result-tests-local.xml",
"testapiQA": "newman run DemoBook.postman_collection.json -e QA.postman_environment...