2012-03-13 26 views
-1

當我寫:電子郵件規格有什麼問題?

When I fill in "To" with "[email protected], [email protected]" 
And I press "Send testimonials request" 
Then I should see "Testimonial requests have been successfully sent" 
And "[email protected]" should receive an email with subject "Add a testimonial..." 
And "[email protected]" should receive an email with subject "Add a testimonial..." 

一切工作正常。

但如果我寫:

When I fill in "To" with "[email protected], [email protected]" 
And I press "Send testimonials request" 
Then "[email protected]" should receive an email with subject "Add a testimonial..." 
And "[email protected]" should receive an email with subject "Add a testimonial..." 
And I should see "Testimonial requests have been successfully sent" 

沒有什麼工作...只是一條線被轉移到結束......咚..

可能的原因是一些延遲檢查電子郵件之前?或類似的東西。

+0

and ... boom ..不是一個好的描述。你應該添加一些細節。 – lucapette 2012-03-13 09:12:32

+0

Boom ..意味着什麼。我看到了錯誤消息:「預期:1,得到:0」。類似的東西。 – ValeriiVasin 2012-03-13 09:54:11

+0

如果你包含了你所看到的確切的錯誤信息,以及步驟定義代碼(或者這些是內置的web_steps?),我認爲你會得到更好的答案。 – 2012-03-14 03:45:42

回答

2

這是黃瓜的異步行爲。在第一種情況下,您正在等待,直到等待閃光消息完成操作。內部黃瓜司機「等待」,直到通過間隔和警戒延遲(水豚等待時間)輪詢該元素,元素將變得可見。

而在第二種情況下,您立即檢查電子郵件。黃瓜對你的控制器/操作一無所知,並不與它們同步。

您可以在電子郵件檢查步驟中選擇第一種情況或引入某種輪詢。

1

這可能是計時問題,具體取決於您使用的瀏覽器驅動程序。我們已經看到很多使用水豚與硒。步驟'我應該看到...'實際上使得測試停止,並且等待以使該消息顯示在頁面上(這是發送電子郵件的時間)。如果您將其轉移到最後,那麼「應該收到電子郵件」步驟的可能性太快,因此在應用程序確實有機會發送電子郵件之前進行斷言。