Using Capybara for AJAX integration tests

一世执手 提交于 2019-11-30 15:50:34

问题


I am using Capybara for rails integration tests. When it comes to AJAX requests, I am getting the following error:

Capybara::TimeoutError: failed to resynchronize, ajax request timed out

Any idea what's wrong and how this can be fixed?


回答1:


I had this same issue once I upgraded my selenium/capybara gems. There is some AJAX synchronization logic that is causing this, so I just disabled it within my test hook.

Before do
  page.driver.options[:resynchronize] = false
end



回答2:


If you are on rail 3

change this in your gem file.

gem 'capybara', :git => 'git://github.com/jnicklas/capybara.git', :branch =>'async_is_my_bitch'

then do bundle update.

This will solve it.



来源:https://stackoverflow.com/questions/6689914/using-capybara-for-ajax-integration-tests

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!