我正在嘗試創建一個測驗樣式技巧鑽井現場並使用黃瓜來驅動測試。作爲一個粗略的估計假裝我向用戶展示兩個數字,並要求用戶點擊代表他們差異的按鈕。兩個顯而易見的場景應該是:在「黃瓜」中將「給定」信息循環到「何時」操作
Scenario: Difference drill, correct answer
Given I am on the difference drill prompt page
And the first number is X
And the second number is Y
When I press "X-Y"
Then I should see "Correct!"
Scenario: Difference drill, incorrect answer
Given I am on the difference drill prompt page
And the first number is X
And the second number is Y
When I press "X-Y-1"
Then I should see "Incorrect."
我不認爲一個方案概述了相當這裏的正確答案,是有其地方呈現給用戶的數據在一定程度上隨機生成黃瓜試驗的任何方式,以及用戶的行動取決於這些數據?
我同意應該有邊界值,但我的應用程序的一部分功能是在這些邊界值內生成隨機離散值,並將這些隨機值呈現給用戶。用戶需要確定這些隨機值之間的差異,並用該差異來回應應用程序。當訪問「鑽取提示」頁面時,應用程序的責任是生成兩個隨機值,並請求用戶輸入。 – animal 2010-08-11 23:22:11