From fbf31205a0f35f0847141053bfa9f679c01869c5 Mon Sep 17 00:00:00 2001 From: Oleja123 Date: Mon, 3 Mar 2025 21:07:33 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=A3=D0=96=D0=9D=D0=9E=20=D0=91=D0=9E?= =?UTF-8?q?=D0=9B=D0=AC=D0=A8=D0=95=20=D0=94=D0=95=D0=9A=D0=9E=D0=9C=D0=9F?= =?UTF-8?q?=D0=9E=D0=97=D0=98=D0=A6=D0=98=D0=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common_fixtures.py | 12 ++++++++++++ test_profile_module.py | 11 +++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/common_fixtures.py b/common_fixtures.py index 8775150..1bd36df 100644 --- a/common_fixtures.py +++ b/common_fixtures.py @@ -40,3 +40,15 @@ def login(driver): time.sleep(2) driver.switch_to.default_content() yield driver + + +@pytest.mark.order(3) +@pytest.fixture() +def open_profile(login): + profile_icon_main = login.find_element( + By.XPATH, "//*[@id='root']/div/div/nav/div/div[1]/div") + login.execute_script( + "arguments[0].scrollIntoView(true);", profile_icon_main) + profile_icon_main.click() + time.sleep(2) + yield login \ No newline at end of file diff --git a/test_profile_module.py b/test_profile_module.py index 6de999c..108d8fd 100644 --- a/test_profile_module.py +++ b/test_profile_module.py @@ -1,4 +1,4 @@ -from common_fixtures import driver, login +from common_fixtures import driver, login, open_profile from selenium.webdriver.common.by import By import time @@ -20,13 +20,8 @@ def switcher(driver, ind): return res -def test_navigation(login): - profile_icon_main = login.find_element( - By.XPATH, "//*[@id='root']/div/div/nav/div/div[1]/div") - login.execute_script( - "arguments[0].scrollIntoView(true);", profile_icon_main) - profile_icon_main.click() - time.sleep(2) +def test_navigation(open_profile): + login = open_profile the_iframe_window = login.find_element(By.ID, "kw-iframe") login.switch_to.frame(the_iframe_window) login.find_element(By.CLASS_NAME, 'button-back').click()