Module: Capybara::AsyncRunner::WaitHelper
- Extended by:
- WaitHelper
- Included in:
- WaitHelper
- Defined in:
- lib/capybara/async_runner/wait_helper.rb
Overview
This module allows to run a code periodically
and check for its returning value
Instance Method Summary collapse
-
#wait_until(timeout) { ... } ⇒ Object
Calls provided
block
every 100ms and stops when it returns false.
Instance Method Details
#wait_until(timeout) { ... } ⇒ Object
Calls provided block
every 100ms
and stops when it returns false
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/capybara/async_runner/wait_helper.rb', line 30 def wait_until(timeout, &block) begin Timeout.timeout(timeout) do sleep(0.1) until value = block.call value end rescue TimeoutError false end end |