Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increasing timeout of poltergeist

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?

like image 479
Alexander Yurchenko Avatar asked Jan 29 '15 01:01

Alexander Yurchenko


1 Answers

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.

like image 144
Pavel Evstigneev Avatar answered Oct 09 '22 15:10

Pavel Evstigneev