github.com/maps90/godog@v0.7.5-0.20170923143419-0093943021d4/features/outline.feature (about)

     1  Feature: run outline
     2    In order to test application behavior
     3    As a test suite
     4    I need to be able to run outline scenarios
     5  
     6    Scenario: should run a normal outline
     7      Given a feature "normal.feature" file:
     8        """
     9        Feature: outline
    10  
    11          Background:
    12            Given passing step
    13  
    14          Scenario Outline: parse a scenario
    15            Given a feature path "<path>"
    16            When I parse features
    17            Then I should have <num> scenario registered
    18  
    19            Examples:
    20              | path                    | num |
    21              | features/load.feature:6 | 1   |
    22              | features/load.feature:3 | 0   |
    23        """
    24      When I run feature suite
    25      Then the suite should have passed
    26      And the following steps should be passed:
    27        """
    28        a passing step
    29        I parse features
    30        a feature path "features/load.feature:6"
    31        a feature path "features/load.feature:3"
    32        I should have 1 scenario registered
    33        I should have 0 scenario registered
    34        """
    35  
    36    Scenario: should continue through examples on failure
    37      Given a feature "normal.feature" file:
    38        """
    39        Feature: outline
    40  
    41          Background:
    42            Given passing step
    43  
    44          Scenario Outline: parse a scenario
    45            Given a feature path "<path>"
    46            When I parse features
    47            Then I should have <num> scenario registered
    48  
    49            Examples:
    50              | path                    | num |
    51              | features/load.feature:6 | 5   |
    52              | features/load.feature:3 | 0   |
    53        """
    54      When I run feature suite
    55      Then the suite should have failed
    56      And the following steps should be passed:
    57        """
    58        a passing step
    59        I parse features
    60        a feature path "features/load.feature:6"
    61        a feature path "features/load.feature:3"
    62        I should have 0 scenario registered
    63        """
    64      And the following steps should be failed:
    65        """
    66        I should have 5 scenario registered
    67        """
    68  
    69    Scenario: should skip examples on background failure
    70      Given a feature "normal.feature" file:
    71        """
    72        Feature: outline
    73  
    74          Background:
    75            Given a failing step
    76  
    77          Scenario Outline: parse a scenario
    78            Given a feature path "<path>"
    79            When I parse features
    80            Then I should have <num> scenario registered
    81  
    82            Examples:
    83              | path                    | num |
    84              | features/load.feature:6 | 1   |
    85              | features/load.feature:3 | 0   |
    86        """
    87      When I run feature suite
    88      Then the suite should have failed
    89      And the following steps should be skipped:
    90        """
    91        I parse features
    92        a feature path "features/load.feature:6"
    93        a feature path "features/load.feature:3"
    94        I should have 0 scenario registered
    95        I should have 1 scenario registered
    96        """
    97      And the following steps should be failed:
    98        """
    99        a failing step
   100        """
   101  
   102    Scenario: should translate step table body
   103      Given a feature "normal.feature" file:
   104        """
   105        Feature: outline
   106  
   107          Background:
   108            Given I'm listening to suite events
   109  
   110          Scenario Outline: run with events
   111            Given a feature path "<path>"
   112            When I run feature suite
   113            Then these events had to be fired for a number of times:
   114              | BeforeScenario | <scen> |
   115              | BeforeStep     | <step> |
   116  
   117            Examples:
   118              | path                    | scen | step |
   119              | features/load.feature:6 | 1    | 3    |
   120              | features/load.feature   | 6    | 19   |
   121        """
   122      When I run feature suite
   123      Then the suite should have passed
   124      And the following steps should be passed:
   125        """
   126        I'm listening to suite events
   127        I run feature suite
   128        a feature path "features/load.feature:6"
   129        a feature path "features/load.feature"
   130        """
   131  
   132    Scenario Outline: should translate step doc string argument
   133      Given a feature "normal.feature" file:
   134        """
   135        Feature: scenario events
   136  
   137          Background:
   138            Given I'm listening to suite events
   139  
   140          Scenario: run with events
   141            Given a feature path "<path>"
   142            When I run feature suite
   143            Then these events had to be fired for a number of times:
   144              | BeforeScenario | <scen> |
   145        """
   146      When I run feature suite
   147      Then the suite should have passed
   148  
   149      Examples:
   150        | path                    | scen |
   151        | features/load.feature:6 | 1    |
   152        | features/load.feature   | 6    |