ios_utils.rb
def can_scroll(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
        return true
      else
        return false
      end
    end
#
# Returns true when the user can still sroll down the provided amount without reaching the bottom of the document
#
Returns true when the user can still sroll down the provided amount without reaching the bottom of the document
Returns true when the user can still sroll down the provided amount without reaching the bottom of the document
def can_scroll(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
        return true
      else
        return false
      end
    end
def can_scroll ( 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 return true else return false end end
Returns true when the user can still sroll down the provided amount without reaching the bottom of the document
Returns true when the user can still sroll down the provided amount without reaching the bottom of the document
amount