我遇到了錯誤,在特性測試中使用Rspec,水豚和Poltergeist測試我的Braintree沙箱支付。我已經設置完成了人類在開發過程中所做的事情(輸入付款信息並單擊提交)。它在開發中工作正常。然而,當我跑我的天賦,我得到的支付頁面上的JavaScript錯誤在加載時:水豚/ Poltergeist和布倫特裏測試
Capybara::Poltergeist::JavascriptError:
One or more errors were raised in the Javascript code on the page. If you don't care about these errors, you can ignore them by setting js_errors: false in your Poltergeist configuration (see documentation for details).
[object Object]
[object Object]
at https://js.braintreegateway.com/js/braintree-2.24.0.js:9484 in fallbackError
# /usr/local/bundle/gems/poltergeist-1.10.0/lib/capybara/poltergeist/browser.rb:365:in `command'
# /usr/local/bundle/gems/poltergeist-1.10.0/lib/capybara/poltergeist/browser.rb:181:in `click'
# /usr/local/bundle/gems/poltergeist-1.10.0/lib/capybara/poltergeist/node.rb:17:in `command'
# /usr/local/bundle/gems/poltergeist-1.10.0/lib/capybara/poltergeist/node.rb:131:in `click'
有沒有人遇到了類似的問題,或者有任何想法,爲什麼布倫特裏的JS可能會在測試中拋出這個錯誤(無頭瀏覽器)在開發過程中工作正常嗎?
可能重複的[Poltergeist拋出JS錯誤時js \ _errors:false](http://stackoverflow.com/questions/25673890/poltergeist-throws-js-errors-when-js-errors-false) – fabersky