10

I need to increase the length of the timeout 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. I am using Rpsec and Capybara. Could somebody help out please?

1 Answers1

11

This should work:

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

Are you having long running 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 - how to handle ajax

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

Pavel Evstigneev
  • 4,918
  • 31
  • 21