我是黃瓜的新人。我試圖寫一個測試是否有一個以上的黃瓜場景是正確的?
- 一個新的下拉現有頁面
- 上和選擇這個新的值條目的特徵文件進入一個新的數據庫表
我寫了這個功能文件。這看起來不正確。
- 我不確定是否可以有兩個
Then
s。 - 或者有什麼方法可以讓我們擁有相互依賴的功能,比如新的下拉菜單和數據庫條目的功能之一?
特徵文件就像
Scenario: Admin user should be able to assign ReadOnly role to a searched user via Change User page
Given user logs into webapp with Admin role
And Navigates to Change User page
When user searches for user with id 123
And clicks select link corresponding to correct id
Then Change User page loads
And it has a new drop down with Read Only role
And when user selects MS distributor in drop down # note when with small w
And Presses Submit button then a new entry is saved in DB table # then with small t
或者,也許我可以使用以下命令:
Scenario: Admin user should be able to assign ReadOnly role to a searched user via Change User page
Given user logs into webapp with Admin role
And Navigates to Change User page
When user searches for user with id 123
And clicks select link corresponding to correct id to open Change User page
And it has a new drop down with Read Only role # need to check this new value in my selenium test case
And when user selects MS distributor value in drop down # note when with small w
And presses Save button
Then a new entry is saved in DB table
我期待着從你的經驗中學習。
感謝例如多個然後使用和最後...但我的情況是有點不同...首先我檢查是否存在下拉,然後我用它來增加數據庫的價值。 – Lav
@Lav是的,我可以看到。國際海事組織,你正在看場景的方式,以及場景本身的細節,是你正在經歷的困惑的重要組成部分。我還可以告訴你,你還沒有與業務人員討論這種情況。如果你繼續沿着這條路走下去,你很可能會發現你的場景變得脆弱和難以維繫。有關更多信息,請查找「聲明式與命令式」。 – Lunivore