是否可以在 Cucumber/Cuke4Duke 中使用 2 个不同的示例表
是否可以以某种方式构建一个在不同步骤中使用两个不同示例表的场景?像这样的事情:
Given I log in
When I view a page
Then I should see <goodText>
Examples:
|goodText|
|abc|
And I should not see <badText>
Examples:
|badText|
|xyz|
上面的场景不起作用,而且实际上每个表会有更多行。
Is it possible to somehow construct a Scenario which uses two different Example tables in different steps? Something like this:
Given I log in
When I view a page
Then I should see <goodText>
Examples:
|goodText|
|abc|
And I should not see <badText>
Examples:
|badText|
|xyz|
The scenario above doesn't work, also in reality there would be more rows to each table.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来您将表格与场景示例混淆了。您可以混合它们,但从您的示例来看,我不确定您想要实现什么目标。为什么不直接写:
或者如果你想检查多个字符串:
It looks like you're confusing tables with scenario examples. You can mix them, but from your example I'm not sure what you're trying to achieve. Why not just write:
or if you wanted to check for multiple strings:
您说实际上表中会有更多行;当然,一个表也可以有很多列。
这对你不起作用吗?
You say that in reality there would be many more rows to the table; but of course a table can also have many columns.
Would this not work for you?