0

こんにちは、検索サービスが正しい結果を返すかどうかをテストする必要があるシナリオがあります。したがって、私の話は次のようになります。

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               |

"Then" セクションの下のテーブルは、名/姓の基準のさまざまな順列を使用してしばらく続き、結果列に予想される結果のネストされたテーブルが続きます。例セクションには、「いつ」セクションに渡される可能性のある検索基準のリストが含まれます。

このようなネストされたテーブルを持つことは可能ですか? そうでない場合、同じことを達成するために使用できる別の方法はありますか?

4

2 に答える 2

1

私が理解しているように、これは直接サポートされていません-ExampleTableの値をParametersとして取得すると、ParameterConvertersが起動しますが、ExampleTableParameterConverterがデフォルトで設定されています。そこには構文解析のバグがあると確信しています。

そうは言っても、「Then」はExamples:セクションのすべての行で機能する必要があります。それがあなたがそれらすべてをThenに入れることを考えていた理由だと確信しています-それからあなたは正しいものを引き抜くことができます。

次のことをしていただけませんか。

Given players registered in the Data Warehouse and some combination of Loyalty1 and/or Loyalty2 programs:
|id|first name|last name|city     |province|loyalty1 |loyalty2|
|1 |Pete      |Walter   |Winnipeg |<null>  |false    |true    |
|2 |Jon       |Dewit    |Winnipeg |MB      |true     |true    |
|3 |John      |Dewit    |<null>   |<null>  |true     |true    |
|4 |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 with users <userlist>

Examples:
|firstnamecriteria|lastnamecriteria|userlist|
|Jo               |                |2,3     |
|                 |Dew             |2,3,4   |
|J                |D               |2,3     |
于 2012-03-07T20:28:32.810 に答える
0

私は自分の話を次のように書き直しました。

Given players registered in the Data Warehouse and some combination of Loyalty1 and/or Loyalty2 :
|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 first name is Jon and the last name is Dewit the results should be:
|first name|last name|
|Jon       |Dewit    |

And the first name is <null> and the last name is dewit the results should be:
|first name|last name|
|Jon       |Dewit    |
|John      |Dewit    |

And the first name is <null> and the last name is de the results should be:
|first name|last name|
|Jon       |Dewit    |
|John      |Dewit    |
|Peter     |Dewalt   |

Then the system displays the correct results, using a case-insensitive "begins with" search

@Whenストーリーの When 文と And 文には 1 つの注釈付きメソッドがあります。このメソッドは、マッチャーを使用して、firstName、lastName、および ExamplesTable パラメーターを受け入れます。"the first name is $firstnamecriteria and the last name is $lastnamecriteria the results should be: $resultsTable"

結果テーブルを firstName/lastName で指定された HashMap キーに投入し、同じ firstName/lastName パラメータを使用してサービスで検索関数を実行し、サービス呼び出しの結果を別の HashMap に投入します。この@Then方法では、2 つの HashMap の結果を比較して、ストーリーから予想される結果がサービスによって取得された実際の結果と一致するかどうかを確認します。

正常に動作しているようで、かなり読みやすいです。

于 2012-03-08T20:30:52.367 に答える