2015-05-12 56 views
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. 

我試着調試和我得到的輸出如預期即文檔成功發佈!但我不知道爲什麼測試失敗後情景成功。我認爲它實現了一些配置問題。

+0

哪一條是135號線? –

+0

行135是情景:管理員用戶可以發佈文檔....實際上,當我一步一步地調試情景,我得到了預期的結果。我可以看到「文檔已成功發佈!」在測試環境中。我認爲它與代碼頂部的@javascript有關...... – Sheharose

+0

這與此相關嗎? http://stackoverflow.com/questions/8178120/capybara-with-js-true-causes-test-to-fail –

回答

0

我想出了爲什麼情況失敗....事實上,我將黃瓜從2.0.0退化到1.3.8,它顯示了準確的錯誤。不管怎樣,謝謝Mark