def test_unsuccessful_authorization_password(self, login, password): """ Enter valid mail and invalid password to check authorization, get authorization error message text to verify the text of the error msg """ login_popup = LoginPopup() login_popup.authorize(login, password) assert 'Неправильный адрес электронной почты (email) или пароль' in login_popup.get_error_text_wrong_pass(), \ 'The text of the error msg about wrong password is different or absent'
def test_authorization_with_empty_field(self): """ Click the submit button, without entering login and password to check unsuccessful authorization getting authorization error message text """ login_popup = LoginPopup() login_popup.authorization_with_empty_field() assert login_popup.get_error_text_with_empty_login_pass() == 'Это обязательное поле',\ 'Text of the error doesnt match or absent'
def test_unsuccessful_authorization_mail(self, login, password): """ Enter invalid mail(without ".", without "@") and valid password to check authorization, gets authorization error message text to verify the text of the error message """ login_popup = LoginPopup() login_popup.authorize(login, password) assert 'Пожалуйста, введите правильный адрес электронной почты' in login_popup.get_error_text_wrong_email(), \ 'The text of the error msg about wrong email is different or absent'
def test_successful_authorization(self): """ Enter valid mail and valid password to check successful authorization, check whether popup after authorization with options is visible """ login_popup = LoginPopup() login_popup.authorize(login='******', password='******') time.sleep(1) panel = Panel() assert panel.is_popup_visible_after_authorization() is True, \ 'Popup after authorization is not visible or absent'
def test_recovery_success(self): """ Open the login popup, clicking on "Забыли пароль" btn, entering email, clicking "Получить новый пароль" btn", entering valid email, get recovery success message """ recovery_popup = self.main_page.click_forgot_pass() recovery_popup.recovery(mail='*****@*****.**') login_popup = LoginPopup() main_page = Body() login_popup.close_login_popup() time.sleep(2) assert 'Если на сайте существует учётная запись с адресом [email protected],' \ ' Вы получите письмо со ссылкой для смены пароля.' in main_page.get_recovery_success_msg_text(), \ 'The recovery success message is different or absent'
def open_login_popup(self): """ Click the login button to open the login PopUp, :return: object: LoginPopup """ self.wait.until(EC.presence_of_element_located( self.login_btn_header)).click() return LoginPopup()
def test_visibility_of_popup_elements(self): """ Check if the email field, password field, "Submit" btn, register link, "Stay on site" checkbox and 'The "Forgot password" link are visible in the login popup """ login_popup = LoginPopup() assert login_popup.is_email_field_visible( ) is True, 'The email field is not visible' assert login_popup.is_pass_field_visible( ) is True, 'The password field is not visible' assert login_popup.is_submit_btn_visible( ) is True, 'The "Submit" button is not visible' assert login_popup.is_checkbox_visible( ) is True, 'The checkbox "Stay on site" is not visible' assert login_popup.is_register_link_visible( ) is True, 'The registration link is not visible' assert login_popup.is_forgot_pass_link_visible( ) is True, 'The "Forgot password" link is not visible or absent'