Feature: Happy HTML reporting

In order to review cucumber reports
Fred, a cucumber user
Wants to have cucumber reports in HTML

Scenario: Fred wants to see passing scenarios in the HTML report

Before

Before


Tests INFO will print here.
To attach INFO to Any steps, use scenario.attach function in your step definitions as shown below.

If you pass HTML's to scenario.attach then reporter will format accordingly

Simple String : scenario.attach('sample data')
Pretty JSON : scenario.attach(JSON.stringify(json, null, 2))
HTML Link : scenario.attach('format the link with html-a tag'

When this feature runs with background

Given Fred runs a passing cucumber scenario

When he provides cucumber JSON file to reporter

Then cucumber-html-reporter should create HTML report

After

Scenario: Fred runs scenario outline for John and print on HTML report

Before

When this feature runs with background

Given Fred runs a passing cucumber scenario on behalf of "John"

When he provides cucumber JSON file to reporter

Then cucumber-html-reporter should create HTML report

Scenario: Fred runs scenario outline for Bob and print on HTML report

Before

When this feature runs with background

Given Fred runs a passing cucumber scenario on behalf of "Bob"

When he provides cucumber JSON file to reporter

Then cucumber-html-reporter should create HTML report

Scenario: Fred wants to print test data in the HTML reports for debugging purpose

Before

When this feature runs with background

Given Fred attaches the "test data to be printed" to the Given step of passing cucumber scenario


test data to be printed
{ "name": "cucumber-html-reporter", "format": "html" }

When he provides cucumber JSON file to reporter

Then cucumber-html-reporter should create HTML report with test-data

Scenario: Fred wants see the long doc string attached in the HTML report

Before

When this feature runs with background

Given Fred runs a passing cucumber scenario with the below content

When he provides cucumber JSON file to reporter

Then cucumber-html-reporter should create HTML report

Scenario: Fred wants to use data table and print on HTML report

Before

When this feature runs with background

Given Fred runs a passing scenario for the following data set

When he provides cucumber JSON file to reporter

Then cucumber-html-reporter should create HTML report with data-table

Feature: Unhappy HTML reporting

Scenario: Fred wants to see a Screenshot attached to the HTML report

Before

Given Fred runs a failing cucumber scenario

When he provides cucumber JSON file to reporter

And a failing scenario captures a screenshot Screenshot -

Then cucumber-html-reporter should create HTML report with Screenshot

Scenario: Fred wants to see if steps are pending in the HTML report

Before

Given Fred runs a cucumber scenario

When he left this step as a pending

Then cucumber-html-reporter should report pending step with code-snippets in HTML report

Scenario: Fred wants to see if steps are undefined on the HTML report

Before

Given Fred runs a cucumber scenario

When he left this step as a undefined

Then cucumber-html-reporter should create undefined step in HTML report

Scenario: Fred wants to see if steps are skipped on the HTML report

Before

Given Fred runs a cucumber scenario

When he throws the pending exception from this step

Then cucumber-html-reporter should create HTML report with skipped and pending steps