def test_invalid_email(driver, url): """Отправка невалидного значения почтового ящика для восстановления пароля""" with allure.step("Переход на страницу восстановления пароля"): AdminPage(driver, url).open() with allure.step("Отправка невалидного значения почтового ящика"): AdminPage(driver, url).forgotten_password("Test") with allure.step("Появление сообщения о неуспешном действии"): AlertMSG(driver).check_alert_danger()
def test_logout(driver, url): """Выход из панели администратора""" with allure.step("Авторизация на странице администратора"): AdminPage(driver, url).open().login(login="******", password="******") with allure.step("Выход из аккаунта администратора"): AdminBar(driver).logout() with allure.step("Сравнение заголовка страницы"): assert AdminPage(driver).title() == "Administration"
def test_create_product_plus(driver, url): """Успешное добавление продукта с заполнением требуемых полей и фотографии товара""" p_name = "Alcatel OT-890" p_meta_teg_title = "Android 2.1" p_model = "Product 2011" p_photo = "OT890.jpg" with allure.step("Авторизация на странице администратора"): AdminPage(driver, url).open().login(login="******", password="******") with allure.step("Переход в раздел каталога Products"): NavigationBar(driver).catalog().products() with allure.step("Нажатие кнопки Add New"): ButtonGroup(driver).add_new() with allure.step("Заполнение обязательных полей формы"): ProductsPage(driver) \ .fill_required_fields(p_name, p_meta_teg_title, p_model) with allure.step("Добавление изображения"): ProductsPage(driver).upload_new_image(p_photo) with allure.step("Установка изображения"): ProductsPage(driver).choose_image(p_photo) with allure.step("Нажатие кнопки Save"): ButtonGroup(driver).save() with allure.step("Появление сообщения об успешном действии"): AlertMSG(driver).check_alert_success()
def test_edit_product(driver, url): """Успешное редактирование продукта по заданному порядковому номеру, с добавлением описания продукта""" p_description = "Alcatel OT-890 supports GSM frequency. Official announcement date is " \ "February 2011. The device is working on an Android OS, v2.1 (Eclair) " \ "with a 420 MHz processor. Alcatel OT-890 has 150 MB of built-in memory. " \ "This device has a Mediatek MT6516 chipset. The main screen size is 2.8 " \ "inches with 320 x 240 pixels resolution. It has a 143 ppi pixel density. " \ "The screen covers about 38.1% of the device's body. " \ "This is an average result." with allure.step("Авторизация на странице администратора"): AdminPage(driver, url).open().login(login="******", password="******") with allure.step("Переход в раздел каталога Products"): NavigationBar(driver).catalog().products() with allure.step("Нажатие кнопки Edit напротив продукта"): ProductsPage(driver).edit_product(number=2) with allure.step("Добавление описания продукта"): ProductsPage(driver).fill_description(p_description) with allure.step("Нажатие кнопки Save"): ButtonGroup(driver).save() with allure.step("Появление сообщения об успешном действии"): AlertMSG(driver).check_alert_success()
def test_save_profile(driver, url): """Сохранение информации в профайле""" with allure.step("Авторизация на странице администратора"): AdminPage(driver, url).open().login(login="******", password="******") with allure.step("Переход в профиль аккаунта"): AdminBar(driver).your_profile() with allure.step("Сохранение изменений"): ProfilePage(driver).save_changes() with allure.step("Появление сообщения об успешном действии"): AlertMSG(driver).check_alert_success()
def test_clearing_theme_cache(driver, url): """Очистка кеша темы в настройках""" with allure.step("Авторизация на странице администратора"): AdminPage(driver, url).open().login(login="******", password="******") with allure.step("Переход в настройки"): DashBoardPage(driver).settings() with allure.step("Очистка кеша"): DashBoardPage(driver).refresh_theme_cache() with allure.step("Появление сообщения об успешном действии"): AlertMSG(driver).check_alert_success()
def test_copy_product(driver, url): """Копирование выбранных продуктов""" with allure.step("Авторизация на странице администратора"): AdminPage(driver, url).open().login(login="******", password="******") with allure.step("Переход в раздел каталога Products"): NavigationBar(driver).catalog().products() with allure.step("Выбор продуктов"): ProductsPage(driver).choose_products(number=2, quantity=2) with allure.step("Нажатие кнопки Copy"): ButtonGroup(driver).copy() with allure.step("Появление сообщения об успешном действии"): AlertMSG(driver).check_alert_success()
def test_delete_products(driver, url): """Успешное удаление продуктов по заданному порядковому номеру и количеству""" with allure.step("Авторизация на странице администратора"): AdminPage(driver, url).open().login(login="******", password="******") with allure.step("Переход в раздел каталога Products"): NavigationBar(driver).catalog().products() with allure.step("Выбор продуктов"): ProductsPage(driver).choose_products(number=1, quantity=1) with allure.step("Нажатие кнопки Delete"): ButtonGroup(driver).delete().accept() with allure.step("Появление сообщения об успешном действии"): AlertMSG(driver).check_alert_success()
def test_upload_file(driver, url): """Добавление файла в форму загрузки""" file = "Alcatel_OT_890_EN.pdf" download_name = "Alcatel OT-890 Manual" with allure.step("Авторизация на странице администратора"): AdminPage(driver, url).open().login(login="******", password="******") with allure.step("Переход в раздел каталога Downloads"): NavigationBar(driver).catalog().downloads() with allure.step("Нажатие кнопки Add New"): ButtonGroup(driver).add_new() with allure.step("Загрузка файла"): DownloadsPage(driver).upload_file(file, download_name) with allure.step("Нажатие кнопки Save"): ButtonGroup(driver).save() with allure.step("Появление сообщения об успешном действии"): AlertMSG(driver).check_alert_success()
def test_admin_page(driver, url): """Вход в панель администратора с невалидными данными, получение алертинга с ошибкой""" with allure.step("Авторизация на странице администратора"): AdminPage(driver, url).open().login(login="******", password="******") with allure.step("Появление сообщения об успешном действии"): AlertMSG(driver).check_alert_danger()