【发布时间】:2021-06-07 18:50:29
【问题描述】:
如果我有成功场景的条件,我可以写成Given, And, And... Then button is enabled.,但我怎么写If either x,y, or z aren't set, the button remains disabled的否定场景。
下面是一个正面场景的例子:
Scenario: Enable the Add to Favorites button
When the consumer is viewing an item
And the consumer selects an item
And the consumer selects a size
And the consumer selects a quantity
Then the Add to Favorites button becomes enabled
可以(或应该)在一种情况下完成吗?由于所有成功的“按钮启用”场景都需要这 3 个元素,我会将它们添加到 Before() 挂钩吗?
感谢您的时间和关注。
【问题讨论】:
标签: gherkin cucumberjs