今天我开始使用 SpecFlow + Selenium 研究 BDD,我发现了几个只显示 1 个返回的例子。
如何编写返回多个项目的场景。例如:
Given a name "test"
I click on the SEARCH button
那么结果将等于下表:
name | last name
test | fulano
test | siclano
在这种情况下,我该如何编写 THEN?接受返回表中显示的 2 行?
最佳答案
场景:
Given a name "test"
When I click on the SEARCH button
Then the result will be
| name | last name
| test | fulano
| test | siclano
代码:
[Then("The result will be")]
public void ThenTheResultWillBe(Table table)
{
//check that the result contains all the values in the table
}
关于c# - BDD SpecFlow 场景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39517559/