问题描述
在这种情况下,我试图使用Python行为。
Scenario Outline: Tool Usage and Number Of Available Tool
Given the following datasource details are given
| dataSource | machineName | workPieceName | NCProgramName | startDateY | startDateM | startDateD | startDateH | startDateMin | startDateSec | endDateY | endDateM | endDateD | endDateH | endDateMin | endDateSec |
| (mc=13)_(tm=32)_(wp=64)_(sd=20200515_11.25)_(ed=20200619_10.57) | all | all | all | 2020 | 6 | 3 | 12 | 36 | 12 | 2021 | 3 | 3 | 3 | 33 | 23 |
| (mc=50)_(tm=30)_(wp=380)_(sd=20200528_02.58)_(ed=20200629_22.44) | MachineName_243 | all | all | 2020 | 6 | 15 | 11 | 36 | 10 | 2020 | 6 | 16 | 0 | 0 | 0 |
| (mc=10)_(tm=56)_(wp=48)_(sd=20200604_13.16)_(ed=20200619_08.59) | MachineName_243 | all | all | 2020 | 6 | 15 | 11 | 36 | 10 | 2020 | 6 | 16 | 3 | 33 | 23 |
When the user wants to get the usage frequency of tool type for "<toolMasterName>"
Then usage count is <expectedUsageCount>
And number of available tool is <expectedNumberOfAvailableTool>
Examples:
| toolMasterName | expectedUsageCount | expectedNumberOfAvailableTool |
| MasterToolName_3 | 0 | 124 |
| MasterToolName_9 | 0 | 388 |
这些是步骤定义部分:
@given('the following datasource details are given')
def generate_testdata(context):
testdata=[]
for row in context.table:
....
testdata=json.loads(ini_string)
context.response=testdata
@when('the user wants to get the usage frequency of tool type for "{toolMasterName}"')
def step_impl(context,toolMasterName):
frequencyOfToolResultFromAPIRequest = objAPI.getFrequencyOfTools(context.response)
我想问的是给定表中有3种不同的东西,并且在调试时我意识到给定步骤定义中的最后一个表行| (mc = 10)(tm = 56)(wp = 48)(sd = 20200604_13.16)(ed = 20200619_08.59)| MachineName_243 | ..... 正在发送到其他步骤定义。 我的意思是我希望所有给定的表项都应该发送到其他步骤定义,但是我意识到最后一个表项正在发送到下一步定义。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)