-
Notifications
You must be signed in to change notification settings - Fork 234
Closed
Description
I'm trying to mix scenarios and parser to prevent repeating step definitions.
For example,
Scenario Outline: Create users
Given I want to create a user
And my 'given_name' is <given_name>
And my 'family_name' is <family_name>
And my 'username' is <username>
When I create the user
Then the user will be created
Examples:
| given_name | family_name | username |
| Tom | Bob | tom.bob |
and the step definition is
@given("my '{attr_name}' is '<attr_value>'")
def build_request(attr_name, attr_value):
# I would expect when attr_name is given_name and attr_value will be Tom
# when attr_name is family_name and attr_value is Bob ...
pass
obviously, it does not work. But I'm wondering if pytest-bdd supports use cases like that. As the user has 10+ attributes, it would be great to not repeat the step definitions.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels