Skip to content

orangebeard-io/postman-listener

Repository files navigation

Orangebeard.io postman Listener
Orangebeard.io postman Listener

Orangebeard listener for Newman (Postman CLI).)

NPM Version Build Status License

Installation

Install the npm package

npm install @orangebeard-io/newman-reporter-orangebeard

Configuration

Create orangebeard.json (in your collection's folder (or above))

{
	"endpoint": "https://XXX.orangebeard.app",
	"accessToken": "00000000-0000-0000-0000-00000000",
	"project": "my_project_name",
	"testset": "My Test Set Name"
}

Running

From the command line:

newman run ./postman-collection.json -r @orangebeard-io/orangebeard

Or configure using the CLI (without orangebeard.json):

newman run ./collection.json -r @orangebeard-io/orangebeard \
--reporter-@orangebeard-io/orangebeard-endpoint=https://my.orangebeard.app \
--reporter-@orangebeard-io/orangebeard-token=00000000-0000-0000-00000000 \
--reporter-@orangebeard-io/orangebeard-testset=testset_name \
--reporter-@orangebeard-io/orangebeard-project=project_name \
--reporter-@orangebeard-io/orangebeard-description=description \
--reporter-@orangebeard-io/orangebeard-attributes=key:value;secondkey:secondvalue;singleTag

Note: Description and attributes are optional.

Or programmatically:

const newman = require('newman');

newman.run(
  {
    collection: './collection.json',
    reporters: '@orangebeard-io/orangebeard',
    reporter: {
      '@orangebeard-io/orangebeard': {
        endpoint: 'https://my.orangebeard.app',
        token: '00000000-0000-0000-0000-000000000000',
        testset: 'testset_name',
        project: 'project_name',
        description: 'description',
        attributes: [
          {
            key: 'key',
            value: 'val',
          },
          {
            value: 'singleTag',
          },
        ],
      },
    },
  },
  function (err) {
    if (err) {
      throw err;
    }
    console.log('collection run complete!');
  },
);