gabrielfalcao/lettuce

An UnboundLocalError is thrown when a Feature uses both a Background: and Scenario Outline

markforster opened this issue · 0 comments

The following example throws the exception:

Feature: Prompt to Signup

    Background:
        Given background for story HUBPHE-22
        And I am in viewing on desktop
        And I am a new Customer

    Scenario Outline: Signed up
        When I am on the products landing area
        And I see and take the action to signup as a <customer_type>
        Then I should be taken to the signup page

    Examples:
        | customer_type |
        | Contractor    |
        | Client        |

Note that If I move the background into the Scenario Outline it works fine. This also worked when I had 2 separated scenarios i.e. before I combined both into a scenario outline.

Edit:

Just wanted to be clear also.. by saying move the background into the scenario outline I mean each step like so :

Feature: Prompt to Signup

    Scenario Outline: Signed up
        Given background for story HUBPHE-22
        And I am in viewing on desktop
        And I am a new Customer
        When I am on the products landing area
        And I see and take the action to signup as a <customer_type>
        Then I should be taken to the signup page

    Examples:
        | customer_type |
        | Contractor    |
        | Client        |

Edit :

Guessing its indirectly related (or possibly) to the work that is planned here #428 so guessing that maybe currently background is not supported with Scenario Outlines?