def test003(start_browser, address): """ Test type - positive Edit product :param start_browser: browser run :param address: fixture with parametrized url of opencart """ driver, proxy = start_browser driver.get(address) with allure.step('Authorization in admin login mask'): authorize_as_admin(driver, login="******", password="******") with allure.step('Adding new product'): add_new_product(driver, product_name="Test product", meta_tag="Test meta tag", model="Test model") with allure.step('Editing product'): filter_products_by_name(driver, product_name="Test product") ProductPage.find_and_click_edit_button(driver) ProductPage.clear_product_name_field(driver) ProductPage.input_product_name(driver, product_name="Edited test product") ProductPage.save_new_product_button_click(driver) with allure.step('Looking for edited product'): ProductPage.clear_filter_name_filed(driver) filter_products_by_name(driver, product_name="Edited test product") products = ProductPage.find_product_name(driver) for product in products: assert "Edited test product" in product.text with allure.step('Removing product'): filter_products_by_name(driver, product_name="Edited test product") delete_all_products(driver) ProductPage.accept_product_delete(driver) proxy_logs_write(proxy) web_logging(driver, log_file='web_log.log')
def test006(start_browser, address): """ Test type - positive add new menu field and drug and drop it :param start_browser: browser run :param address: fixture with parametrized url of opencart """ driver, proxy = start_browser driver.get(address) with allure.step('Authorization in admin login mask'): demo_authorize_as_admin(driver, login="******", password="******") with allure.step('Adding new menu field'): add_new_menu_field(driver) with allure.step('Looking for added menu field'): MenuConstructor.check_computer_element(driver) proxy_logs_write(proxy) web_logging(driver, log_file='web_log.log')
def test005(start_browser, address): """ Test type - positive Add new file to downloads menu :param start_browser: browser run :param address: fixture with parametrized url of opencart """ driver, proxy = start_browser driver.get(address) file_url = "/home/zhukov/Pictures/opencart_images/index.jpeg" with allure.step('Authorization in admin login mask'): authorize_as_admin(driver, login="******", password="******") with allure.step('Adding file to opencart'): add_file_to_opencart(driver, file_url, file_name="Test file") with allure.step('Removing downloaded file'): DownloadsPage.select_downloaded_file(driver) DownloadsPage.delete_selected_file(driver) proxy_logs_write(proxy) web_logging(driver, log_file='web_log.log')
driver, proxy = start_browser driver.get(address) with allure.step('Authorization in admin login mask'): authorize_as_admin(driver, login="******", password="******") with allure.step('Adding new product'): add_new_product(driver, product_name="Test product", meta_tag="Test meta tag", model="Test model") filter_products_by_name(driver, product_name="Test product") with allure.step('Looking for created product'): products = ProductPage.find_product_name(driver) for product in products: logging.debug(product) assert "Test product" in product.text with allure.step('Removing product'): delete_all_products(driver) ProductPage.accept_product_delete(driver) proxy_logs_write(proxy) web_logging(driver, log_file='web_log.log') @allure.title('002 Critical: Remove new product') @allure.severity("critical") @pytest.mark.env("opencart") def test002(start_browser, address): """ Test type - positive Delete product :param start_browser: browser run :param address: fixture with parametrized url of opencart """ driver, proxy = start_browser driver.get(address)