Cucumber 屏幕上可见的所有字段是否都应该在小黄瓜中验证?

Cucumber 屏幕上可见的所有字段是否都应该在小黄瓜中验证?,cucumber,bdd,specflow,gherkin,Cucumber,Bdd,Specflow,Gherkin,我们正在为应用程序创建小黄瓜特性文件,以创建可执行规范。目前,我们的文件如下所示: Given product <type> is found When the product is clicked Then detailed information on the product appears And the field text has a value And the field price has a value And the fiel

我们正在为应用程序创建小黄瓜特性文件,以创建可执行规范。目前,我们的文件如下所示:

Given product <type> is found
    When the product is clicked
    Then detailed information on the product appears
    And the field text has a value
    And the field price has a value
    And the field buy is available
Scenario Outline: Review product details
Given I find the product <Type>
When I select the product
Then detailed information on the product appears including
| Description | <Description> |
| Price       | <Price>       |
And I can buy the product
Examples:
| Type      | Description       | Price |
| Hose      | Rubber Hose       | 31.99 |
| Sprinkler | Rotating Sprinker | 12.99 |

我们想知道,验证字段在屏幕上是否可见的完整列表和关键字是否是一条出路,或者我们是否应该将其缩短为类似“验证输入”的内容。

我们有一个类似的情况,我们的服务可以为每种我们可以验证的情况返回大量的10个元素。我们不会为每个交互验证每个元素,我们只测试与测试用例相关的元素

为了更容易地维护和切换我们正在使用的元素,我们使用场景大纲和示例表

Scenario Outline: PO Boxes correctly located
    When we search in the USA for "<Input>"        
    Then the address contains
        | Label        | Text        |
        | PO Box       | <PoBox>     |
        | City name    | <CityName>  |
        | State code   | <StateCode> |
        | ZIP Code     | <ZipCode>   |
        | +4 code      | <ZipPlus4>  |

Examples:
| ID | Input                 | PoBox      | CityName  | StateCode | ZipCode |
| 01 | PO Box 123, 12345     | PO Box 123 | Boston    | MA        | 12345   |
| 02 | PO Box 321, Whitefish | PO Box 123 | Whitefish | MN        | 54321   | 

通过这种方式,我们有了地址包含的通用步骤,该步骤使用“标签”和“文本”来测试各个元素。这是一种整洁的方法来测试许多潜在的组合,但它可能取决于您的个人用例,所有字段的重要性如何。

我们有一个类似的案例,我们的服务可以为每个我们可以验证的案例返回大量的10个元素。我们不会为每个交互验证每个元素,我们只测试与测试用例相关的元素

为了更容易地维护和切换我们正在使用的元素,我们使用场景大纲和示例表

Scenario Outline: PO Boxes correctly located
    When we search in the USA for "<Input>"        
    Then the address contains
        | Label        | Text        |
        | PO Box       | <PoBox>     |
        | City name    | <CityName>  |
        | State code   | <StateCode> |
        | ZIP Code     | <ZipCode>   |
        | +4 code      | <ZipPlus4>  |

Examples:
| ID | Input                 | PoBox      | CityName  | StateCode | ZipCode |
| 01 | PO Box 123, 12345     | PO Box 123 | Boston    | MA        | 12345   |
| 02 | PO Box 321, Whitefish | PO Box 123 | Whitefish | MN        | 54321   | 

通过这种方式,我们有了地址包含的通用步骤,该步骤使用“标签”和“文本”来测试各个元素。这是一种测试许多潜在组合的简洁方法,但它可能取决于您个人的用例,所有字段都有多重要。

您只需要验证那些提供业务价值的字段,可能就是所有字段。我会避免使用像field这样的技术术语,因为它与行为无关。艾尔·米尔斯正准备使用这些桌子

我会这样说:

Given product <type> is found
    When the product is clicked
    Then detailed information on the product appears
    And the field text has a value
    And the field price has a value
    And the field buy is available
Scenario Outline: Review product details
Given I find the product <Type>
When I select the product
Then detailed information on the product appears including
| Description | <Description> |
| Price       | <Price>       |
And I can buy the product
Examples:
| Type      | Description       | Price |
| Hose      | Rubber Hose       | 31.99 |
| Sprinkler | Rotating Sprinker | 12.99 |

我选择的词是行为或什么,而不是技术实现或方式。

您只需要验证提供业务价值的那些,可能就是所有这些。我会避免使用像field这样的技术术语,因为它与行为无关。艾尔·米尔斯正准备使用这些桌子

我会这样说:

Given product <type> is found
    When the product is clicked
    Then detailed information on the product appears
    And the field text has a value
    And the field price has a value
    And the field buy is available
Scenario Outline: Review product details
Given I find the product <Type>
When I select the product
Then detailed information on the product appears including
| Description | <Description> |
| Price       | <Price>       |
And I can buy the product
Examples:
| Type      | Description       | Price |
| Hose      | Rubber Hose       | 31.99 |
| Sprinkler | Rotating Sprinker | 12.99 |
我选择的词是行为或什么,而不是技术实现或如何