protractor-jasmine2-html-reporter doesn't create html report

547 Views Asked by At

I have the following configuration in protractor config.js, but it is generating only the screenshots in the specified folder not the HTML report.

I have gone through the steps followed here

https://www.npmjs.com/package/protractor-jasmine2-html-reporter

var Jasmine2HtmlReporter = require('protractor-jasmine2-html-reporter'); 

onPrepare() {

    jasmine.getEnv().addReporter(new Jasmine2HtmlReporter({
            savePath: './test/reports/',
            fileName: 'MyReportName'
        }));
  }

Can someone specify where I'm missing or is there any version specific issue?

I'm using Protractor Version 5.2.0, Node v6.11.2

2

There are 2 best solutions below

0
On BEST ANSWER

I have issues with spec file which is causing the html report generation.

If we didn't provide expect and finish the it function, html report is not generating.

Always expect is mandatory

0
On

I'm using protractor-html-reporter, provides pie charts also and is way better than protractor jasmine2html reporter.