Module: Appium::Core::Waitable
- Included in:
- Driver
- Defined in:
- lib/appium_lib_core/common/wait.rb
Overview
module Wait
Instance Method Summary collapse
-
#wait(timeout: nil, interval: nil, message: nil, ignored: nil) ⇒ Object
Check every interval seconds to see if yield doesn’t raise an exception.
-
#wait_true(timeout: nil, interval: nil, message: nil, ignored: nil) ⇒ Object
Check every interval seconds to see if yield returns a truthy value.
Instance Method Details
#wait(timeout: nil, interval: nil, message: nil, ignored: nil) ⇒ Object
Check every interval seconds to see if yield doesn’t raise an exception. Give up after timeout seconds.
If only a number is provided then it’s treated as the timeout value.
162 163 164 165 166 167 168 |
# File 'lib/appium_lib_core/common/wait.rb', line 162 def wait(timeout: nil, interval: nil, message: nil, ignored: nil) Wait.until(timeout: timeout || @wait_timeout, interval: interval || @wait_interval, message: , ignored: ignored, object: self) { yield } end |
#wait_true(timeout: nil, interval: nil, message: nil, ignored: nil) ⇒ Object
Check every interval seconds to see if yield returns a truthy value. Note this isn’t a strict boolean true, any truthy value is accepted. false and nil are considered failures. Give up after timeout seconds.
If only a number is provided then it’s treated as the timeout value.
140 141 142 143 144 145 146 |
# File 'lib/appium_lib_core/common/wait.rb', line 140 def wait_true(timeout: nil, interval: nil, message: nil, ignored: nil) Wait.until_true(timeout: timeout || @wait_timeout, interval: interval || @wait_interval, message: , ignored: ignored, object: self) { yield } end |