Increasing timeout of poltergeist
Asked Answered
V

1

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?

Vestiary answered 29/1, 2015 at 1:56 Comment(0)
M
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.

Medellin answered 29/1, 2015 at 3:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.