Postman Collection
The attached postman collection makes use of variables so that it can be considered environment-agnostic.
These variables are:
{{bearerToken}}{{baseUrl}}
We recommend executing the postman collection as a batch using Newman.
Newman is the command-line runner for Postman collections. It allows a Postman collection to be executed outside of the Postman UI, making it useful for automated API testing, regression testing, and integration with build or CI/CD pipelines.
Collections can be parameterized using Postman variables (for example, {{baseUrl}} and {{bearerToken}}) instead of hardcoded values. Variable values are then supplied at runtime using command-line arguments or an environment file, allowing the same collection to be executed against different environments without modification.
The alternative to Newman is to find/replace in the json file then import the collection into your Postman application.
Windows install and usage guide for Newman:
# Install newman
npm install -g newman
# verify
newman -v
# navigate to directory with postman collection
cd <your working directory>
# execute postman collection unit tests for CA PRD
newman run "postman_collection.WebApi.v2.0_unit_tests_1.json" `
--env-var baseUrl=https://query.ampre.ca `
--env-var bearerToken=<your token value here>