Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
13 changes: 6 additions & 7 deletions tests/contacts_page_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,32 +83,31 @@ 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):
page = ctPage(driver)
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")
Expand All @@ -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), \
Expand Down