As the title suggests, I wish to run some certain configuration / environment setup steps before a scenario outline. I know there is Background
to do this for scenarios, but Behave splits a scenario outline into multiple scenarios and thus runs the background for every input in the scenario outline.
This is not what I want. For certain reasons I cannot provide the code I am working with however I will write up an example feature file.
Background: Power up module and connect
Given the module is powered up
And I have a valid USB connection
Scenario Outline: Example
When I read the arduino
Then I get some <'output'>
Example: Outputs
| 'output' |
| Hi |
| No |
| Yes |
What would happen in this case is Behave would power cycle and check USB connection for each output Hi
, No
, Yes
resulting in three power cycles and three connection checks
What I want is for Behave to power cycle once and check the connection once and then run all three tests.
How would I go about doing this?
steps/enviroment.py
is intended for, and in comparison, this way feels a little "hacky". – Broadloom