Search code examples
cucumber-jvm

Using Scenario Outline and Examples with Strings


I'm facing the following "issue" when trying out cucumber-jvm with an Arabic to Roman Numeral converter - the "then" piece gets converted into several step defs instead of one. here's my scenario outline:

Scenario Outline:
Given a romanizer
When I romanize <arabic number>
Then I get the <roman numeral>

Examples:
| arabic number | roman numeral |
|             1 |             I |
|             2 |            II |
|             3 |           III |
|             4 |            IV |
|             5 |             V |
|             6 |            VI |
|             7 |           VII |
|             8 |          VIII |
|             9 |            IX |
|            10 |             X |

For this, i was expecting the then stepdef to simply be:

I_get_the(String value)

but instead it turns it into one stepdef for each example:

I_get_the_I()
I_get_the_II()

etc. what am i doing wrong? Thanks, Nilesh


Solution

  • use (note the double quotes)

    Scenario Outline:
      Given a romanizer
      When I romanize "<arabic number>"
      Then I get the "<roman numeral>"