D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
td-agent
/
embedded
/
lib
/
ruby
/
gems
/
2.1.0
/
gems
/
fluentd-ui-0.4.4
/
spec
/
support
/
Filename :
javascript_macro.rb
back
Copy
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