From b59b79bcccf98306e7a7be10b26890776e9c4e47 Mon Sep 17 00:00:00 2001 From: Alena Krauch Date: Fri, 18 Apr 2025 22:10:53 +0300 Subject: [PATCH] update start_unauthorized_page_test.py, start_unauthorized_page_data.py, login_page_data.py --- test_data/login_page_data.py | 2 +- test_data/start_unauthorized_page_data.py | 12 +++++------- tests/start_unauthorized_page_test.py | 14 +++++++------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/test_data/login_page_data.py b/test_data/login_page_data.py index a7c02afad6..de451edbcf 100644 --- a/test_data/login_page_data.py +++ b/test_data/login_page_data.py @@ -2,4 +2,4 @@ class LoginPageData: - sign_in_tab = ["ВОЙТИ", "SIGN IN"] + sign_in_tab = ("ВОЙТИ", "SIGN IN") diff --git a/test_data/start_unauthorized_page_data.py b/test_data/start_unauthorized_page_data.py index 088a0c3861..ecae9e0bd9 100644 --- a/test_data/start_unauthorized_page_data.py +++ b/test_data/start_unauthorized_page_data.py @@ -7,12 +7,10 @@ class StartUnauthorizedPageData: tab_title = "BrainUp" - page_titles = [ - "BrainUP - онлайн занятия для детей и взрослых", "Преимущества", - "BrainUP - online classes for children and adults", "Advantages" - ] + page_titles = ("BrainUP - онлайн занятия для детей и взрослых", "Преимущества", + "BrainUP - online classes for children and adults", "Advantages") - page_subtitles = ["BRAINUP", "ОНЛАЙН ЗАНЯТИЯ", "РАЗВИТИЕ"] + page_subtitles = ("BRAINUP", "ОНЛАЙН ЗАНЯТИЯ", "РАЗВИТИЕ") text_on_page = { "text_in_section1": ( @@ -39,11 +37,11 @@ class StartUnauthorizedPageData: "в общении с друзьями и знакомыми.") } - login_link_text = ["Начать", "Login"] + login_link_text = ("Начать", "Login") login_link_href = f"{Links.URL_MAIN_PAGE}login" - login_link_status_code = 200 + login_link_status_code = (200,) page_url = Links.URL_MAIN_PAGE diff --git a/tests/start_unauthorized_page_test.py b/tests/start_unauthorized_page_test.py index 0e33d2d761..0ce8f9e952 100644 --- a/tests/start_unauthorized_page_test.py +++ b/tests/start_unauthorized_page_test.py @@ -14,7 +14,7 @@ def test_su_01_01_verify_page_presence_and_visibility(self, driver, main_page_op page = StartUnauthorizedPage(driver) page_content_presence = page.check_presence_of_page_content() page_content_visibility = page.check_visibility_of_page_content() - assert page_content_presence is not None, "The page content is absent in DOM" + assert page_content_presence, "The page content is absent in DOM" assert page_content_visibility, "The page content is invisible on the page" @allure.title("Verify amount and visibility of sections with content on the page") @@ -75,11 +75,11 @@ def test_su_02_02_verify_page_titles_and_subtitles(self, driver, main_page_open) title_values = page.get_values_of_titles() subtitle_values = page.get_values_of_subtitles() assert title_values, "Title values on the page are empty" - assert all(title_value in StartUnauthorizedPageData.page_titles for title_value in title_values), \ + assert all(element in StartUnauthorizedPageData.page_titles for element in title_values), \ "Titles on the page mismatch any valid values" assert subtitle_values, "Subtitle values on the page are empty" - assert all(subtitle_value in StartUnauthorizedPageData.page_subtitles for subtitle_value - in subtitle_values), "Subtitles mismatch any valid values" + assert all(element in StartUnauthorizedPageData.page_subtitles for element in subtitle_values), \ + "Subtitles mismatch any valid values" @allure.title("Verify content of the text in sections 1, 2") def test_su_02_03_verify_page_text(self, driver, main_page_open): @@ -90,8 +90,8 @@ def test_su_02_03_verify_page_text(self, driver, main_page_open): assert text_content_section1 in StartUnauthorizedPageData.text_on_page["text_in_section1"], \ "Text in the section 1 mismatches any valid values" assert text_content_section2, "The text content in the section 2 is empty" - assert text_content_section2 == StartUnauthorizedPageData.text_on_page["text_in_section2"], \ - "Text in the section 2 mismatches the valid values" + assert all(element in StartUnauthorizedPageData.text_on_page["text_in_section2"] + for element in text_content_section2), "Text in the section 2 mismatches any valid values" @allure.title("Verify text in the 'Login' link in the section 1") def test_su_02_04_verify_text_in_links(self, driver, main_page_open): @@ -116,7 +116,7 @@ def test_su_03_01_verify_login_link(self, driver, main_page_open): assert link_href, "Link href is empty" assert link_href == StartUnauthorizedPageData.login_link_href, \ "The attribute 'href' of the link mismatches the valid value" - assert link_status_code == StartUnauthorizedPageData.login_link_status_code, \ + assert link_status_code in StartUnauthorizedPageData.login_link_status_code, \ "The status code of the link mismatches the valid value" @allure.title("Verify that the 'Login' link leads to the correct page after clicking")