2

After add line resultJsonOutputFile: 'report.json', to config file and run my test in Webstorm, there is a report.json created but there is no content on it. I don't know what's the reason.

Please help me to expland why my report.json has no content? And how to generate Html report for my test?

Luasg
  • 93
  • 1
  • 11
  • You might want to have a look at [Serenity/JS](http://serenity-js.org), which can compliment your current Protractor/Cucumber setup to generate illustrated HTML reports automatically - [see this answer for instructions](http://stackoverflow.com/questions/34821016/is-there-a-protractor-reporting-tool-that-works-with-a-cucumber-framework/42598696#42598696) – Jan Molak Mar 04 '17 at 17:20

1 Answers1

1

Use cucumber-html-report You might want to have a look at this:

https://stackoverflow.com/a/33739439/790950

Make sure you add the code snippet to your features/support/hooks.js file and also load that file as part of your protractor.conf file:

cucumberOpts: {
    require: [
      '../e2e/features/**/steps/*.js',
      '../e2e/features/support/hooks.js',
    ],
    format: 'pretty',
  },

Notice that you don't have to change the console format as it does it dynamically. Also adds screenshots in case of failures.

Community
  • 1
  • 1
vivascau
  • 604
  • 4
  • 12