如何解决仅将给定表中的最后一个表项发送到Python中的其他步骤定义
在这种情况下,我试图使用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 举报,一经查实,本站将立刻删除。