gabrielfalcao/lettuce

Background steps are not counted in the summary

brusco opened this issue · 0 comments

Example of the Cucumber output:

Feature: With Header
  In order to test backgrounds
  As lettuce maintainer
  I want to make sure it works with headers

  Background:
    Given the variable "X" holds 2

  Scenario: multiplication changing the value
    Given the variable "X" is equal to 2
    When the variable "X" holds 10
    Then the variable "X" times 5 is equal to 50
    And the variable "X" is equal to 10

  Scenario: multiplication with value set from background
    Given the variable "X" is equal to 2
    Then the variable "X" times 5 is equal to 10
    And the variable "X" is equal to 2

2 scenarios (2 passed)
9 steps (9 passed)
0m0.014s

"9 steps passed" = 7 steps from the scenarios + 2 background steps (1 per each scenario).

Lettuce output for the same feature (the new parser):

Feature: With Header
  In order to test backgrounds
  As lettuce maintainer
  I want to make sure it works with headers

  #1
  Scenario: multiplication changing the value

  Background:
    Given the variable "X" holds 2

  Scenario:
    Given the variable "X" is equal to 2
    When the variable "X" holds 10
    Then the variable "X" times 5 is equal to 50
    And the variable "X" is equal to 10

  ----------------------------------------------------------------------------

  #2
  Scenario: multiplication with value set from background

  Background:
    Given the variable "X" holds 2

  Scenario:
    Given the variable "X" is equal to 2
    Then the variable "X" times 5 is equal to 10
    And the variable "X" is equal to 2

  ----------------------------------------------------------------------------

1 feature (1 passed)
2 scenarios (2 passed)
7 steps (7 passed)

Only the 7 steps from the scenarios in the summary.
The background steps should be taken into account as well.