Poltergeist Timeout Increase

I need to increase the timeout length in poltergeist. The poltergeist documentation says I need to put this code in my test setup

Capybara.register_driver :poltergeist do |app| Capybara::Poltergeist::Driver.new(app, options) end 

I am new to testing. I am not sure where the test setup is. I use Rpsec and Capybara. Can someone help you?

+8
ruby-on-rails rspec capybara poltergeist
source share
1 answer

This should work:

 Capybara.register_driver :poltergeist do |app| Capybara::Poltergeist::Driver.new(app, timeout: 1.minute) end 

Do you have long javascript or ajax?

https://coderwall.com/p/aklybw/wait-for-ajax-with-capybara-2-0 and http://robots.thoughtbot.com/automatically-wait-for-ajax-with-capybara - as for ajax processing

There is also a way to disable animation in tests to make it work faster. And if you have some elements with position: fixed , then the poltergeist will see the text behind it as invisible.

+10
source share

All Articles