pytest-bdd
pytest-bdd copied to clipboard
Scenario Outline to select examples based on user arguments?
Scenario outline has multiple example tables with env1,env2,2nv3 etc. Is there any way to collect only Examples: env1 out of other Examples when user passes the argument env1. Basically the details are different among environments, so I cant use the markers as well. As markers on one example table might not work on another.
@Validate
Scenario Outline: Test to be executed in multiple env
Given the
Examples: env1 |username|password| |aa|nn|
Examples: env2 |username|password| |aaq|nna|
Examples: env3 |username|password| |aaa|n1n|
When I run pytest, I pass pytest --env=env1. Here I would like my pytest to execute only env1 examples.
I have following options
- to place individual markers to each and run
- to add new column and verify
Wondering if we have any good/reasonable approach.
Regards, Tom.