0

我有一个行为测试,我希望在执行步骤后生成行为表中的部分数据。例如

Given I have a step
When I executed some other step
Then the message should have the following data
     | field | value |
     | a     | 20    |
     | b     | 30    |
     | var   | <val> |

执行该when步骤后,我想<val>根据该步骤修改为某个值。

4

1 回答 1

1

可能您可以将这两个步骤组合在一起,并在该步骤中:

  1. 做你为你的“何时”步骤所做的事情
  2. 使用参数执行 context.execute_steps,例如:

context.execute_steps(u'''Then doing something with "you_parameters"'''.format(you_parameter=value)

当然,您可以使用包含您生成的数据的表来执行 context.execute_steps

于 2017-01-10T23:31:31.180 回答