/api-tests-postman

Postman collections with tests for Public APIs (REST and SOAP)

Primary LanguageHTML

Setup

  1. Download and install postman

  2. Import collections from this repo

  3. Download and install node.js

  4. Install newman from cmd:

npm install -g newman

Decided to use environment variables because:

  • global variables have lower precedence and can be overridden by environment variables
  • seems more natural to use --environment option when running collection using newman
  1. Install newman-reporter-htmlextra from cmd:
npm install -g newman-reporter-htmlextra

APIs used

REST

SOAP

Tools

Postman

Run collection with tests for BookCart API using Postman UI:

Run tests from a collection

newman run <collection_name.json> -e <environment_file.json>

Run tests from a collection and generate html report

newman run <collection_name.json> -e <environment_file.json> -r htmlextra

Run collection with tests for Library API using newman

Readings