Protractor Cucumber HTML Report

Behavior-Driven Development helps us to test behaviors instead of implementations. We can use any BDD framework to follow Behavior-Driven Development. Generating HTML report after BDD scenarios execution is an important feature, and it helps to publish BDD result in a readable format. In this blog post, we will show you how to generate HTML report using Protractor and Cucumber.

Configure Cucumber JSON format in conf.js

Protractor Configuration File

Installing grunt-protractor-cucumber-html-report plugin

Install grunt-protractor-cucumber-HTML-report plugin locally using the below command.

Create protractor-cucumber-html-report task in Gruntfile.js

Sample Gruntfile.js with grunt-protractor-runner and protractor-cucumber-html-report tasks

Run registered Grunt tasks

This command executes the default tasks which are registered in Gruntfile.js

View your report

Once the Grunt tasks complete, you can see the HTML report in reports folder as mentioned in Gruntfile.js Folder Structure Protractorc Cucumber Project Structure Example Protractorc Cucumber HTML Report

3 thoughts on “Protractor Cucumber HTML Report

  1. Awesome. I am new to Protractor, CucumberJS, Javascript, grunt etc., But using this information in this page, I am able to generate report in less than 10 mins.
    Great Post! Thanks a lot!

  2. Sorry, i can not run the command grunt default –cucumberOpts={\”tags\”:\”@smoke\”}, in the terminal says: “The term ‘grunt’ is not recognized as the name of a cmdlet.
    Can you help me?

Leave a Reply

Your email address will not be published. Required fields are marked *