API Testing/Monitoring NODEjs/GRAPHQL in deployed sites in CI/CD

Lee Blazek

BERZERK Interactive

www.berzerk.io

Today:

  • What is Postman?
  • What is Newman?
  • Running Newman in CI/CD
  • Running Newman as a monitor API's reporting back
  • Postmans online features

Postman

API Client(GUI)

Quickly and easily send REST, SOAP, and GraphQL requests directly within Postman.

 

Write: calls, collections, tests, env

https://www.postman.com/

NEwman

CLI (command line)

Run collections, tests, etc made with the GUI

 

Made with node.js

 

https://learning.postman.com/docs/postman/collection-runs/command-line-integration-with-newman/

Postman

API Client(GUI)

Quickly and easily send REST, SOAP, and GraphQL requests directly within Postman

😐
1
  1. network calls
  2. pre-request scripts
  3. tests
  4. set variables in environments
  5. use authentication

newman

CLI (COMMAND LINE)

Run collections, tests, etc made with the GUI

😐
1
  1. run every thing generated by GUI
  2. return pass/fail output(0 or 1)
  3. Generate reports
    1. text
    2. json
    3. html
    4. markdown
    5. junit
  4. post run task like post to slack

GUI screen share..

NEWMan screen share..

Newman in CI/cd

  • Make sure your tests/envs are updated/exported with git commit that is being run (Postman does not auto export changes)
  • make sure the mahcine running tests waits for server to start before running tests
  • you may need different env file for ci/cd or set env vars like urls/ports on command line params
  • choose report type usually all ways with cli reporting
  • run post run tasks like report to slack, hipchat channels

Newman in Monitoring

  • depends on your cloud or on site machines
  • AWS ec2 instances
  • heroku
  • usually set you ci/cd to update the cloud machine on a deploy

ONline services

  • publish docs
  • publish collections and envs
  • monitor

Where to go from here

BERZERK

Lee blazek

SME Javascript, Angular, React, Vue, NodeJS, all things in the browser

 

https://www.linkedin.com/in/leeblazek/

API Testing

By Lee Blazek

API Testing

API Testing/Monitoring NODEjs/GRAPHQL in deployed sites in CI/CD

  • 339