НУЖНО БОЛЬШЕ ДЕКОМПОЗИЦИИ

This commit is contained in:
Oleja123 2025-03-03 21:07:33 +04:00
parent 828e9ddef8
commit fbf31205a0
2 changed files with 15 additions and 8 deletions

View File

@ -40,3 +40,15 @@ def login(driver):
time.sleep(2) time.sleep(2)
driver.switch_to.default_content() driver.switch_to.default_content()
yield driver 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

View File

@ -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 from selenium.webdriver.common.by import By
import time import time
@ -20,13 +20,8 @@ def switcher(driver, ind):
return res return res
def test_navigation(login): def test_navigation(open_profile):
profile_icon_main = login.find_element( login = open_profile
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)
the_iframe_window = login.find_element(By.ID, "kw-iframe") the_iframe_window = login.find_element(By.ID, "kw-iframe")
login.switch_to.frame(the_iframe_window) login.switch_to.frame(the_iframe_window)
login.find_element(By.CLASS_NAME, 'button-back').click() login.find_element(By.CLASS_NAME, 'button-back').click()