Capybara increase max allowed page load time
Sometimes you might have a page that loads in over a minute and assuming this is the expected behaviour and wont change. So what we can do in order to fix this because your tests will fail because of the slow pages or slow environment. But there is a solution to make Capybara increase max allowed page load time on the client.
Selenium has a lot of different timeout settings, some of which can be changed at runtime, others which have to be set when the driver is initialize. You are most likely running into the Http::Default timeout which defaults to 60 seconds. You can override this by passing your own instance into the Selenium driver as http_client
and then use the :slow_selenium driver for tests which will take over a minute to load the page
The reason of this solution is to not have a big value for
You had better not set much time to
For example, if you set 10 seconds to
Capybara.default_wait_time when you want to check the element dose not exist. Test time can be long. Because Capybara wait to check the element dose not exist in each test.
If you need more than 3 seconds(default value in Capybara.default_wait_time) to wait to check you can set
wait option to find instead.
If you want to find out more about wait times you can consult the api documentation .
Hope you find this useful in your project.