在編寫場景時,沒有人有強烈的論點來選擇下列其中一種風格嗎?BDD:顯式示例 - 適當的代詞?
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"
是獨立的,等效步驟必須被定義,如果其他演員也可以使用相同的功能。我個人認爲「我」讀得相當不錯(儘管我覺得我知道不是)。思考?
好例子 - 謝謝! –
在第一個示例中,「證明用戶是人」(管理員透視圖)和「註冊帳戶」(用戶視角)這兩個功能是否共存,或者「證明用戶是人類」還是包含(並覆蓋)註冊過程? –
可能會有一個單獨的場景來覆蓋用戶註冊。你可以通過圖形用戶界面重複這個過程,或者破解數據 - 「給定」如何進入它的形式並不重要,因爲這不是你正在鍛鍊的行爲。 – Lunivore