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
10 changes: 5 additions & 5 deletions pages/groups_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,22 +112,22 @@ def check_visibility_of_subtitles(self):
# Checking text on the tab&page
@allure.step("Get value of the title of the tab on the 'ru' local")
def get_value_of_tab_title_ru(self):
self.click_on_ru_button()
# self.click_on_ru_button()
return self.get_current_tab_title()

@allure.step("Get value of the title of the tab on the 'en' local")
def get_value_of_tab_title_en(self):
self.click_on_en_button()
# self.click_on_en_button()
return self.get_current_tab_title()

@allure.step("Get value of the title with tag 'h3' on the 'ru' local")
def get_value_of_page_title_ru(self):
self.click_on_ru_button()
# self.click_on_ru_button()
return self.get_text(self.locators.PAGE_TITLE)

@allure.step("Get value of the title with tag 'h3' on the 'en' local")
def get_value_of_page_title_en(self):
self.click_on_en_button()
# self.click_on_en_button()
return self.get_text(self.locators.PAGE_TITLE)

@allure.step("Get the list of subtitle 'h4' values on the 'ru' local")
Expand All @@ -137,7 +137,7 @@ def get_values_of_subtitles_ru(self):

@allure.step("Get the list of subtitle 'h4' values on the 'en' local")
def get_values_of_subtitles_en(self):
self.click_on_en_button()
# self.click_on_en_button()
return [subtitle.text for subtitle in self.get_list_of_subtitles()]

# Checking links and buttons on the page
Expand Down
2 changes: 1 addition & 1 deletion test_data/links.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class MainPageLinks:
class ExercisesUrls:
STARTING_POINT = MainPageLinks.URL_GROUPS_PAGE

# Speech Exercises RU > Words
# Speech Exercises RU > Similar Phrases
URL_EXERCISES_RU_SIMILAR_PHRASES_PAGE = f"{STARTING_POINT}/2/series/2"

# Speech Exercises RU > Words
Expand Down
32 changes: 21 additions & 11 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

from locators.contacts_page_locators import ContactsPageLocators
from locators.contributors_page_locators import ContributorsPageLocators
from locators.header_page_locators import HeaderUnauthorizedLocators
from locators.groups_page_locators import GroupsPageLocators
from locators.header_page_locators import HeaderUnauthorizedLocators as huLocators
from locators.login_page_locators import LoginPageLocators
from locators.main_page_locators import MainPageLocators
from locators.start_unauthorized_page_locators import StartUnauthorizedPageLocators
Expand Down Expand Up @@ -40,8 +41,8 @@ def contributors_page_open(driver):
@allure.step(f'Open page: {MainPageLinks.URL_CONTACTS_PAGE}')
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()
page.element_is_present_and_clickable(huLocators.MORE_BUTTON).click()
page.element_is_present_and_clickable(huLocators.LINK_CONTACTS).click()
page.element_is_present(ContactsPageLocators.PAGE_TITLE)


Expand All @@ -53,21 +54,30 @@ def description_page_open(driver):

@pytest.fixture()
@allure.step(f'Open page: {ExercisesUrls.STARTING_POINT}')
def exercises_ru_page_open(driver, auto_test_user_authorized):
def groups_ru_page_open(driver, auto_test_user_authorized):
page = GroupsPage(driver)
page.element_is_present_and_clickable(HeaderUnauthorizedLocators.RU_BUTTON).click()
page.element_is_present_and_clickable(huLocators.RU_BUTTON).click()
page.element_is_present(GroupsPageLocators.PAGE_TITLE)


@pytest.fixture()
@allure.step(f'Open page: {ExercisesUrls.STARTING_POINT}')
def groups_en_page_open(driver, auto_test_user_authorized):
page = GroupsPage(driver)
page.element_is_present_and_clickable(huLocators.EN_BUTTON).click()
page.element_is_present(GroupsPageLocators.PAGE_TITLE)


@pytest.fixture()
@allure.step(f'Open page: {ExercisesUrls.URL_EXERCISES_RU_SIMILAR_PHRASES_PAGE}')
def exercises_ru_similar_phrases_page_open(driver, exercises_ru_page_open):
def exercises_ru_similar_phrases_page_open(driver, groups_ru_page_open):
driver.get(ExercisesUrls.URL_EXERCISES_RU_SIMILAR_PHRASES_PAGE)
time.sleep(3)


@pytest.fixture()
@allure.step(f'Open page: {ExercisesUrls.URL_EXERCISES_RU_WORDS_PAGE}')
def exercises_ru_words_page_open(driver, exercises_ru_page_open):
def exercises_ru_words_page_open(driver, groups_ru_page_open):
driver.get(ExercisesUrls.URL_EXERCISES_RU_WORDS_PAGE)
time.sleep(3)

Expand All @@ -84,17 +94,17 @@ def login_page_open(driver, main_page_open):
@allure.step(f'Open page: {MainPageLinks.URL_SPECIALISTS_PAGE}')
def specialists_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_SPECIALISTS).click()
page.element_is_present_and_clickable(huLocators.MORE_BUTTON).click()
page.element_is_present_and_clickable(huLocators.LINK_SPECIALISTS).click()
time.sleep(1)


@pytest.fixture()
@allure.step(f'Open page: {MainPageLinks.URL_USED_RESOURCES_PAGE}')
def used_resources_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_USED_RESOURCES).click()
page.element_is_present_and_clickable(huLocators.MORE_BUTTON).click()
page.element_is_present_and_clickable(huLocators.LINK_USED_RESOURCES).click()
time.sleep(1)


