Scenario Outline: scenario sample
Given the following datasource details are given
| dataSet | startDate | endDate |
| <dataSource> | <startDate> | <endDate> |
When the user wants to "<tool>"
Then usage count is "<expectedUsageCount>"
Examples:
|dataSet | startDate |endDate |tool | expectedUsageCount|
|dataSet1| 11/9/2018, 10:31 AM | 11/9/2020, 10:31 AM| ToolName_8 | 123 |
|dataSet2| 11/9/2020, 10:31 AM|11/9/2022, 10:31 AM |ToolName_17 | 345 |
我已经尝试使用Pytest bdd来编写上述senario大纲。我想问的是,我如何使用给定的表
?
> @given(parsers.parse('the following datasource details are given\n{attr_table}'))
def selectDataSource(datatable,attr_table):
??
我怎么才能得到数据集、startdate、enddate表的值?我很困惑
一种方法是将表数据作为json加载到功能文件中。 将表数据存储在namedtuple中以便于访问。 将给定步骤定义为目标_fixture,以便其他步骤可以声明和使用表数据。 使用Python3.7.5、pytest-6.2.4、bdd进行测试:“4.0.2”
相关问题 更多 >
编程相关推荐