Adding parameters to features file

29 views
Skip to first unread message

Juan Pablo Volpintesta

unread,
Nov 14, 2014, 7:26:30 AM11/14/14
to lettuc...@googlegroups.com
Hi,

I was wondering if there was any way to parametrize the features file, something like, having this scenario outline:

Given I open <URL>
When I click <button>
Then I should see <result>

|  URL  |  button  |  result  |
|  urlA  | buttonA | resultA |
|  urlB  | buttonB | resultB |
|  urlC  | buttonC | resultC |
|  urlD  | buttonD | resultD |
|  urlE  | buttonE | resultE |


Being able to say "run this ONLY for urlA/buttonA/resultA" or maybe for A and D, on execution time... maybe with a command line parameter?

Please let me know if I'm not clear enough.

Cheers!

jenisys

unread,
Dec 24, 2014, 12:02:33 PM12/24/14
to lettuc...@googlegroups.com
Normally, you would such a selection by using (active) tags.
In behave, you can add your example tables parameters to the title of the scenario outline.
Therefore, each Scenario instance of the scenario outline has its own specific name.
This name can then be selected on the command-line ("select scenario by name" (part)).

But I am not quite sure if this concept is support by lettuce.

I hope that helps you.

Cheers,
Jens

EXAMPLE:

  Scenario Outline: With <URL>, button <button> and result <result>
    Given I open <URL>
    When I click <button>
    Then I should see <result>

    Examples:
Reply all
Reply to author
Forward
0 new messages