Class: Watir::Wait::Timer

Inherits:
Object
  • Object
show all
Defined in:
lib/watir-webdriver/wait/timer.rb

Instance Method Summary collapse

Instance Method Details

#wait(timeout) { ... } ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Executes given block until it returns true or exceeds timeout.

Parameters:

  • timeout (Fixnum)

Yields:

  • block


12
13
14
15
# File 'lib/watir-webdriver/wait/timer.rb', line 12

def wait(timeout, &block)
  end_time = ::Time.now + timeout
  yield(block) until ::Time.now > end_time
end