[Part-2] Configuring the Postman Collection with Newman Dependencies

In previous blog post, we have exported Postman Collection, which includes our set of requests and tests.

Part-1 Link: https://testingeduindia.blogspot.com/2020/07/running-postman-collections-through.html 

Now, we will navigate to the folder where Postman Collection is saved via command line and create a node project.

Command: npm init




PS: After need to manually press Enter Key on the keyboard, to get information.

This will create package.json




Adding Newman Dependency to Package.json

Command: npm install newman -save



Fixing the Severity Vulnerabilities.



 
This will add "node_modules" folder. We can remove that.


From Package.json, we will remove key-value pairs "main", "license", "homepage"

Note: I have renamed, scripts - "tests" to  scripts - "api-tests"

api-tests: newman run APITesting.postman_collection.json




Save the package.json




Package.json : includes information about how to run the tests and any related dependencies for their execution. (Here: newman)
Postman Collection: contains the API requests and tests we wrote in Postman and exported as Collection.

Popular Posts

JMeter Producing Error: Windows RegCreateKeyEx(...) returned error code 5

Understanding about Contract Testing