From 8ee4a63457c1d06915781a7d76f421725e9ff72e Mon Sep 17 00:00:00 2001 From: Alena Krauch Date: Wed, 14 May 2025 16:43:08 +0300 Subject: [PATCH] update contacts_page_test.py, conftest.py --- tests/conftest.py | 3 ++- tests/contacts_page_test.py | 13 ++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 8a4d647585..a118c3230f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -5,6 +5,7 @@ import pytest from dotenv import load_dotenv +from locators.contacts_page_locators import ContactsPageLocators from locators.header_page_locators import HeaderUnauthorizedLocators from locators.login_page_locators import LoginPageLocators from locators.main_page_locators import MainPageLocators @@ -37,7 +38,7 @@ def contacts_page_open(driver, main_page_open): page = BasePage(driver) page.element_is_present_and_clickable(HeaderUnauthorizedLocators.MORE_BUTTON).click() page.element_is_present_and_clickable(HeaderUnauthorizedLocators.LINK_CONTACTS).click() - time.sleep(1) + page.element_is_present(ContactsPageLocators.PAGE_TITLE) @pytest.fixture() diff --git a/tests/contacts_page_test.py b/tests/contacts_page_test.py index 2718edfca4..194c4e17d7 100644 --- a/tests/contacts_page_test.py +++ b/tests/contacts_page_test.py @@ -83,7 +83,7 @@ def test_cp_02_01_verify_tab_title(self, driver, contacts_page_open): page = ctPage(driver) tab_title_value = page.get_value_of_tab_title() assert tab_title_value, "The title value of the tab is empty" - assert tab_title_value in ctPD.tab_title, "The title on the tab doesn't match the valid value" + assert tab_title_value in ctPD.tab_title, "The tab title mismatches the valid value" @allure.title("Verify values of the title and subtitles with tags h1, h2 on the page") def test_cp_02_02_verify_page_title_and_subtitles(self, driver, contacts_page_open): @@ -91,24 +91,23 @@ def test_cp_02_02_verify_page_title_and_subtitles(self, driver, contacts_page_op title_value = page.get_value_of_title() subtitle_values = page.get_values_of_subtitles() assert title_value, "The title value on the page is empty" - assert title_value in ctPD.page_title, "The title on the page doesn't match the valid value" + assert title_value in ctPD.page_title, "The title on the page mismatches the valid value" assert subtitle_values, "Subtitle values on the page are empty" - assert all(element in ctPD.page_subtitles for element in subtitle_values), \ - "Subtitles mismatch any valid values" + assert all(element in ctPD.page_subtitles for element in subtitle_values), "Subtitles mismatch valid values" @allure.title("Verify content of the text in the section 2") def test_cp_02_03_verify_page_text(self, driver, contacts_page_open): page = ctPage(driver) text_content = page.get_text_content_on_page() assert text_content, "The text content in the section 2 is empty" - assert all(text in ctPD.text_on_page for text in text_content), "Text mismatches valid values" + assert all(element in ctPD.text_on_page for element in text_content), "Text mismatches valid values" @allure.title("Verify text in links in the section 2") def test_cp_02_04_verify_text_in_links(self, driver, contacts_page_open): page = ctPage(driver) links_text = page.get_text_in_links() assert links_text, "Text in links is empty" - assert all(text in ctPD.links_text for text in links_text), "Links text mismatches valid values" + assert all(element in ctPD.links_text for element in links_text), "Links text mismatches valid values" class TestContactsPageLinks: @allure.title("Verify presence, visibility, clickability, href, prefix, status code of links in the section 2") @@ -124,7 +123,7 @@ def test_cp_03_01_verify_links_in_section2(self, driver, contacts_page_open): assert links_visibility, "Links are invisible" assert links_clickability, "Links are unclickable" assert links_href, "Links href are empty" - assert all(href in ctPD.links_href for href in links_href), \ + assert all(element in ctPD.links_href for element in links_href), \ "Attributes 'href' of links mismatch valid values" assert link_prefix, "The attribute 'href' of the email link does not contain the proper prefix" assert all(element in ctPD.links_status_code for element in links_status_codes), \