def cones_settings_click(name): ConesPage.__swipe_from() if Properties.if_ios(): ConesPage.return_settings_button().click() ConesPage.choose_by_name(name) else: locator = Properties.get_cones_page_locator_map().get_locator( ConesPageLocators.coneSettings) locator.locator = locator.locator.replace("TEXT_TO_CHANGE", name) settings_button = Button(locator) location = settings_button.get_location() size = settings_button.get_size() x = location["x"] y = location["y"] + size["height"] // 2 Button(locator).click() ConesPage.tap_on(x, y)
def return_cone_by_name(name): locator = Properties.get_cones_page_locator_map().get_locator( ConesPageLocators.cone) locator.locator = locator.locator.replace("TEXT_TO_CHANGE", name) return Button(locator)
def done_click(): Button(Properties.get_cones_page_locator_map().get_locator( ConesPageLocators.done)).click()
def is_slave(): return Button(Properties.get_cones_page_locator_map().get_locator( ConesPageLocators.slaveLastCone)).is_presented()
def is_master(): return Button(Properties.get_cones_page_locator_map().get_locator( ConesPageLocators.masterCone)).is_presented()
def return_unlink_cone(): return Button(Properties.get_cones_page_locator_map().get_locator( ConesPageLocators.unlinkCone))
def return_pop_up_ok(): return Button(Properties.get_cones_page_locator_map().get_locator( ConesPageLocators.popUpOK))
def return_link_to_cone(): return Button(Properties.get_cones_page_locator_map().get_locator( ConesPageLocators.linkToCone))
def cones_settings_popup(name): ConesPage.__swipe_from() locator = Properties.get_cones_page_locator_map().get_locator( ConesPageLocators.coneSettings) locator.locator = locator.locator.replace("TEXT_TO_CHANGE", name) Button(locator).click()
def return_done_button(): return Button(Properties.get_cones_page_locator_map().get_locator( ConesPageLocators.done))
def return_settings_button(): return Button(Properties.get_cones_page_locator_map().get_locator( ConesPageLocators.coneSettings))
def return_user_name_button(): return Button(Properties.get_cones_page_locator_map().get_locator( ConesPageLocators.userName))