I made a function called wait_for_page load, and I am trying to set the default_wait_time to this function.
I get an undefined variable error:
undefined local variable or method `page' for main:Object (NameError)
I also included the file into the main environment file:
require File.expand_path('../../support/file_name.rb', FILE)
default_wait_time
is an accessor in Capybara module. So you'll need to call it on the Capybara object itself, like:And Capybara object should be available wherever you have defined this method.
In some newer versions accessor is
default_max_wait_time
, you can notice this because of a DEPRECATION warning So you need to do this:The default is 2 seconds