Cucumber HTML Report

Profile picture for user devraj

You must be wondering that all we have seen above is actually good for a test or for a couple of tests. But if we run a full test suite, this report is not much useful in that case. On top of that, it is difficult to keep these console output safe for future use.

Pretty format generate the Cucumber test report in the HTML format. It is the most readable report format. You can specify location of report to local or server.

It display Pass, Failed and skipped steps with different colours. It also display error from stack trace.

However, Basic HTML report does not display summary report like how many scenario and steps has been executed and how many of them pass or fail.

For HTML reports, add below line which start with with plugin to you JUnit Runner class:

		plugin = {"pretty", "html:target/cucumber"},
		features = {"src/test/resources/features"},

Here target/cucumber is a folder where your HTML report will be stored with name index.html.

Consider Below Feature file

Feature: Registration, Login and MyAccount

    Given I am on the homepage
    And I follow "Sign in"

  @regression @testing
  Scenario Outline: Verify Login Functionality
    And I fill "email address" with "<email>"
    And I fill "password1" with "<password>"
    And I click "sign in"
    Then I should see "<heading>" heading

      | email                     | password | heading         |
      | | test1234 | MY ACCOUNT      |
      | wrongusername             | test     | AUTHENTICATION1 |

And below portion of HTML Report after execution of above Scenario outline

cucumber html reporting

Here Passed Steps coloured with Green and failed with Red. Sky blue colour is for skipped scenarios. You can also see error is also displayed.