protractor-html-hierarchical-reporter

1.6.0 • Public • Published

protractor-html-hierarchical-reporter

HTML reporter for Jasmine2 and Protractor that will include screenshots of each test if you want and display suits hierarchically.

Usage

The protractor-html-hierarchical-reporter is available via npm:

$ npm install protractor-html-hierarchical-reporter --save-dev

In your Protractor configuration file, register protractor-html-hierarchical-reporter in jasmine:

var HierarchicalHTMLReporter = require('protractor-html-hierarchical-reporter');

exports.config = {
   // ...
   onPrepare: function() {
      jasmine.getEnv().addReporter(
        new HierarchicalHTMLReporter({
          savePath: 'target/screenshots'
        })
      );
   }
}

Options

Destination folder

Output directory for created files. All screenshots and reports will be stored here.

If the directory doesn't exist, it will be created automatically or otherwise cleaned before running the test suite.

jasmine.getEnv().addReporter(new HierarchicalHTMLReporter({
   savePath: './test/reports/'
}));

Default folder: ./

Screenshots folder (optional)

By default the screenshots are stored in a folder inside the default path

If the directory doesn't exist, it will be created automatically or otherwise cleaned before running the test suite.

jasmine.getEnv().addReporter(new HierarchicalHTMLReporter({
   savePath: './test/reports/',
   screenshotsFolder: 'images'
}));

Default folder: screenshots

Take screenshots (optional)

When this option is enabled, reporter will create screenshots for specs.

jasmine.getEnv().addReporter(new HierarchicalHTMLReporter({
   takeScreenshots: false
}));

Default is true

Take screenshots only on failure (optional) - (NEW)

This option allows you to choose if create screenshots always or only when failures. If you disable screenshots, obviously this option will not be taken into account.

jasmine.getEnv().addReporter(new HierarchicalHTMLReporter({
   takeScreenshots: true,
   takeScreenshotsOnlyOnFailures: true
}));

Default is false (So screenshots are always generated)

FilePrefix (optional)

Filename for html report.

jasmine.getEnv().addReporter(new HierarchicalHTMLReporter({
   savePath: './test/reports/',
   filePrefix: 'index'
}));

Default is htmlReport.html

Package Sidebar

Install

npm i protractor-html-hierarchical-reporter

Weekly Downloads

2

Version

1.6.0

License

ISC

Last publish

Collaborators

  • valeryiak