Module: Watir::Wait
- Defined in:
- lib/watir-webdriver/wait.rb,
lib/watir-webdriver/wait/timer.rb
Defined Under Namespace
Classes: TimeoutError, Timer
Constant Summary collapse
- INTERVAL =
0.1
Class Attribute Summary collapse
-
.timer ⇒ #wait
Access Watir timer implementation in use.
Class Method Summary collapse
-
.until(timeout = nil, message = nil) ⇒ Object
Waits until the block evaluates to true or times out.
-
.while(timeout = nil, message = nil) ⇒ Object
Wait while the block evaluates to true or times out.
Class Attribute Details
.timer ⇒ #wait
Access Watir timer implementation in use.
22 |
# File 'lib/watir-webdriver/wait.rb', line 22 attr_writer :timer |
Class Method Details
.until(timeout = nil, message = nil) ⇒ Object
Waits until the block evaluates to true or times out.
39 40 41 42 |
# File 'lib/watir-webdriver/wait.rb', line 39 def until(timeout = nil, = nil) run_with_timer(timeout) { return true if yield(self) } raise TimeoutError, (timeout, ) end |
.while(timeout = nil, message = nil) ⇒ Object
Wait while the block evaluates to true or times out.
55 56 57 58 |
# File 'lib/watir-webdriver/wait.rb', line 55 def while(timeout = nil, = nil) run_with_timer(timeout) { return unless yield(self) } raise TimeoutError, (timeout, ) end |