def test_confirm_the_mail(self): driver = self.driver steps_mail = DataMail(driver) steps_main = MainPage(driver) steps_user = PaymNotYandexRu(driver) steps_popup = PopupSignIn(driver) with allure.step("Авторизоваться в почте mail П [email protected]"): steps_mail.login_in_accaunt_user_Paymnotyandex_check_mail() with allure.step("Зайти в пришедшее письмо и подтверить почту"): steps_mail.open_mail_click_on_the_link_to_confirm_the_mail() with allure.step("Перейти на сайт ИУ на главную страницу"): steps_main.go_to_internetUrok() with allure.step("Нажать на кнопку Войти"): steps_main.go_to_sgnIn() with allure.step("Ввожу [email protected]/password=123456"): steps_user.enter_email() steps_user.enter_password() with allure.step("Нажать на кнопку Авторизоваться"): steps_popup.click_button_login() with allure.step("После авторизации у П не отображается нотификация " "Подтвердите адрес электронной почты в течение 48 ч." " "): self.assertFalse( self.is_element_present(By.CSS_SELECTOR, "div.top-banner__buttons")) with allure.step( "После авторизации у П отображается нотификация (Адрес электронной почты успешно подтвержден)" ): self.assertEqual( u"Адрес электронной почты успешно подтвержден", driver.find_element_by_css_selector("p.top-banner__text").text)
def test_001_open_popup(self): driver = self.driver steps_user = PopupSignIn(driver) steps_main = MainPage(driver) steps_main.go_to_sgnIn() steps_user.go_to_popup_registration() time.sleep(0.5)
def test_user_ask_question_in_free_lesson(self): driver = self.driver main_steps = MainPage(driver) popup_steps = PopupSignIn(driver) user_steps = AutopaymentMailRu(driver) delete_steps = Cycles(driver) user = PageFreeLessonQuestion(driver) get_url = URLFreeLesson(driver) with allure.step("Нажать на кнопку Войти"): main_steps.go_to_sgnIn() with allure.step("Ввожу [email protected]/password=123456"): user_steps.enter_email() user_steps.enter_password() with allure.step("Нажать на кнопку Авторизоваться"): popup_steps.click_button_login() with allure.step("Перейти на урок =Развитие эволюционных взглядов в додарвиновский период"): get_url.go_biology_11_grade_questions() with allure.step("Удалить существующие вопросы в списке"): delete_steps.delete_all_question() with allure.step("Ввести текст в поле ввода Привет Yonga"): user.ask_question() with allure.step("Нажать на кнопку Отправить"): user.post_question() with allure.step("Проверяю отображение опубликованного в списке Вопроса"): # assert (self.driver.find_element_by_css_selector("p.comment__text")) self.assertEquals(u"Привет Yonga", self.driver.find_element_by_css_selector("p.comment__text").text)
def test_user_ask_question_In_pay_lesson(self): driver = self.driver main_steps = MainPage(driver) popup_steps = PopupSignIn(driver) user_steps = PaymNotYandexRu(driver) user = PagePaidLessonQuestion(driver) get_url = URLPaidLesson(driver) delete_steps = Cycles(driver) with allure.step("Нажать на кнопку Войти"): main_steps.go_to_sgnIn() with allure.step("Ввожу [email protected]/password=123456"): user_steps.enter_email() user_steps.enter_password() with allure.step("Нажать на кнопку Авторизоваться"): popup_steps.click_button_login() with allure.step("Перейти на урок =Химические элементы. Символы химических элементов"): get_url.go_chemistry_8_grade_questions() with allure.step("Удалить существующие вопросы в списке"): delete_steps.delete_all_question() with allure.step("Ввести текст в поле ввода Привет Rich"): user.ask_question() with allure.step("Нажать на кнопку Отправить"): user.post_question() with allure.step("Проверяю отображение опубликованного в списке Вопроса"): # self.assertEqual(u"Привет Rich", self.driver.find_element_by_css_selector("p.comment__text").text) self.assertEquals(u"Привет Rich", self.driver.find_element_by_css_selector("p.comment__text").text)
def test_user_write_comment_in_free_lesson(self): driver = self.driver steps_page = MainPage(driver) popup_steps = PopupSignIn(driver) user_steps = AutopaymentMailRu(driver) user = PageFreeLessonComment(driver) get_url = URLFreeLesson(driver) with allure.step("Нажать на кнопку Войти"): steps_page.go_to_sgnIn() with allure.step("Ввожу [email protected]/password=123456"): user_steps.enter_email() user_steps.enter_password() with allure.step("Нажать на кнопку Авторизоваться"): popup_steps.click_button_login() with allure.step("Перейти на урок =Обзор эволюционных представлений"): get_url.go_biology_11_grade_comment() with allure.step("На странице урока нажать на кнопку Комментарии"): user.click_button_comments() with allure.step("Ввести текст в поле ввода Привет Yonga"): user.wtire_comment() with allure.step("Нажать на кнопку Отправить"): user.post_comment() with allure.step("Проверяю отображение опубликованного в списке комментария"): self.assertEquals(u"Привет Yonga", self.driver.find_element_by_xpath("//div/div[2]/p").text) with allure.step("Удалить опубликованный комментарий"): user.delete_comment()
def test_user_extend_abonement(self): driver = self.driver main_steps = MainPage(driver) popup_steps = PopupSignIn(driver) user_steps = PaymNotYandexRu(driver) main_steps.go_to_sgnIn() user_steps.enter_email() user_steps.enter_password() popup_steps.click_button_login() for el in range(2): try: self.driver.find_element_by_link_text("Привет") print('Ok. Found on %s iteration' % el) break except NoSuchElementException: driver.get("https://web-dev01.interneturok.ru/signout") main_steps.go_to_sgnIn() user_steps.enter_email() user_steps.enter_password() popup_steps.click_button_login() raise NoSuchElementException
def test_simulator_passed_in_pay_lesson(self): driver = self.driver main_steps = MainPage(driver) user_steps = PaymNotYandexRu(driver) popup_steps = PopupSignIn(driver) steps_exercise = Exercise(driver) get_url = URLPaidLesson(driver) with allure.step("Нажать на кнопку Войти"): main_steps.go_to_sgnIn() with allure.step("Ввожу [email protected]/password=123456"): user_steps.enter_email() user_steps.enter_password() with allure.step("Нажать на кнопку Авторизоваться"): popup_steps.click_button_login() with allure.step("Перейти на урок =Плотность"): get_url.go_physics_7_grade_trainers() with allure.step("Нажать на кнопку Пройти"): steps_exercise.go_exercise() with allure.step("Начать отвечать на ответы в Тренажере"): steps_exercise.test() with allure.step("Нажать на кнопку Завершить"): steps_exercise.click_button_finish() with allure.step("Пройденный Тренажёр помечается как Пройден"): self.assertEquals( u"Пройден", self.driver.find_element_by_css_selector( "span.result-mark.good").text) with allure.step( "После пройденного Тренажёра название кнопки Пройти поменялась на Повторить" ): self.assertEquals( u"Повторить", self.driver.find_element_by_xpath("//li/div[2]/span/a").text)
def test_user_reg_and_go_profile(self): driver = self.driver main_steps = MainPage(driver) popup_auth = PopupSignIn(driver) popup_reg = PopupRegistration(driver) user_steps = IuUseryopmail(driver) get_url = PageProfile(driver) with allure.step("Нажать на кнопку Войти"): main_steps.go_to_sgnIn() with allure.step("Перейти в поп-ап Регистрации"): popup_auth.go_to_popup_registration() with allure.step("Ввожу [email protected]/password=123456"): user_steps.reg_enter_email() user_steps.reg_enter_password() with allure.step("Нажать на кнопку Зарегистрироваться"): popup_reg.click_sign_up() with allure.step("Перейти в ЛК во вкладку /edit"): get_url.go_to_my_profile_edit() with allure.step( "В поле email отображается (почта[email protected]) зарегистрировшего пользователя" ): self.assertEqual( u"*****@*****.**", self.driver.find_element_by_css_selector( "input.profile-input").get_attribute("value"))
def test_user_write_comment_in_pay_lesson(self): driver = self.driver main_steps = MainPage(driver) user_steps = PaymNotYandexRu(driver) popup_steps = PopupSignIn(driver) user = PagePaidLessonComment(driver) get_url = URLPaidLesson(driver) with allure.step("Нажать на кнопку Войти"): main_steps.go_to_sgnIn() with allure.step("Ввожу [email protected]/password=123456"): user_steps.enter_email() user_steps.enter_password() with allure.step("Нажать на кнопку Авторизоваться"): popup_steps.click_button_login() with allure.step( "Перейти на урок =Урок 17. Вопрос 3. Выполняйте проверку в уравнениях и неравенствах." ): get_url.go_algebra_11_grade_comment() with allure.step("На странице урока нажать на кнопку Комментарии"): user.click_link_comments() with allure.step("Ввести текст в поле ввода Привет Rich"): user.write_comment() with allure.step("Нажать на кнопку Отправить"): user.post_comment() with allure.step( "Проверяю отображение опубликованного в списке комментария"): self.assertEquals( u"Привет Rich", self.driver.find_element_by_css_selector( "p.comment__text").text) with allure.step("Удалить опубликованный комментарий"): user.delete_comment()
def test_user_note_in_pay_lesson(self): driver = self.driver main_steps = MainPage(driver) user_steps = PaymNotYandexRu(driver) popup_steps = PopupSignIn(driver) notes_steps = Notes(driver) get_url = URLPaidLesson(driver) with allure.step("Нажать на кнопку Войти"): main_steps.go_to_sgnIn() with allure.step("Ввожу [email protected]/password=123456"): user_steps.enter_email() user_steps.enter_password() with allure.step("Нажать на кнопку Авторизоваться"): popup_steps.click_button_login() with allure.step( "Перейти на урок =Химические элементы. Символы химических элементов" ): get_url.go_chemistry_8_grade_video() with allure.step("На странице урока нажать на виджет Заметка"): notes_steps.open_notes() with allure.step("В поле ввода ввести текст Hello"): notes_steps.write_note() with allure.step("Нажать на кнопку Сохранить"): notes_steps.save_note() with allure.step("Перейти в ЛК во вкладку Заметка"): notes_steps.go_to_profile() with allure.step("В ЛК отображается сохранённая Заметка"): self.assertEquals( "Hello", self.driver.find_element_by_css_selector( "p.profile-content__note").text)
def test_000_logged_user(self): StartInterneturokClassMethod = self.driver steps_main = MainPage(StartInterneturokClassMethod) steps_user = AutopaymentMailRu(StartInterneturokClassMethod) steps_popup = PopupSignIn(StartInterneturokClassMethod) steps_main.go_to_sgnIn() steps_user.enter_email() steps_user.enter_password() steps_popup.click_button_login()
def test_10_authorization_user(self): with allure.step("Авторизоваться пользователем"): driver = self.driver steps_main = MainPage(driver) user_step = AutopaymentMailRu(driver) steps_signIn = PopupSignIn(driver) self.driver.find_element_by_class_name( "popup-header__close").click() time.sleep(1) steps_main.go_to_sgnIn() user_step.enter_email() user_step.enter_password() steps_signIn.click_button_login()
def test_000_reg_user(self): driver = self.driver auth_vk = SocialVk(driver) get_main_page = MainPage(driver) activity_popup = PopupSignIn(driver) with allure.step("Зайти на сайт ВК, авторизоваться П (+79852635831/Testng1991)"): auth_vk.auth_user_vk() with allure.step("Перейти на главную страницу ИУ"): get_main_page.go_to_internetUrok() with allure.step("Нажать на кнопку Войти"): get_main_page.go_to_sgnIn() with allure.step("В поп-апе авторизации нажать на кнопку Регистрация"): activity_popup.go_to_popup_registration() with allure.step("В поп-апе регистрации нажать на иконку соцсети ВК"): activity_popup.click_button_vk_reg() with allure.step("Переключится на окно dev-passport"): self.driver.switch_to_window(driver.window_handles[-1]) with allure.step("В окне Регистрации dev-passport отображается заголовок с текстом (Регистрация)"): self.assertEqual(u"Регистрация", driver.find_element_by_css_selector("h3").text) with allure.step("В окне Регистрации dev-passport отображается имя П (Zhelty Drus)"): self.assertEqual("Zhelty Drus", driver.find_element_by_css_selector("p.b-oauth-user__name").text) with allure.step("В окне Регистрации dev-passport отображается E-mail П ([email protected])"): self.assertEqual("*****@*****.**", driver.find_element_by_css_selector("p.b-oauth-user__email").text) with allure.step("В окне Регистрации dev-passport отображается текст П ([email protected])"): self.assertEqual(u"Вы впервые на InternetUrok.ru или у вас уже есть аккаунт ?", driver.find_element_by_css_selector("p.center").text) with allure.step("В окне Регистрации dev-passport отображается кнопка (Я новый пользователь)"): self.assertEqual(u"Я новый пользователь", driver.find_element_by_link_text(u"Я новый пользователь").text) with allure.step("В окне Регистрации dev-passport отображается кнопка (У меня уже есть аккаунт)"): self.assertEqual(u"У меня уже есть аккаунт", driver.find_element_by_link_text(u"У меня уже есть аккаунт").text) with allure.step("В окне Регистрации dev-passport нажать на кнопку (Я новый пользователь)"): auth_vk.click_button_new_user() with allure.step("В окне Регистрации dev-passport отображается текст (Для завершения регистрации....)"): self.assertEqual( u"Для завершения регистрации введите ваш e-mail. На указанный\nвами e-mail будет отправлено письмо с ссылкой для подтверждения.", driver.find_element_by_css_selector("p.center").text) with allure.step("В окне Регистрации dev-passport отображается текст (Действующий e-mail)"): self.assertEqual(u"Действующий e-mail", driver.find_element_by_css_selector("label").text) with allure.step( "В окне Регистрации dev-passport в блоке Действующий e-mail отображается E-mail П ([email protected])"): self.assertEqual("*****@*****.**", driver.find_element_by_id("user_email").get_attribute("value")) with allure.step("В окне Регистрации dev-passport нажать на кнопку (Зарегистрироваться)"): auth_vk.click_button_reg() with allure.step("Переключится на окно IU.ru"): self.driver.switch_to_window(driver.window_handles[0]) with allure.step("Дождаться регистрации и убедиться появляения нотификации (Проверить почту)"): assert (self.driver.find_element_by_link_text(u"Проверить почту"))
def test_000_logged_user(self): StartInterneturokClassMethod = self.driver steps_main = MainPage(StartInterneturokClassMethod) steps_user = AutopaymentMailRu(StartInterneturokClassMethod) steps_popup = PopupSignIn(StartInterneturokClassMethod) go_profile = PageProfile(StartInterneturokClassMethod) steps_main.go_to_sgnIn() steps_user.enter_email() steps_user.enter_password() steps_popup.click_button_login() with allure.step("Перейти в мой профиль"): go_profile.go_to_my_profile() with allure.step("Нажать на кнопку Оплатить абонемент"): go_profile.click_button_buy_subscription()
def test_buy_ticket_per_900_rubles(self): driver = self.driver steps_main = MainPage(driver) steps_user = PaymentnotMailRu(driver) steps_popup = PopupRegistration(driver) steps_in_profile = PageProfile(driver) refresh_page = RefreshPage(driver) with allure.step("Нажать на кнопку Войти"): steps_main.go_to_sgnIn() with allure.step("В поп-апе регистрации нажать Зарегистрироваться"): steps_popup.go_to_popup_registration() with allure.step("Ввожу [email protected]/password=123456"): steps_user.reg_enter_email() steps_user.reg_enter_password() with allure.step("Нажать на кнопку Зарегистрироваться"): steps_popup.click_sign_up() with allure.step("Перейти в мой профиль"): steps_in_profile.go_to_my_profile() with allure.step( "В ЛК, в виджете абонемент нажать на кнопку оплатить абонемент" ): steps_in_profile.click_button_buy_subscription() with allure.step("В поп-апе оплаты выбрать тариф 365 дней"): steps_in_profile.choose_subscription_365_day() with allure.step( "В поп-апе оплаты нажать на кнопку Оплатить абонемент"): steps_in_profile.popup_click_buy_subscription() with allure.step("На сайте ЯК ввести данные карты"): steps_in_profile.enter_data_card() with allure.step("Вернулся в Мой профиль"): steps_in_profile.go_to_my_profile() with allure.step("Обновить страницу"): refresh_page.refresh() assert (self.driver.find_element_by_css_selector( ".profile-abonement__row:nth-child(1)")) with allure.step( "В виджете отображается купленный абонемент с вкл автопродлением и тарифом 366 дней" ): self.assertIn( "Осталось:\n366 дней\nАвтопродление:\n\nВкл.\nПодробнее об абонементе Продлить абонемент", driver.find_element_by_css_selector( "div.profile-abonement__body").text)
def test_buy_ticket_per_100_rubles(self): driver = self.driver steps_main_page = MainPage(driver) steps_popup = PopupRegistration(driver) steps_user = PaymNotYandexRu(driver) steps_in_profile = PageProfile(driver) refresh_page = RefreshPage(driver) with allure.step("Нажать на кнопку Войти"): steps_main_page.go_to_sgnIn() with allure.step("В поп-апе регистрации нажать Зарегистрироваться"): steps_popup.go_to_popup_registration() with allure.step("Ввожу email/password = [email protected]"): steps_user.reg_enter_email() steps_user.reg_enter_password() with allure.step("Нажать на кнопку Зарегистрироваться"): steps_popup.click_sign_up() with allure.step("Перейти в мой профиль"): steps_in_profile.go_to_my_profile() with allure.step( "В ЛК, в виджете абонемент нажать на кнопку оплатить абонемент" ): steps_in_profile.click_button_buy_subscription() with allure.step("В поп-апе оплаты отключить автоплатеж"): steps_in_profile.popup_click_enable_autopayment() with allure.step( "В поп-апе оплаты нажать на кнопку Оплатить абонемент"): steps_in_profile.popup_click_buy_subscription() with allure.step("На сайте ЯК ввести данные карты"): steps_in_profile.enter_data_card() with allure.step("Вернулся в Мой профиль"): steps_in_profile.go_to_my_profile() with allure.step("Обновить страницу"): refresh_page.refresh() assert (self.driver.find_element_by_css_selector( ".profile-abonement__row:nth-child(1)")) with allure.step( "В виджете отображается купленный абонемент без автоплатежа с тарифом 31 день" ): self.assertIn( "Осталось:\n31 день\nАвтопродление:\nВыкл.\nПодробнее об абонементе Продлить абонемент", driver.find_element_by_css_selector( "div.profile-abonement__body").text)
def test_yes_stub_in_pay_lesson(self): driver = self.driver main_steps = MainPage(driver) popup_steps = PopupSignIn(driver) user_steps = AutopaymentMailRu(driver) get_url = URLPaidLesson(driver) with allure.step("Нажать на кнопку Войти"): main_steps.go_to_sgnIn() with allure.step("Ввожу [email protected]/password=123456"): user_steps.enter_email() user_steps.enter_password() with allure.step("Нажать на кнопку Авторизоваться"): popup_steps.click_button_login() with allure.step( "Перейти на урок= Химические элементы. Символы химических элементов" ): get_url.go_chemistry_8_grade_video() with allure.step("Проверить присутствие заглушки видеоурока"): self.assertTrue( self.is_element_present(By.CSS_SELECTOR, "div.video-blocker"))
def test_no_stub_in_pay_lesson(self): driver = self.driver main_steps = MainPage(driver) popup_steps = PopupSignIn(driver) user_steps = PaymNotYandexRu(driver) get_url = URLPaidLesson(driver) with allure.step("Нажать на кнопку Войти"): main_steps.go_to_sgnIn() with allure.step("Ввожу [email protected]/password=123456"): user_steps.enter_email() user_steps.enter_password() with allure.step("Нажать на кнопку Авторизоваться"): popup_steps.click_button_login() with allure.step( "Перейти на урок= Химические элементы. Символы химических элементов" ): get_url.go_chemistry_8_grade_video() with allure.step("Проверить отсуствия заглушки видеоурока"): self.assertFalse( self.is_element_present(By.CLASS_NAME, "video-blocker__body"))
def test_user_auth_and_go_profile(self): driver = self.driver main_steps = MainPage(driver) popup_steps = PopupSignIn(driver) user_steps = AutopaymentMailRu(driver) get_url = PageProfile(driver) with allure.step("Нажать на кнопку Войти"): main_steps.go_to_sgnIn() with allure.step("Ввожу [email protected]/password=123456"): user_steps.enter_email() user_steps.enter_password() with allure.step("Нажать на кнопку Авторизоваться"): popup_steps.click_button_login() with allure.step("Перейти в ЛК во вкладку /edit"): get_url.go_to_my_profile_edit() with allure.step( "В поле email отображается (почта[email protected]) зарегистрировшего пользователя" ): self.assertEqual( u"*****@*****.**", self.driver.find_element_by_css_selector( "input.profile-input").get_attribute("value"))
def test_000_click_button_buy_ticket_in_stub_video(self): driver = self.driver step_user = PaidLesson(driver) url_get = URLPaidLesson(driver) data_user = AutopaymentMailRu(driver) open_popup = MainPage(driver) click_enter = PopupSignIn(driver) with allure.step("Нажать на кнопку Войти"): open_popup.go_to_sgnIn() with allure.step("В поп-апе авторизации ввести email/password"): data_user.enter_email() data_user.enter_password() with allure.step("В поп-апе авторизации Нажать на кнопку Войти"): click_enter.click_button_login() with allure.step("Перейти на страницу урока во вкалдку Видеоурок"): url_get.go_chemistry_8_grade_video() with allure.step("Нажать на кнопку Оплатить абонемент"): step_user.click_button_buy_ticket_in_stubs() with allure.step("П редиректнуло на страницу оплаты"): self.driver.switch_to_window(driver.window_handles[1]) assert self.driver.current_url == 'https://staging.interneturok.ru/payment'
def test_user_extend_subscription(self): driver = self.driver main_steps = MainPage(driver) popup_steps = PopupSignIn(driver) user_steps = PaymNotYandexRu(driver) profile_steps = PageProfile(driver) refresh_page = RefreshPage(driver) with allure.step("Нажать на кнопку Войти"): main_steps.go_to_sgnIn() with allure.step("Ввожу [email protected]/password=123456"): user_steps.enter_email() user_steps.enter_password() with allure.step("Нажать на кнопку Авторизоваться"): popup_steps.click_button_login() with allure.step("Перейти в ЛК"): profile_steps.go_to_my_profile() with allure.step( "В ЛК, в виджете абонемент нажать на кнопку продлить абонемент" ): profile_steps.click_extend_subscription() with allure.step("В поп-апе оплаты нажать на кнопку Оплатить"): profile_steps.popup_click_buy_subscription() with allure.step("На сайте ЯК ввести данные карты"): profile_steps.enter_data_card() with allure.step("Вернуться в ЛК"): profile_steps.go_to_my_profile() with allure.step("Обновить страницу"): refresh_page.refresh() assert (self.driver.find_element_by_css_selector( ".profile-abonement__row:nth-child(1)")) with allure.step( "После продления абонемента в виджете отображается дата 62 дня" ): self.assertIn( "Осталось:\n62 дня\nАвтопродление:\n\nВкл.\nПодробнее об абонементе Продлить абонемент", driver.find_element_by_css_selector( "div.profile-abonement__body").text)
def test_auth_user(self): driver = self.driver get_main_page = MainPage(driver) activity_popup = PopupSignIn(driver) with allure.step("Зайти на сайт ИУ"): get_main_page.go_to_internetUrok() with allure.step("Навести курсор мышки на кнопку Мой профиль"): element_to_hover_over = self.driver.find_element_by_css_selector("div.header__title") hover = ActionChains(self.driver).move_to_element(element_to_hover_over) hover.perform() time.sleep(1) with allure.step("В меню Мой профиль нажать на кнопку Выйти"): get_main_page.click_button_exit_in_tab_my_profile() with allure.step("Нажать на кнопку Войти"): get_main_page.go_to_sgnIn() with allure.step("В поп-апе авторизации нажать на иконку соцсети ВК"): activity_popup.click_button_vk_auth() time.sleep(1) with allure.step("Обновить страницу"): driver.refresh() time.sleep(3) with allure.step("Дождать авторизации и убедиться что кнопка Войти поменялась на Мой профиль"): assert (self.driver.find_element_by_css_selector("div.header__menu.header__menu_profile"))
def test_000_click_button_buy_ticket_in_header(self): driver = self.driver step_user = PageAbonement(driver) url_get = URLAbonement(driver) data_user = AutopaymentMailRu(driver) open_popup = MainPage(driver) click_enter = PopupSignIn(driver) with allure.step("Нажать на кнопку Войти"): open_popup.go_to_sgnIn() with allure.step("В поп-апе авторизации ввести email/password"): data_user.enter_email() data_user.enter_password() with allure.step("В поп-апе авторизации Нажать на кнопку Войти"): click_enter.click_button_login() with allure.step("Перейти на страницу урока Абонемент"): url_get.go_page_class() with allure.step("Нажать на ссылку Оплатить абонемент"): url_get.click_link_abonement() with allure.step("Нажать на кнопку Оплатить абонемент"): step_user.click_button_buy_ticket_in_header() with allure.step("П редиректнуло на страницу оплаты"): self.driver.switch_to_window(driver.window_handles[1]) assert self.driver.current_url == 'https://staging.interneturok.ru/payment'
def test_user_off_auto_payment(self): driver = self.driver main_steps = MainPage(driver) popup_steps = PopupSignIn(driver) user_steps = VratchGlavYandexRu(driver) profile_steps = PageProfile(driver) refresh_page = RefreshPage(driver) with allure.step("Нажать на кнопку Войти"): main_steps.go_to_sgnIn() with allure.step("Ввожу [email protected]/password=123456"): user_steps.enter_email() user_steps.enter_password() with allure.step("Нажать на кнопку Авторизоваться"): popup_steps.click_button_login() with allure.step("Перейти в ЛК"): profile_steps.go_to_my_profile() with allure.step( "В виджете абонемент нажать на кнопку Выкл автоплатёж"): profile_steps.click_button_off_autopayment() with allure.step( "В появившемся тултипе нажать на кнопку Отключить автопродление" ): profile_steps.click_in_popup1_off_autopayment() with allure.step( "В появившемся поп-апе нажать на кнопку Отключить автопродление" ): profile_steps.click_in_popup2_off_autopayment() with allure.step("Обновить страницу"): refresh_page.refresh() with allure.step( "В ЛК, в виджете абонемента статус автоплатежа поменялся на ВЫКЛ" ): self.assertEquals( u"Выкл.", self.driver.find_element_by_css_selector("a.link_dotted").text)
def test_passed_in_free_lesson(self): driver = self.driver main_steps = MainPage(driver) user_steps = PaymNotYandexRu(driver) popup_steps = PopupSignIn(driver) steps_test = FreeTest(driver) get_url = URLFreeLesson(driver) with allure.step("Нажать на кнопку Войти"): main_steps.go_to_sgnIn() with allure.step("Ввожу [email protected]/password=123456"): user_steps.enter_email() user_steps.enter_password() with allure.step("Нажать на кнопку Авторизоваться"): popup_steps.click_button_login() with allure.step("Перейти на урок =Ленточные черви"): get_url.go_biology_7_grade_test() with allure.step("Нажать на кнопку Пройти"): steps_test.go_test() with allure.step("Отвечать на вопросы в тесте"): steps_test.start_test() with allure.step("В финальном поп-апе нажать на кнопку Завершить"): steps_test.click_button_finish() with allure.step("После пройденного Теста название кнопки Пройти поменялась на Повторить"): self.assertEquals(u"Повторить", self.driver.find_element_by_xpath("//li/div[2]/span/a").text)
def test_001_open_popup(self): driver = self.driver steps_main = MainPage(driver) steps_main.go_to_sgnIn()