Module: OpsManagerUiDrivers::WaitHelper

Included in:
PageHelpers
Defined in:
lib/ops_manager_ui_drivers/wait_helper.rb

Constant Summary collapse

SLEEP_INTERVAL =
0.5
EarlyFailException =
Class.new(Exception)

Instance Method Summary collapse

Instance Method Details

#fail_early(msg) ⇒ Object



9
10
11
# File 'lib/ops_manager_ui_drivers/wait_helper.rb', line 9

def fail_early(msg)
  fail(EarlyFailException.new(msg))
end

#poll_up_to_mins(minutes, &blk) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/ops_manager_ui_drivers/wait_helper.rb', line 13

def poll_up_to_mins(minutes, &blk)
  title = "Polling for #{minutes} mins"

  Logger.debug "--- BEGIN #{title}"
  retry_until(minutes_to_time(minutes), &blk)
ensure
  Logger.debug "--- END   #{title}"
end

#poll_up_to_times(times, &blk) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/ops_manager_ui_drivers/wait_helper.rb', line 22

def poll_up_to_times(times, &blk)
  title = "Polling for #{times} times"

  Logger.debug "--- BEGIN #{title}"
  retry_times(times, &blk)
ensure
  Logger.debug "--- END   #{title}"
end