class FailAuthPopUp: notification_popup = Locator( By.XPATH, "//div[contains(@class, 'notification')]", 'Попап нотификации') notification_popup_text = Locator( By.XPATH, "//div[contains(@class, 'notification')]//div[contains(@class, 'text')]", 'Текст попапа') notification_popup_btn = Locator( By.XPATH, "//div[contains(@class, 'notification')]//div[contains(@class, 'close')]", 'Кнопка попапа')
def get_client_passwd(self): locator = Locator(by=By.ID, value='passwd') return BaseElement(self.driver, locator=locator)
def uncheked_terms(self): locator = Locator(By.CLASS_NAME, value='fancybox-error') return BaseElement(self.driver, locator=locator)
def checkbox_terms(self): locator = Locator(By.ID, value='uniform-cgv') return BaseElement(self.driver, locator=locator)
def btn_continue_shopping(self): locator = Locator(By.CLASS_NAME, value='button-exclusive btn btn-default') return BaseElement(self.driver, locator=locator)
def btn_remove_qty(self): locator = Locator(by=By.CLASS_NAME, value='icon-minus') return BaseElement(self.driver, locator=locator)
def empty_cart_alert(self): locator = Locator(by=By.CSS_SELECTOR, value='#center_column > p') return BaseElement(self.driver, locator=locator)
def get_city_field(self): locator = Locator(by=By.ID, value='city') return BaseElement(self.driver, locator=locator)
def dropdown_state_field(self): locator = Locator(by=By.ID, value='id_state') return BaseElement(self.driver, locator=locator)
def get_last_name_field(self): locator = Locator(by=By.ID, value='email') return BaseElement(self.driver, locator=locator)
def get_address_second_field(self): locator = Locator(by=By.ID, value='address2') return BaseElement(self.driver, locator=locator)
def get_firstName_field(self): locator = Locator(by=By.ID, value='firstname') return BaseElement(self.driver, locator=locator)
def dropdown_birth_year(self): locator = Locator(By.ID, value='years') return BaseElement(self.driver, locator=locator)
def dropdown_birth_month(self): locator = Locator(By.ID, value='months') return BaseElement(self.driver, locator=locator)
def btn_proceed_to_checkout(self): locator = Locator(by=By.XPATH, value='//*[@id=\"center_column\"]/p[2]/a[1]/span') return BaseElement(self.driver, locator=locator)
def get_postalcode_field(self): locator = Locator(by=By.ID, value='postcode') return BaseElement(self.driver, locator=locator)
def input_qty(self): locator = Locator(by=By.XPATH, value="//*[@id='product_1_1_0_0']/td[5]/input[2]") return BaseElement(self.driver, locator=locator)
def dropdown_delivery_address(self): locator = Locator(By.ID, value='id_address_delivery') return BaseElement(self.driver, locator=locator)
def btn_trash(self): locator = Locator(by=By.CLASS_NAME, value='icon-trash') return BaseElement(self.driver, locator=locator)
def checkbox_billing_address(self): locator = Locator(By.ID, value='addressesAreEquals') return BaseElement(self.driver, locator=locator)
def final_price_products(self): locator = Locator(by=By.CSS_SELECTOR, value='.price[@id="total_price"]') return BaseElement(self.driver, locator=locator)
def btn_billing_address_update(self): locator = Locator(By.CSS_SELECTOR, value='div.row > div:nth-of-type(2)') return BaseElement(self.driver, locator=locator)
def btn_submit(self): locator = Locator(By.CLASS_NAME, value='button btn btn-default') return BaseElement(self.driver, locator=locator)
def btn_add_new_address(self): locator = Locator(By.CLASS_NAME, value='address_add submit') return BaseElement(self.driver, locator=locator)
def page_heading(self): locator = Locator(By.XPATH, value='//*[@id="carrier_area"]/h1') return BaseElement(self.driver, locator=locator)
def input_text_area(self): locator = Locator(By.CLASS_NAME, value='form-group') return BaseElement(self.driver, locator=locator)
class PaymentPage(BasePage): status_selector = Locator(By.CLASS_NAME, 'status-selector', 'Селектор статусов') gold_item = Locator(By.CLASS_NAME, 'gold', 'Статус Gold')
def page_heading(self): locator = Locator(By.CSS_SELECTOR, value='#center_column > h1') return BaseElement(self.driver, locator=locator)
class LoginPage(BasePage): BASE_URL = 'ibitcy.com/interview/qa/mobile-deposit/' login_input = Locator(By.NAME, 'username', 'Инпут логина') password_input = Locator(By.NAME, 'password', 'Инпут пароля') submit_btn = Locator(By.XPATH, "//div[contains(@class, 'submit gold')]//a", 'Кнопка отправки формы') en_btn = Locator(By.LINK_TEXT, 'EN', 'Кнопка выбора языка - EN') ch_btn = Locator(By.LINK_TEXT, 'CH', 'Кнопка выбора языка - CH') ko_btn = Locator(By.LINK_TEXT, 'KO', 'Кнопка выбора языка - KO') ru_btn = Locator(By.LINK_TEXT, 'RU', 'Кнопка выбора языка - RU') hi_btn = Locator(By.LINK_TEXT, 'HI', 'Кнопка выбора языка - HI') forgot_pass_btn = Locator( By.XPATH, "//div[contains(@class, 'amount-inputs')]//a[contains(@class, 'forgot')]", 'Кнопка "Забыл пароль"') forgot_pass_input = Locator( By.NAME, 'forgotPass', 'Инпут ввода емейла для восстановления пароля') forgot_pass_send_btn = Locator( By.XPATH, "//forgot-password//button[contains(@class, 'submit gold')]", 'Кнопка восстановить пароль') class FailAuthPopUp: notification_popup = Locator( By.XPATH, "//div[contains(@class, 'notification')]", 'Попап нотификации') notification_popup_text = Locator( By.XPATH, "//div[contains(@class, 'notification')]//div[contains(@class, 'text')]", 'Текст попапа') notification_popup_btn = Locator( By.XPATH, "//div[contains(@class, 'notification')]//div[contains(@class, 'close')]", 'Кнопка попапа')
def get_client_email(self): locator = Locator(by=By.ID, value='email') return BaseElement(self.driver, locator=locator)