From eae10c42e94eddd03becbdeae0dafb8d496072ea Mon Sep 17 00:00:00 2001 From: Alena Krauch Date: Sat, 12 Apr 2025 22:19:59 +0300 Subject: [PATCH] update footer_test.py, footer_data.py --- test_data/footer_data.py | 60 ++++++++++++++++------------------------ tests/footer_test.py | 12 ++++---- 2 files changed, 30 insertions(+), 42 deletions(-) diff --git a/test_data/footer_data.py b/test_data/footer_data.py index 3a4e703af7..75a8cdc3f0 100644 --- a/test_data/footer_data.py +++ b/test_data/footer_data.py @@ -3,44 +3,32 @@ class FooterData: - with_the_support_text = ["При поддержке", "With the support"] - contact_us_link_text = ["Обратная связь", "Contact us"] + with_the_support_text = ("При поддержке", "With the support") + contact_us_link_text = ("Обратная связь", "Contact us") link_titles = "brainupproject@yandex.ru" - links_href = [ - "https://arasaac.org/", - "mailto:brainupproject@yandex.ru?subject=BrainUp", - "https://epam.com/", - "https://www.jetbrains.com/", - "https://reg.ru/", - "https://selectel.ru/" - ] - - link_status_codes = [200, 301] - - images_src = [ - f"{Links.URL_MAIN_PAGE}logos/logo_ARASAAC_black-6aced95542b919137b28bced5be83596.png", - f"{Links.URL_MAIN_PAGE}logos/epam-cd401151c8ee5f14afbba10b72cd5fea.png", - f"{Links.URL_MAIN_PAGE}logos/jetbrains-variant-4_-fb6c06f46c4a6267ac60e84343940d8b.png", - f"{Links.URL_MAIN_PAGE}logos/reg-ru.svg", - f"{Links.URL_MAIN_PAGE}logos/selectel-f49f7fdb2061466c4f28aa1e128bd9a4.png" - ] - - images_alt = [ - "ARASAAC", - "EPAM", - "JetBrains", - "Регистратор доменных имен РЕГ.РУ", - "Selectel" - ] + links_href = ("https://arasaac.org/", + "mailto:brainupproject@yandex.ru?subject=BrainUp", + "https://epam.com/", + "https://www.jetbrains.com/", + "https://reg.ru/", + "https://selectel.ru/") + + link_status_codes = (200, 301) + + images_src = (f"{Links.URL_MAIN_PAGE}logos/logo_ARASAAC_black-6aced95542b919137b28bced5be83596.png", + f"{Links.URL_MAIN_PAGE}logos/epam-cd401151c8ee5f14afbba10b72cd5fea.png", + f"{Links.URL_MAIN_PAGE}logos/jetbrains-variant-4_-fb6c06f46c4a6267ac60e84343940d8b.png", + f"{Links.URL_MAIN_PAGE}logos/reg-ru.svg", + f"{Links.URL_MAIN_PAGE}logos/selectel-f49f7fdb2061466c4f28aa1e128bd9a4.png") + + images_alt = ("ARASAAC", "EPAM", "JetBrains", "Регистратор доменных имен РЕГ.РУ", "Selectel") # Related web pages urls - pages_urls = [ - "https://arasaac.org/", - "https://www.epam.com/", "https://epam.com/", - "https://www.jetbrains.com/", - "https://www.reg.ru/", "https://reg.ru/", - "https://www.reg.ru/?utm_source=brainup.site&utm_medium=referral&utm_campaign=brainup.site&utm_referrer=brainup.site", - "https://selectel.ru/" - ] + pages_urls = ("https://arasaac.org/", + "https://www.epam.com/", "https://epam.com/", + "https://www.jetbrains.com/", + "https://www.reg.ru/", "https://reg.ru/", + "https://www.reg.ru/?utm_source=brainup.site&utm_medium=referral&utm_campaign=brainup.site&utm_referrer=brainup.site", + "https://selectel.ru/") diff --git a/tests/footer_test.py b/tests/footer_test.py index 00918ce9ce..03e04ccad5 100644 --- a/tests/footer_test.py +++ b/tests/footer_test.py @@ -13,7 +13,7 @@ def test_fp_01_01_verify_footer_presence_and_visibility(self, driver, main_page_ page = FooterPage(driver) footer_presence = page.check_footer_presence() footer_visibility = page.check_footer_visibility() - assert footer_presence is not None, "The Footer is absent in DOM" + assert footer_presence, "The Footer is absent in DOM" assert footer_visibility, "The Footer is invisible" @allure.title("Verify composition and visibility of elements on the 1st-7th levels of nesting in the Footer") @@ -92,18 +92,18 @@ def test_fp_03_01_verify_footer_links(self, driver, main_page_open): assert contact_us_link_title, "The link title value is empty" assert contact_us_link_title in FooterData.link_titles, "The link title mismatches the valid value" assert links_href, "Links href are empty" - assert all(link_href in FooterData.links_href for link_href in links_href), \ + assert all(element in FooterData.links_href for element in links_href), \ "Attributes 'href' of links mismatch valid values" assert link_prefix_and_subject, \ "The attribute 'href' of the 'Contact us' link does not contain the proper prefix and/or subject" - assert all(status_code in FooterData.link_status_codes for status_code in link_status_codes), \ + assert all(element in FooterData.link_status_codes for element in link_status_codes), \ "Status codes of links mismatch valid values" @allure.title("Verify that links in the Footer lead to correct pages after clicking") def test_fp_03_02_verify_links_lead_to_the_correct_pages(self, driver, main_page_open): page = FooterPage(driver) new_tabs_urls = page.click_on_links() - assert all(tab_url in FooterData.pages_urls for tab_url in new_tabs_urls), \ + assert all(element in FooterData.pages_urls for element in new_tabs_urls), \ "Links in the Footer lead to incorrect pages after clicking or did not loaded during the allotted time" @allure.title("Verify that the 'Contact us' link in the Footer calls an email client") @@ -119,10 +119,10 @@ def test_fp_04_01_verify_images_attributes_in_links(self, driver, main_page_open images_src = page.get_images_src() images_alt = page.get_images_alt() assert images_src, "The 'src' attribute value of images is empty" - assert all(image_src in FooterData.images_src for image_src in images_src), \ + assert all(element in FooterData.images_src for element in images_src), \ "The 'src' attribute of some images mismatches valid values" assert images_alt, "The 'alt' attribute value of some images is empty" - assert all(image_alt in FooterData.images_alt for image_alt in images_alt), \ + assert all(element in FooterData.images_alt for element in images_alt), \ "The 'alt' attribute value of some images is empty or mismatches valid values" @allure.title("Verify sizes of images in links in the Footer")