From 2d222680205785509502df71450c5eab148d86ec Mon Sep 17 00:00:00 2001 From: Oleja123 Date: Mon, 3 Mar 2025 21:39:06 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=D0=B4=D0=BD?= =?UTF-8?q?=D0=B8=D0=B9=20=D0=BD=D0=B0=20=D1=81=D0=B5=D0=B3=D0=BE=D0=B4?= =?UTF-8?q?=D0=BD=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common_fixtures.py | 10 +++++++++- test_profile_module.py | 26 +++++++++++++++++++++----- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/common_fixtures.py b/common_fixtures.py index 1bd36df..1161644 100644 --- a/common_fixtures.py +++ b/common_fixtures.py @@ -51,4 +51,12 @@ def open_profile(login): "arguments[0].scrollIntoView(true);", profile_icon_main) profile_icon_main.click() time.sleep(2) - yield login \ No newline at end of file + 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() + profile_icon_window = login.find_element( + By.XPATH, "//*[@id='root']/div/div[1]/div[1]/div[1]/button[1]/img") + profile_icon_window.click() + time.sleep(2) + + yield login diff --git a/test_profile_module.py b/test_profile_module.py index 108d8fd..6c7aaa7 100644 --- a/test_profile_module.py +++ b/test_profile_module.py @@ -22,13 +22,9 @@ def switcher(driver, ind): 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() profile_icon_window = login.find_element( By.XPATH, "//*[@id='root']/div/div[1]/div[1]/div[1]/button[1]/img") - profile_icon_window.click() - time.sleep(2) + login = open_profile menu_len = len(login.find_elements(By.CLASS_NAME, 'account-menu__item')) profile_icon_window.click() time.sleep(2) @@ -40,3 +36,23 @@ def test_navigation(open_profile): time.sleep(2) login.switch_to.default_content() assert res == True + + +def test_profile_changes(open_profile): + driver = open_profile + profile_icon_window = driver.find_element( + By.XPATH, "//*[@id='root']/div/div[1]/div[1]/div[1]/button[1]/img") + time.sleep(2) + driver.find_element(By.XPATH, "/html/body/div[2]/nav/a[2]").click() + time.sleep(1) + name_field = driver.find_element(By.NAME, "first_name") + surname_field = driver.find_element(By.NAME, "last_name") + father_name = driver.find_element(By.NAME, "middle_name") + name_field.clear() + surname_field.clear() + father_name.clear() + name_field.send_keys('a') + surname_field.send_keys('a') + father_name.send_keys('a') + time.sleep(2) +