Module: Dekiru::Capybara::Helpers

Includes:
WaitForPositionStable
Defined in:
lib/dekiru/capybara/helpers.rb,
lib/dekiru/capybara/helpers/wait_for_position_stable.rb

Defined Under Namespace

Modules: WaitForPositionStable

Instance Method Summary collapse

Methods included from WaitForPositionStable

#wait_for_element_position_stable, #wait_for_position_stable

Instance Method Details

#wait_until(timeout: ::Capybara.default_max_wait_time, interval: 0.2, **opts, &block) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/dekiru/capybara/helpers.rb', line 8

def wait_until(timeout: ::Capybara.default_max_wait_time, interval: 0.2, **opts, &block)
  if defined?(Selenium::WebDriver::Wait)
    Selenium::WebDriver::Wait.new(opts.merge(timeout: timeout, interval: interval)).until { yield }
  else
    Timeout.timeout(timeout) do
      sleep(interval) until yield
    end
  end
end