racodond / sonar-gherkin-plugin

SonarQube Cucumber Gherkin Analyzer
GNU Lesser General Public License v3.0
36 stars 21 forks source link

False positive on Common Given steps should be added to Background #71

Open tommywo opened 5 years ago

tommywo commented 5 years ago

Background doesn't support examples, so rule shouldn't apply to steps that require parameters.

racodond commented 5 years ago

Hi,

Thanks for your feedback! Just to make sure I fully understand, could you please provide a code sample?

Thank you

David

tommywo commented 5 years ago

Example:

Scenario Outline: 
  Given I log in with user <user> and password <password>
  When some action
  Then some result

  Examples:
    | user   | password |
    | user1  | pass1    |
    | user2  | pass2    |

Scenario Outline: 
  Given I log in with user <user> and password <password>
  When different action
  Then different result

  Examples:
    | user   | password |
    | user3  | pass3    |
    | user4  | pass4    |