# Integration Testing

The KGrid Team does both manual and automated Integration Testing of KO Services. We currently use a combination of Postman (opens new window) and Newman (opens new window)

# Postman

Postman is a great tool when trying to slice and dice RESTful APIs. It helps in creating, editing and testing APIs. Please review our short demonstration of the KGrid Teams dive into Postman (opens new window).

KGrid Team's KO collections use Postman in their Integration Testing

# Newman

Newman (opens new window) is a command line Collection Runner for Postman.

For KO Service Integration Testing the KGrid Team develops some packing scripting to handle the process. The following process comes from the Opioid Collection (opens new window).

  1. A start script will download an KGid Activator if needed and start the activator pointing to the collection of KOs
  2. The test:integration calls the start script and waits for the KGrid activator to come online, when it does it call the postman script
  3. The postman script runs a newman command using the Postman collection

This is a snipped of the package.json in the Opioid Collection (opens new window)

...
  "scripts": {
    "package": "scripty",
    "start": "node scripts/start.js",
    "test:unit": "jest --passWithNoTests --ci --reporters=default --reporters=jest-junit",
    "test:integration": "server-test :8080 postman",
    "postman": "newman run tests/integration/opioid.postman_collection.json -e tests/integration/activator.postman_environment.json --reporters  cli,junit --reporter-junit-export test_results ",
    "test": "npm run test:unit && npm run test:integration"
  }

Last Updated: 4/19/2021, 8:13:50 PM