gpt4 book ai didi

java - JBehave 中的嵌套表

转载 作者:行者123 更新时间:2023-12-01 15:30:18 28 4
gpt4 key购买 nike

您好,我有一个场景,我需要测试搜索服务是否返回正确的结果。所以我的故事看起来像这样:

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 |

“然后”部分下的表格将持续一段时间,使用名字/姓氏标准的不同排列,后面是结果列中预期结果的嵌套表格。示例部分将包含传递到“何时”部分的可能搜索条件列表

是否可以有这样的嵌套表?如果没有,我是否可以使用另一种方法来完成同样的事情?

最佳答案

据我了解,不直接支持这一点 - 尽管获取ExampleTable值作为参数将启动ParameterConverters - 默认情况下会设置ExampleTable ParameterConverter。我确信其中存在解析错误。

也就是说,您的“Then”需要适用于 Examples: 部分的所有行。我确信这就是为什么您考虑将它们全部放入“然后”中的原因 - 然后您可以挑选出正确的一个。

您可以执行以下操作吗:

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 |

关于java - JBehave 中的嵌套表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9604520/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com