Sha256: 3880841a41affde4b9569cfb8e0b1ea88394d855edd8a994585a3fda5db0de1e
Contents?: true
Size: 929 Bytes
Versions: 7
Compression:
Stored size: 929 Bytes
Contents
# coding: UTF-8 module ToleranceForSeleniumSyncIssues # This is similiar but not entirely the same as Capybara::Node::Base#wait_until or Capybara::Session#wait_until def patiently(seconds=Capybara.default_wait_time, &block) old_wait_time = Capybara.default_wait_time # dont make nested wait_untils use up all the alloted time Capybara.default_wait_time = 0 # for we are a jealous gem if page.driver.wait? start_time = Time.now begin block.call rescue => e raise e if (Time.now - start_time) >= seconds sleep(0.05) raise Capybara::FrozenInTime, 'time appears to be frozen, Capybara does not work with libraries which freeze time, consider using time travelling instead' if Time.now == start_time retry end else block.call end ensure Capybara.default_wait_time = old_wait_time end end World(ToleranceForSeleniumSyncIssues)
Version data entries
7 entries across 7 versions & 1 rubygems