我需要測試用戶多次重複執行一組操作時觸發的行爲。我想用一個看起來像這樣的情況下,結束了:我可以在不重複使用Cucumber的步驟的情況下重複這些步驟嗎?
Scenario: Nice way
Given that I am on some screen
When I enter something into some text field
And I press the Continue button
And I go back
And I repeat the previous 2 steps 5 times
Then the application should crash
,而不是一個場景,看起來像這樣:
Scenario: Annoying way
Given that I am on some screen
When I enter something into some text field
And I press the Continue button
And I go back
And I press the Continue button
And I go back
And I press the Continue button
And I go back
And I press the Continue button
And I go back
And I press the Continue button
And I go back
And I press the Continue button
And I go back
Then the application should crash
是否有這樣做的標準方法或做我有自己實現它?
這就是你在這裏指定的一個很好的應用程序('然後應用程序應該崩潰了) – SirLenz0rlot
爲什麼你想讓應用程序崩潰?這似乎是一個探索性測試,而不是設計測試。我不會在黃瓜裏做。 –
@DaveMcNulla應用程序不應該崩潰。這個例子是彌補的。 –