Rails 2.3和phantomJS中的竞争条件

时间:2012-05-17 10:00:55

标签: ruby-on-rails capybara phantomjs

我在REE上运行了一个rails 2.3应用程序。我正在使用capybara 1.1.2,黄瓜1.1.0,poltergeist(使用0.6.0和laithst来自github)和phantomJS 1.5.0。我的问题是我相信我在幻影中有一个竞争条件导致我的黄瓜测试随机失败。当我在Chrome中运行时,黄瓜测试工作非常完美,所以我很确定问题出在poltergeist或phantomJS中。当我在PhantomJS中运行黄瓜测试时(以便我可以在CI服务器上运行它们),我会随机出现这样的错误:

页面上的Javascript代码中出现了一个或多个错误:

TypeError: 'undefined' is not a function

  http://static.ak.fbcdn.net/rsrc.php/v2/yd/r/c9z-2BUoufJ.js:75
  http://static.ak.fbcdn.net/rsrc.php/v2/yd/r/c9z-2BUoufJ.js:75
  http://static.ak.fbcdn.net/rsrc.php/v2/yd/r/c9z-2BUoufJ.js:9 in bound:(?) (Capybara::Poltergeist::JavascriptError)
./features/step_definitions/site_steps.rb:8:in `/I am on the home page/'
features/account_creation.feature:89:in `Given I am on the home page'

Failing Scenarios:
cucumber features/account_creation.feature:5 # Scenario: I should be able to start creating a resume without signing up

cucumber features / account_creation.feature:79#场景:我应该可以使用旧的用户名和密码登录     cucumber features / account_creation.feature:88#场景:我应该能够记住我的登录信息,这样当浏览器关闭时我会自动登录

基于Github page for poltergeist我已将此添加到我的env.rb以解决机架预版本1.3竞争条件问题:

Capybara.server do |app, port|
  require 'rack/handler/thin'
  Thin::Logging.silent = true
  Thin::Server.new('0.0.0.0', port, app).start
end

但这并没有任何区别,我可以说。任何想法都会受到赞赏,即使它只是暗示这是一个恶作剧问题或幻影问题,所以我知道接下来应该如何询问它。

0 个答案:

没有答案
相关问题