2016-09-15 48 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 
} 
相關問題