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
2 changes: 1 addition & 1 deletion test_data/login_page_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


class LoginPageData:
sign_in_tab = ["ВОЙТИ", "SIGN IN"]
sign_in_tab = ("ВОЙТИ", "SIGN IN")
12 changes: 5 additions & 7 deletions test_data/start_unauthorized_page_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": (
Expand All @@ -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

Expand Down
14 changes: 7 additions & 7 deletions tests/start_unauthorized_page_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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):
Expand All @@ -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):
Expand All @@ -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")
Expand Down