2016-04-22 80 views
0

當我試圖測試我的Angular應用程序時,我遇到了一些問題與Rspec &水豚。在Linux上的水豚 - Poltergeist角模塊

它返回我的錯誤:

Failure/Error: visit '/' 

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). 

    Error: [$injector:modulerr] Failed to instantiate module ng due to: 
    ... 

只在TravisCI和我的Ubuntu 14.04實際發生的錯誤,在Mac OS上運行它的時候,或與硒,而不是騷靈這兩種環境中,一切都很好。
上設置js_errors錯誤導致水豚截圖上的空白頁面。

你有什麼問題嗎?

非常感謝您的回答!

回答

1

聽起來你可能在不同的環境中運行不同版本的phantomjs。確保你使用角度應用運行Phantomjs 2.1+,否則你會錯過像Function.prototype.bind這樣的重要功能 - 你得到的錯誤信息的其餘部分應該解釋缺少的內容。

+0

然後指定Travis使用PhantomJS 2.0完全做出來了,謝謝@Tom! 有關Ubuntu的PhantomJS的輕鬆升級我使用這個命令故宮: '$ sudo的NPM安裝-g phantomjs,預建' 然後在.travis.yml這些語句: 'before_install: - wget的https://開頭s3.amazonaws.com/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 - tar -xjf phantomjs-2.0.0-ubuntu-12.04.tar.bz2 - sudo rm -rf/usr/local/phantomjs/bin/phantomjs - sudo mv phantomjs/usr/local/phantomjs/bin/phantomjs' – srozen

相關問題