Method: Roi#wait_until_displayed?

Defined in:
lib/roi/roi.rb

#wait_until_displayed?(timeout, args = {}) ⇒ Boolean

Public: Waits until the given ROI is displayed.

Corresponds to api_wait_till_<ROI TYPE>_displayed?

timeout - Integer total milliseconds to allow before timing out. key - String name of key to press to trigger evaluation (default: nil).

If default, no keys will be pressed.

delay - Integer total milliseconds to delay before starting evaluation (default: 0). scale - Boolean if the larger image should be scaled to the size of the smaller image (default: false).

Applies to image ROIs only.

verifies_for - Integer total milliseconds for which the ROI must verify in order to succeed (default: 0).

If default, the ROI must only verify once.

priority - Symbol representing evaluation priority used to throttle CPU usage (default: :normal):

:critical   - Sleep 10 milliseconds between intensive tasks (should be used sparingly).
:high       - Sleep 100 milliseconds between intensive tasks.
:normal     - Sleep 1 second between intensive tasks (default).
:low        - Sleep 10 seconds between intensive tasks.
:background - Sleep 1 minute between intensive tasks (should be used sparingly).

log_every - Integer interval in milliseconds between logs (default: 1000). message - String message to log instead of the default (default: nil).

Default logs a tailored message.

Returns Boolean true if displayed before the timeout, otherwise false.

Returns:

  • (Boolean)


111
112
113
114
115
# File 'lib/roi/roi.rb', line 111

def wait_until_displayed?(timeout, args={})
  logger.info("Waiting #{timeout} ms until #{self.class.name} is displayed")
  args[:timeout] = timeout
  displayed?(args)
end