Shyam Rajan K
Shyam Rajan K

Reputation: 59

How to run the same feature file multiple times with different data (language) set for every new run in Cucumber JVM

My case in Cucumber JVM,I need to run the entire "case.feature" file with 5 Scenarios set on Language 1, Locale 1 first time,and then run the same entire "case.feature" set on Language 2, Locale 2 second time ,is there a way to set this up ?

Example:

  1. Language 1 > English, Locale 1 > English (United States)
  2. Language 2 > Deutsch, Locale 2 > Deutsch

Upvotes: 4

Views: 2861

Answers (1)

selva
selva

Reputation: 1175

Use Scenario Outlines in cucumber in which the input you want can be in table format as shown below.

Scenario Outline: eating
  Given there are <start> cucumbers
  When I eat <eat> cucumbers
  Then I should have <left> cucumbers

  Examples:
    | start | eat | left |
    |  12   |  5  |  7   |
    |  20   |  5  |  15  |

Upvotes: 1

Related Questions