pytest-bdd icon indicating copy to clipboard operation
pytest-bdd copied to clipboard

ScenarioExamplesNotValidError "Set of step parameters (...) should match set of example values (...)" should be a warning, not error

Open pfctdayelise opened this issue 6 years ago • 1 comments
trafficstars

I wanted to write a scenario outline like so:

  Scenario Outline: Assemble order - delivery types
    Given An order has been placed
    And the customer has chosen <type> delivery
    When the order is assembled
    Then the courier label states the order is <type> delivery

    Examples:
    | name     | label          | type     | 
    | Express  | TESTCASE-36230 | express  |
    | Standard | TESTCASE-36231 | standard |

Name and label are not used in the test steps, I agree it is worthy of a warning, but I don't believe it is outright wrong for Gherkin syntax. (Based on gherkin-lint)

I can probably add a null step that uses the parameters to make the error go away, but it's not so nice.

pfctdayelise avatar May 02 '19 04:05 pfctdayelise

It is valid Gherkin; Cucumber would handle this without any problem. It is worth a warning - in my experience, adding unused columns to an Examples table rarely increases the clarity of the requirement. The whole point of using Gherkin is clarity of requirements.

The-QA-Geek avatar Jul 18 '19 15:07 The-QA-Geek