def preparation(): for cone in range(Properties.get_cones().get_size()): Properties.get_cones().get_by_number( cone).get_comms_remote().uncluster() Properties.get_cones().get_by_number( cone).get_comms_remote().wait_for_unclustering() if Properties.if_ios(): DeviceInstaller.uninstall_app_by_name() yield Searcher.reset_driver()
def swipe_down_from_element(element, swipe_percent=50, timeout=1, prim_timeout=0): return Searcher.swipe_down_from_element(element.locator, swipe_percent, timeout, prim_timeout)
def swipe_down(swipe_percent=50): return Searcher.swipe_down(swipe_percent)
def swipe_up(swipe_percent=50): return Searcher.swipe_up(swipe_percent)
def get_elements(self): """:rtype: list of appium.webdriver.webelement.WebElement""" return Searcher.find_elements(self.locator)
def long_press_on_element(element, time_to_hold=3): Searcher.long_press_on_element(element.get_element(), time_to_hold)
def tap_on(x, y): Searcher.tap_on(x, y)
def click_search_button_on_keyboard(): Searcher.click_search_button()
def back(): Searcher.back()
def decrease_volume_by_device_button(taps_quantity): for i in range(taps_quantity): Searcher.decrease_volume_by_device_button()
def _decrease_volume_by_application_button(taps_quantity): for i in range(taps_quantity): Searcher.decrease_volume_by_application_button()
def is_clickable(self, time_to_wait=10): return Searcher.is_element_clickable(self.locator, time_to_wait)
def is_presented(self, time_to_wait=10): return Searcher.is_element_presented(self.locator, time_to_wait)
def swipe_right(): Searcher.swipe_right()
def is_alert_present(): return Searcher.is_alert_present()
def swipe_left(): Searcher.swipe_left()
def get_alert_text(): return Searcher.get_alert_text()
def tap_on_screen_center(): Searcher.tap_on_screen_center()
def alert_accept(): Searcher.alert_accept()
def _move_element_to_element(from_element, to_element, time_to_hold=3): Searcher.long_press_to_element_and_move_to_other_element( from_element.get_element(), to_element.get_element(), time_to_hold)
def alert_decline(): Searcher.alert_decline()
def put_app_in_background(time_idle): Searcher.put_app_in_background(time_idle)
def get_element(self): """:rtype: appium.webdriver.webelement.WebElement""" self.element = Searcher.find_element(self.locator) return self.element