Commenting out multiple lines in acceptance test feature

Commenting out multiple lines in acceptance test feature

by Itamar Tzadok -
Number of replies: 0

When writing a long scenario with repeating steps in an acceptance test feature I sometimes want to try only a certain part of the scenario, as running the whole scenario may be time consuming (scenario outlines are not a viable option as they repeat too much). Using # to comment out lines may be tedious. Gherkin doesn't seem to support block comments. I found at  http://stackoverflow.com/questions/7113594/how-to-do-block-comments-in-gherkin, item 7, a suggestion to use PyStrings type comments, which seems to work quite nicely.

So for example, all the steps in the illustration below will be ignored when running the feature.

"""
        When I go to manage dataform "views"
        And I follow "id_editview1"
        And I expand all fieldsets       
        And I fill textarea "Entry template" with "Checkbox 01\nEAC:edit\nEAC:delete"
        And I press "Save changes"
        And I follow "Browse"
        And I follow "id_editentry1"
        And I set the field "CB 01" to "checked"
        And I press "Save"
        Then I should see "CB 01"
...
"""

In this particular scenario I have about 11 50-steps sections and as I'm adding each section I'm commenting out all others (except for the opening section that is needed for all the others) and trying only that part before adding the next sections.

 

smile

 

 

Average of ratings: Useful (2)