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) +