2016-09-15 50 views
0

今天我开始使用SpecFlow + Selenium来研究BDD,并且我发现了几个只显示1返回的例子。BDD SpecFlow方案

如何编写一个方案,该方案返回多个项目。例如:

Given a name "test" 
I click on the SEARCH button 

那么结果将等于见下表:

name | last name 
test | fulano 
test | siclano 

在这种情况下,我怎么写?THEN接受返回2行表显示?

回答

1

场景:

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 
} 
相关问题