Expand Down
50 changes: 34 additions & 16 deletions tests/groups_page_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
class TestGroupsPage:
class TestGroupsPageStructure:
@allure.title("Verify presence and visibility of content on the page")
def test_gp_01_01_verify_page_presence_and_visibility(self, driver, auto_test_user_authorized):
def test_gp_01_01_verify_page_presence_and_visibility(self, driver, groups_ru_page_open):
page = gPage(driver)
page_content_presence = page.check_presence_of_page_content()
page_content_visibility = page.check_visibility_of_page_content()
assert page_content_presence, "The page content is absent in DOM"
assert page_content_visibility, "The page content is invisible"

@allure.title("Verify composition, visibility of elements on the 1st-6th levels of nesting on the page")
def test_gp_01_02_verify_page_structure_and_visibility(self, driver, auto_test_user_authorized):
def test_gp_01_02_verify_page_structure_and_visibility(self, driver, groups_ru_page_open):
page = gPage(driver)
structure_of_1st_level = page.get_structure_of_1st_level()
visibility_of_elements_on_1st_level = page.check_elements_visibility_on_1st_level()
Expand Down Expand Up @@ -44,7 +44,7 @@ def test_gp_01_02_verify_page_structure_and_visibility(self, driver, auto_test_u
assert visibility_of_elements_on_6th_level, "6th-level elements are invisible"

@allure.title("Verify presence, visibility of the title, tiles, links, images, subtitles on the page")
def test_gp_01_03_verify_page_structural_elements(self, driver, auto_test_user_authorized):
def test_gp_01_03_verify_page_structural_elements(self, driver, groups_ru_page_open):
page = gPage(driver)
title_on_2nd_level = page.check_title_presence()
title_visibility = page.check_title_visibility()
Expand All @@ -68,32 +68,50 @@ def test_gp_01_03_verify_page_structural_elements(self, driver, auto_test_user_a
assert subtitles_visibility, "Subtitles on the 6th level are invisible"

class TestGroupsPageText:
@allure.title("Verify value of the title of the tab")
def test_gp_02_01_verify_tab_title(self, driver, auto_test_user_authorized):
@allure.title("Verify value of the 'ru' title of the tab")
def test_gp_02_01_verify_ru_tab_title(self, driver, groups_ru_page_open):
page = gPage(driver)
tab_title_value_ru = page.get_value_of_tab_title_ru()
tab_title_value_en = page.get_value_of_tab_title_en()
assert tab_title_value_ru, "The title value of the tab is empty on the 'ru' local"
assert tab_title_value_ru == gPD.tab_title_ru, "The tab title mismatches the valid value on the 'ru' local"

@allure.title("Verify value of the 'en' title of the tab")
def test_gp_02_02_verify_en_tab_title(self, driver, groups_en_page_open):
page = gPage(driver)
tab_title_value_en = page.get_value_of_tab_title_en()
assert tab_title_value_en, "The title value of the tab is empty on the 'en' local"
assert tab_title_value_en == gPD.tab_title_en, "The tab title mismatches the valid value on the 'en' local"

@allure.title("Verify value of the title and subtitles on the page")
def test_gp_02_02_verify_page_title_and_subtitles(self, driver, auto_test_user_authorized):
@allure.title("Verify value of the 'ru' title on the page")
def test_gp_02_03_verify_ru_page_title(self, driver, groups_ru_page_open):
page = gPage(driver)
title_value_ru = page.get_value_of_page_title_ru()
subtitle_values_ru = page.get_values_of_subtitles_ru()
title_value_en = page.get_value_of_page_title_en()
subtitle_values_en = page.get_values_of_subtitles_en()
print(title_value_ru)
assert title_value_ru, "The title value on the page is empty on the 'ru' local"
assert title_value_ru == gPD.page_title_ru, \
"The title on the page mismatches the valid value on the 'ru' local"
assert title_value_ru == gPD.page_title_ru, "The page title mismatches the valid value on the 'ru' local"

@allure.title("Verify value of the 'en' title on the page")
def test_gp_02_04_verify_en_page_title(self, driver, groups_en_page_open):
page = gPage(driver)
title_value_en = page.get_value_of_page_title_en()
print(title_value_en)
assert title_value_en, "The title value on the page is empty on the 'en' local"
assert title_value_en == gPD.page_title_en, "The page title mismatches the valid value on the 'en' local"

@allure.title("Verify value of the 'ru' subtitles on the page")
def test_gp_02_05_verify_ru_page_subtitles(self, driver, groups_ru_page_open):
page = gPage(driver)
subtitle_values_ru = page.get_values_of_subtitles_ru()
print(subtitle_values_ru)
assert subtitle_values_ru, "Subtitle values are empty on the 'ru' local"
assert all(element in gPD.page_subtitles_ru for element in subtitle_values_ru), \
"Subtitles mismatch any valid values on the 'ru' local"
assert title_value_en, "The title value on the page is empty on the 'en' local"
assert title_value_en == gPD.page_title_en, \
"The title on the page mismatches the valid value on the 'en' local"

@allure.title("Verify value of the 'en' subtitles on the page")
def test_gp_02_06_verify_en_page_subtitles(self, driver, groups_en_page_open):
page = gPage(driver)
subtitle_values_en = page.get_values_of_subtitles_en()
print(subtitle_values_en)
assert subtitle_values_en, "Subtitle values are empty on the 'en' local"
assert all(element in gPD.page_subtitles_en for element in subtitle_values_en), \
"Subtitles mismatch any valid values on the 'en' local"
Expand Down