Sha256: 34b9b746f883e3f3c2680b01eb4881f56a091f786883942e61bf4eb184ebfacc
Contents?: true
Size: 495 Bytes
Versions: 23
Compression:
Stored size: 495 Bytes
Contents
module JavascriptMacro def wait_until(seconds = 5, &block) timeout(seconds) do loop do begin ret = block.call break ret if ret rescue Capybara::Poltergeist::JavascriptError end sleep 0.01 end end end def confirm_dialog(ret, &block) page.execute_script "__backup = window.confirm; window.confirm = function(){return #{ret};}" block.call ensure page.execute_script "window.confirm = __backup;" end end
Version data entries
23 entries across 23 versions & 1 rubygems