ios_utils.rb
def scroll_down_until_bottom(amount)
      scroll_height = $driver.execute_script("return document.body.scrollHeight;")
      scroll_top = $driver.execute_script("return document.body.scrollTop;")
      window_height = $driver.execute_script("return $(window).height();")

      yet_to_scroll = scroll_height.to_i - (scroll_top.to_i + window_height.to_i)

      if yet_to_scroll > amount
        scroll_down(amount)
      end
    end
#
# Scroll down until the bottom of the document is reached
#
Scroll down until the bottom of the document is reached
Scroll down until the bottom of the document is reached
def scroll_down_until_bottom(amount)
      scroll_height = $driver.execute_script("return document.body.scrollHeight;")
      scroll_top = $driver.execute_script("return document.body.scrollTop;")
      window_height = $driver.execute_script("return $(window).height();")
      yet_to_scroll = scroll_height.to_i - (scroll_top.to_i + window_height.to_i)
      if yet_to_scroll > amount
        scroll_down(amount)
      end
    end
def scroll_down_until_bottom ( amount ) scroll_height = $driver . execute_script ( "return document.body.scrollHeight;" ) scroll_top = $driver . execute_script ( "return document.body.scrollTop;" ) window_height = $driver . execute_script ( "return $(window).height();" ) yet_to_scroll = scroll_height . to_i - ( scroll_top . to_i + window_height . to_i ) if yet_to_scroll > amount scroll_down ( amount ) end end
Scroll down until the bottom of the document is reached
Scroll down until the bottom of the document is reached
amount