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

[Total: 3    Average: 5/5]