0
我在使用水豚和poltergeist測試我的應用時出現奇怪的錯誤。完成場景後,水豚與poltergeist失敗
/features/document.feature
@javascript
Scenario: admin users can publish documents
Given a "admin" user exists and is signed in
And the following categories exist:
| name |
| Category 1 |
And the following documents exist:
| name | id |
| Test Document 1 | 1 |
And I goto "/admin/documents"
When I toggle publish document
And I wait for index
Then Document "Test Document 1" should be published
And I should see "Document published successfully!"
結果:
Failing Scenarios:
cucumber features/admin_features/document.feature:135 # Scenario: admin users can publish documents.
我試着調試和我得到的輸出如預期即文檔成功發佈!但我不知道爲什麼測試失敗後情景成功。我認爲它實現了一些配置問題。
哪一條是135號線? –
行135是情景:管理員用戶可以發佈文檔....實際上,當我一步一步地調試情景,我得到了預期的結果。我可以看到「文檔已成功發佈!」在測試環境中。我認爲它與代碼頂部的@javascript有關...... – Sheharose
這與此相關嗎? http://stackoverflow.com/questions/8178120/capybara-with-js-true-causes-test-to-fail –