Neverending Package Mountain
Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

newman-reporter-htmlextra

1.3.1 • Public • Published

newman-reporter-htmlextra

Build Status NPM Version NPM Downloads Dependencies

A newman HTML reporter that has been extended to include the separation of the iteration runs so these are no longer aggregated together and also some additional handlebars helpers. There is also a default template that can be used to show the different changes, such as the Skipped Tests - This can be seen in all the example images.


This work have been hugely inspired and copied several aspects of the great work done by Martijn Vander Vlag to create the newman-reporter-htmlfull package. Check out that package too, this contains many of the same features.

Some of the Extras

  • Full separated iterations runs and not aggregated stats - Default template shows iteration number in heading
  • Includes the full handlebars-helpers module for building better templates
  • New percent helper to help exposing data like Test Pass Percentage - e.g {{percent cumulativeTests.passed cumulativeTests.failed}}
  • Copy and Paste any of the Response Bodies
  • Includes an inc helper to work with things like the handlebars zero index - e.g Iteration:{{inc cursor.iteration}} - {{item.name}}
  • Added the helper-moment module so you have more control over the display dates - e.g {{moment date format="dddd, DD MMMM YYYY HH:mm:ss"}}
  • Exposed the Skipped Tests so you can tell which ones are skipped, in the main summary view. You can also see which tests are skipped within the single request view
  • Folder level descriptions with rendered Markdown syntax
  • Iterations separated by tabs in the Requests view
  • More to come...

Example Report Images

Dashboard Template

Request View Iterations

Request View

Failed View

Skipped View

Install

The installation should be global if newman is installed globally, local otherwise. (Replace -g from the command below with -S for a local installation)

npm install -g newman-reporter-htmlextra

Usage

In order to enable this reporter, specify htmlextra in Newman's -r or --reporters option.

newman run https://www.getpostman.com/collections/631643-f695cab7-6878-eb55-7943-ad88e1ccfd65-JsLv -r htmlextra

Options

With Newman CLI

CLI Option Description
--reporter-htmlextra-export <path> Specify a path where the output HTML file will be written to disk. If not specified, the file will be written to newman/ in the current working directory.
--reporter-htmlextra-template <path> Specify a path to the custom template which will be used to render the HTML report. This option depends on --reporter htmlextra and --reporter-htmlextra-export being present in the run command. If this option is not specified, the default template is used

Custom templates (currently handlebars only) can be passed to the HTML reporter via --reporter-htmlextra-template <path> with --reporters htmlextra and --reporter-htmlextra-export. The default template is used in all other cases.

With Newman as a Library

The CLI functionality is available for programmatic use as well.

const newman = require('newman');
 
newman.run({
    collection: require('./examples/Restful_Booker_Collection.json'), // can also provide a URL or path to a local JSON file.
    environment: require('./examples/Restful_Booker_Environment.json'),
    reporters: 'htmlextra',
    reporter: {
        htmlextra: {
            export: './<html file path>', // If not specified, the file will be written to `newman/` in the current working directory.
            template: '<template path>' // optional, the default template will be used if one is not specified 
        }
    }
}, function (err) {
    if (err) { throw err; }
    console.log('collection run complete!');
});

Compatibility

newman-reporter-htmlextra newman node
>= v1.1.0 >= v4.2.3 >= v8.x

Community Support

Community Image

If you are interested in talking to the Postman team and fellow Newman users, you can find us on our Postman Community Forum. Feel free to drop by and say hello. You'll find us posting about upcoming features and beta releases, answering technical support questions, and contemplating world peace.

Sign in using your Postman account to participate in the discussions and don't forget to take advantage of the search bar - the answer to your question might already be waiting for you! Don’t want to log in? Then lurk on the side-lines and absorb all the knowledge.

License

This software is licensed under Apache-2.0. Copyright Postdot Technologies, Inc. See the LICENSE.md file for more information.

install

npm i newman-reporter-htmlextra

Downloadsweekly downloads

417

version

1.3.1

license

Apache-2.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability