github.com/DATA-dog/godog@v0.7.9/features/background.feature (about)

     1  Feature: run background
     2    In order to test application behavior
     3    As a test suite
     4    I need to be able to run background correctly
     5  
     6    Scenario: should run background steps
     7      Given a feature "normal.feature" file:
     8        """
     9        Feature: with background
    10  
    11          Background:
    12            Given a feature path "features/load.feature:6"
    13  
    14          Scenario: parse a scenario
    15            When I parse features
    16            Then I should have 1 scenario registered
    17        """
    18      When I run feature suite
    19      Then the suite should have passed
    20      And the following steps should be passed:
    21        """
    22        a feature path "features/load.feature:6"
    23        I parse features
    24        I should have 1 scenario registered
    25        """
    26  
    27    Scenario: should skip all consequent steps on failure
    28      Given a feature "normal.feature" file:
    29        """
    30        Feature: with background
    31  
    32          Background:
    33            Given a failing step
    34            And a feature path "features/load.feature:6"
    35  
    36          Scenario: parse a scenario
    37            When I parse features
    38            Then I should have 1 scenario registered
    39        """
    40      When I run feature suite
    41      Then the suite should have failed
    42      And the following steps should be failed:
    43        """
    44        a failing step
    45        """
    46      And the following steps should be skipped:
    47        """
    48        a feature path "features/load.feature:6"
    49        I parse features
    50        I should have 1 scenario registered
    51        """
    52  
    53    Scenario: should continue undefined steps
    54      Given a feature "normal.feature" file:
    55        """
    56        Feature: with background
    57  
    58          Background:
    59            Given an undefined step
    60  
    61          Scenario: parse a scenario
    62            When I do undefined action
    63            Then I should have 1 scenario registered
    64        """
    65      When I run feature suite
    66      Then the suite should have passed
    67      And the following steps should be undefined:
    68        """
    69        an undefined step
    70        I do undefined action
    71        """
    72      And the following steps should be skipped:
    73        """
    74        I should have 1 scenario registered
    75        """