Module: Watir::Waitable
- Included in:
- Alert, Browser, Element, ElementCollection, ShadowRoot, Window, WindowCollection
- Defined in:
- lib/watir/wait.rb
Overview
Wait
Instance Method Summary collapse
-
#wait_until(timeout: nil, message: nil, interval: nil, **opt, &blk) ⇒ Object
Waits until the condition is true.
-
#wait_while(timeout: nil, message: nil, interval: nil, **opt, &blk) ⇒ Object
Waits while the condition is true.
Instance Method Details
#wait_until(timeout: nil, message: nil, interval: nil, **opt, &blk) ⇒ Object
Waits until the condition is true.
104 105 106 107 108 109 110 111 112 113 |
# File 'lib/watir/wait.rb', line 104 def wait_until(timeout: nil, message: nil, interval: nil, **opt, &blk) ||= proc { |obj| "waiting for true condition on #{obj.inspect}" } # TODO: Consider throwing argument error for mixing block & options proc = create_proc(opt, &blk) Wait.until(timeout: timeout, message: , interval: interval, object: self, &proc) self end |
#wait_while(timeout: nil, message: nil, interval: nil, **opt, &blk) ⇒ Object
TODO:
add element example
Waits while the condition is true.
130 131 132 133 134 135 136 137 138 139 |
# File 'lib/watir/wait.rb', line 130 def wait_while(timeout: nil, message: nil, interval: nil, **opt, &blk) ||= proc { |obj| "waiting for false condition on #{obj.inspect}" } # TODO: Consider throwing argument error for mixing block & options proc = create_proc(opt, &blk) Wait.while(timeout: timeout, message: , interval: interval, object: self, &proc) self end |