正如标题所示,我希望在场景大纲之前运行某些配置/环境设置步骤.我知道有Background这样做的场景,但Behave将场景大纲分成多个场景,从而为场景大纲中的每个输入运行背景.
这不是我想要的.由于某些原因,我无法提供我正在使用的代码,但是我将编写一个示例功能文件.
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 |
Run Code Online (Sandbox Code Playgroud)
什么会发生在这种情况下是会舞动动力循环和检查每个输出USB接口Hi,No,Yes导致三个电源周期和三个连接检查
我想要的是使用一次电源循环并检查连接一次,然后运行所有三个测试.
我该怎么做呢?