def scroll(marionette, direction, distance, locator=None, screen=None, increments=None): """scroll - uses smooth_scroll method in gestures.py. direction = 'up' or 'down' (page location) distance = total distance to travel increments = rate of scroll locator = locator of the screen that needs to be scrolled screen = screen element that needs to be scrolled locator is for backwards compatibility. screen should be used perform release afterwards """ if screen is None: assert isinstance(marionette, object) screen = marionette.find_element(*locator) vector = -1 axis = 'x' if direction == 'up' or direction == 'down': axis = 'y' # # define direction. if direction == 'up' or direction == 'left': vector = 0 smooth_scroll(marionette, screen, axis, vector, distance, increments) time.sleep(1) # compensate for the time taken for dynamic scroll
def scroll(self, locator, direction, distance, increments=None): """scroll - uses smooth_scroll method in gestures.py. direction = 'up' or 'down' (page location) distance = total distance to travel increments = rate of scroll perform release afterwards """ screen = self.marionette.find_element(*locator) vector = 0 axis = 'x' if direction == 'up' or direction == 'down': axis = 'y' # # define direction. if direction == 'up' or direction == 'left': vector = -1 smooth_scroll(self.marionette, screen, axis, vector, distance, increments)
def scroll(self, locator, direction, distance, increments=None): """scroll - uses smooth_scroll method in gestures.py. direction = 'up' or 'down' (page location) distance = total distance to travel increments = rate of scroll perform release afterwards """ screen = self.marionette.find_element(*locator) vector = -1 axis = 'x' if direction == 'up' or direction == 'down': axis = 'y' # # define direction. if direction == 'up' or direction == 'left': vector = 0 smooth_scroll(self.marionette, screen, axis, vector, distance, increments)