Skip to content

misiekofski/newman-as-node-module

Repository files navigation

Newman as Node module:

Some examples for newman runner below

Instructions for install

  • Clone this repository
  • Install https://nodejs.org/en/
  • Run npm install from main folder (it requires package.json)

Normal usage (not as node module)

After npm install -g newman you can run newman run collections/sample-collection.json -r cli,junit

But of course, you can create your own testing framework with nodejs

Sample scripts:

  • dev-run-collection.js is a module which runs collection with some options, and then connects to DB and clears test data
  • test-run-collection.js is a module which runs collection with some other options, and then connects to DB and clears test data
  • run-collection-multipletimes.js is a module which runs collection async 100 times (in parallel, so it can be used as load tests)
  • run-collections-from-folder.js is a module which runs all collections from a given folder

Structure:

  • use /collections to export tests created in postman
  • use /envs/ to export environment settings and variables created in postman
  • use /templates to store your own modified templates for html reports
  • reports will be created in /reports folder which is ignored by this git repository

About

Run API tests from Postman with Newman as npm module

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published