lib/testcentricity_web/web_elements/list.rb
def wait_until_item_count_is(value, seconds = nil, post_exception = true)
      timeout = seconds.nil? ? Capybara.default_max_wait_time : seconds
      wait = Selenium::WebDriver::Wait.new(timeout: timeout)
      wait.until { compare(value, get_item_count) }
    rescue
      if post_exception
        raise "Value of List #{object_ref_message} failed to equal '#{value}' after #{timeout} seconds" unless get_item_count == value
      else
        get_item_count == value
      end
    end
# Wait until the list's item count equals the specified value, or until the specified wait time has expired. If the wait
# time is nil, then the wait time will be Capybara.default_max_wait_time.
#
# @param value [Integer or Hash] value expected or comparison hash
# @param seconds [Integer or Float] wait time in seconds
# @example
#   search_results_list.wait_until_item_count_is(10, 15)
#     or
#   search_results_list.wait_until_item_count_is({ greater_than_or_equal: 1 }, 5)
#
Wait until the list's item count equals the specified value, or until the specified wait time has expired. If the wait
time is nil, then the wait time will be Capybara.default_max_wait_time.
Wait until the list ' s item count equals the specified value or until the specified wait time has expired . If the wait time is nil then the wait time will be Capybara . default_max_wait_time .
def wait_until_item_count_is(value, seconds = nil, post_exception = true)
      timeout = seconds.nil? ? Capybara.default_max_wait_time : seconds
      wait = Selenium::WebDriver::Wait.new(timeout: timeout)
      wait.until { compare(value, get_item_count) }
    rescue
      if post_exception
        raise "Value of List #{object_ref_message} failed to equal '#{value}' after #{timeout} seconds" unless get_item_count == value
      else
        get_item_count == value
      end
    end
def wait_until_item_count_is ( value , seconds = nil , post_exception = true ) timeout = seconds . nil? ? Capybara . default_max_wait_time : seconds wait = Selenium :: WebDriver :: Wait . new ( timeout : timeout ) wait . until { compare ( value , get_item_count ) } rescue if post_exception raise "Value of List #{object_ref_message} failed to equal '#{value}' after #{timeout} seconds" unless get_item_count == value else get_item_count == value end end
Wait until the list's item count equals the specified value, or until the specified wait time has expired.
Wait until the list ' s item count equals the specified value or until the specified wait time has expired .
value
value expected or comparison hash
value expected or comparison hash
seconds
wait time in seconds
wait time in seconds
post_exception
example
search_results_list.wait_until_item_count_is(10, 15) or search_results_list.wait_until_item_count_is({ greater_than_or_equal: 1 }, 5)
search_results_list . wait_until_item_count_is ( 10 15 ) or search_results_list . wait_until_item_count_is ( { greater_than_or_equal : 1 } 5 )