嗨我有一個場景,我需要測試一個搜索服務是否正在帶回正確的結果。所以,我的故事看起來是這樣的:JBehave中的嵌套表格
Narrative:
In order to easily discover if a player is registered in a loyalty program
As a customer service representative
I want to be able to search for registered players by player first and last name
Scenario: Retrieve Player information by First and Last Name
Given players registered in the Data Warehouse and some combination of Loyalty1 and/or Loyalty2 programs:
|first name|last name|city |province|loyalty1 |loyalty2|
|Pete |Walter |Winnipeg |<null> |false |true |
|Jon |Dewit |Winnipeg |MB |true |true |
|John |Dewit |<null> |<null> |true |true |
|Peter |Dewalt |<null> |<null> |true |false |
When the <firstnamecriteria> and <lastnamecriteria> criteria are specified
Then the system displays the correct results, using a case-insensitive "begins with" search as follows:
|firstnamecriteria|lastnamecriteria|results |
|Jo | ||first name|last name||
| | ||Jon |Dewit ||
| | ||John |Dewit ||
Examples:
|firstnamecriteria|lastnamecriteria|
|Jo | |
| |Dew |
|J |D |
在桌子底下「然後」節會去一會兒,使用的名字/姓氏標準,然後在結果列預期結果的表格嵌套不同的排列。 Examples部分將包含傳遞給「When」部分的可能搜索條件列表
是否有可能具有這樣的嵌套表格?如果不是,那麼我可以用另一種方法來完成同樣的事情嗎?
或指定一個字符串指向一個資源,你可以得到和驗證(通過網址而不是內聯表) – 2012-03-07 20:29:51
這是我也曾想到的解決方案,但問題是我在這個集成測試中的底層數據庫選擇我的id值,所以我不知道他們是什麼時間的頭。話雖如此,我可以像你所說的那樣使它工作,爲此+1 – ThaDon 2012-03-08 20:19:13