在编写场景时,是否有人强烈主张选择以下样式中的一种而不是另一种?
Feature: Search Product
As a customer
I want to search for a product
So that I can easily locate what I want to purchase
Scenario: Multiple Products Found (First Person Style)
Given the following products exist:
|Product |
|Normal Orange|
|Large Orange |
When I search for "orange" <---
Then the system should display the following products:
|Product |
|Normal Orange|
|Large Orange |
或者...
Scenario: Multiple Products Found (Generic Third Person Style)
Given the following products exist:
|Product |
|Normal Orange|
|Large Orange |
When the customer searches for "orange" <---
Then the system should display the following products:
|Product |
|Normal Orange|
|Large Orange |
或者...
Scenario: Multiple Products Found (Specific Person Style)
Given the following products exist:
|Product |
|Normal Orange|
|Large Orange |
When "John" searches for "orange" <---
Then the system should display the following products:
|Product |
|Normal Orange|
|Large Orange |
它们似乎都工作得很好——我想知道我是否遗漏了一个明显的陷阱,因为很多例子似乎都使用了参与者的特定值(不仅仅是输入/结果的特定值)。
我反对使用的唯一论点:
When the customer searches for "orange"
如果其他参与者也可以使用相同的功能,则必须定义单独的等效步骤。
就个人而言,我认为“我”读起来很好(尽管我觉得我不知道)。想法?