def yamap_close(self): self.highlight_select(self._yandex_map_button).click() wait_for_element(self._yamap_close_button, option="clickable").click() try: self.highlight_select(self._yamap_popup) except NoSuchElementException: return True
def add_address_from_suggest(self, address): self.fill_address_form(address) wait_for_element(self._suggest_list) self.highlight_select(self._suggest_list) new_address = self.highlight_select(self._address_input_field).text self.highlight_select(self._submit_address_button).click() wait_for_element(self._user_addresses, option=new_address) return new_address
def add_address_from_yamap(self): self.highlight_select(self._yandex_map_button).click() wait_for_element(self._yamap_confirm_button, timeout=10, option="clickable").click() sleep(3) new_address = self.highlight_select(self._address_input_field).text self.driver.find_element(By.CSS_SELECTOR, self._submit_address_button).click() wait_for_element(self._user_addresses, option=new_address) return new_address
def yamap_zoom(self, zoom_style): self.highlight_select(self._yandex_map_button).click() wait_for_element(self._yamap_confirm_button, timeout=10, option="clickable") try: if zoom_style == "in": selector = self._yamap_zoom_in else: selector = self._yamap_zoom_out wait_for_element(selector, option="clickable") return True except TimeoutException: return
def close_overlay_widget(self): main_window = self.driver.current_window_handle wait_for_element(self._discount_widget, timeout=10, option="iframe") self.highlight_select(self._discount_notification_allow).click() self.driver.switch_to.window(main_window)
def delete_address(self, index): address = self.table_with_addresses()[index] address.find_element(By.CSS_SELECTOR, self._delete_address_button).click() wait_for_element(option="alert").accept()