Change the conf.js file something like this.
var HtmlReporter = require('protractor-html-screenshot-reporter'); var reporter = new HtmlReporter({ baseDirectory: './protractor-result', // a location to store screen shots. docTitle: 'Protractor Demo Reporter', docName: 'protractor-demo-tests-report.html' }); exports.config = { framework: 'jasmine', seleniumAddress: 'http://localhost:4444/wd/hub', specs: ['invoice.js'], capabilities: { browserName: 'chrome', }, jasmineNodeOpts: { showColors: true, // Use colors in the command line report. }, onPrepare: function() { jasmine.getEnv().addReporter(reporter); } }
Then execute it using the following commander.
npm install protractor-html-screenshot-reporter
Feel free to ask any questions if you do not understand. :)
source share