Method: RWebUnit::Driver#wait_until
- Defined in:
- lib/rwebunit/driver.rb
#wait_until(timeout = @@default_timeout || 30, polling_interval = @@default_polling_interval || 1, &block) ⇒ Object
Execute the provided block until either (1) it returns true, or (2) the timeout (in seconds) has been reached. If the timeout is reached, a TimeOutException will be raised. The block will always execute at least once.
This does not handle error, if the given block raise error, the statement finish with error Examples:
wait_until {puts 'hello'}
wait_until { div(:id, :receipt_date).exists? }
576 577 578 579 |
# File 'lib/rwebunit/driver.rb', line 576 def wait_until(timeout = @@default_timeout || 30, polling_interval = @@default_polling_interval || 1, &block) waiter = Watir::Waiter.new(timeout, polling_interval) waiter.wait_until { yield } end |