diff --git a/pages/exercises_ru_similar_phrases_page.py b/pages/exercises_ru_similar_phrases_page.py index 56cb30fd95..f1b67d4e27 100644 --- a/pages/exercises_ru_similar_phrases_page.py +++ b/pages/exercises_ru_similar_phrases_page.py @@ -20,7 +20,7 @@ def check_visibility_of_page_content(self): def get_structure_of_1st_level(self): elements = self.elements_are_present(self.locators.PAGE_FIRST_LEVEL_ELEMENTS) tags = [element.tag_name for element in elements] - print(*tags) + # print(*tags) return elements @allure.step("Check if elements of the 1st level of nesting are visible") @@ -31,7 +31,7 @@ def check_elements_visibility_on_1st_level(self): def get_structure_of_2nd_level(self): elements = self.elements_are_present(self.locators.PAGE_SECOND_LEVEL_ELEMENTS) tags = [element.tag_name for element in elements] - print(*tags) + # print(*tags) return elements @allure.step("Check if elements of the 2nd level of nesting are visible") @@ -42,7 +42,7 @@ def check_elements_visibility_on_2nd_level(self): def get_structure_of_3rd_level(self): elements = self.elements_are_present(self.locators.PAGE_THIRD_LEVEL_ELEMENTS) tags = [element.tag_name for element in elements] - print(*tags) + # print(*tags) return elements @allure.step("Check if elements of the 3rd level of nesting are visible") @@ -53,7 +53,7 @@ def check_elements_visibility_on_3rd_level(self): def get_structure_of_4th_level(self): elements = self.elements_are_present(self.locators.PAGE_FOURTH_LEVEL_ELEMENTS) tags = [element.tag_name for element in elements] - print(*tags) + # print(*tags) return elements @allure.step("Check if elements of the 4th level of nesting are visible") @@ -64,7 +64,7 @@ def check_elements_visibility_on_4th_level(self): def get_structure_of_5th_level(self): elements = self.elements_are_present(self.locators.PAGE_FIFTH_LEVEL_ELEMENTS) tags = [element.tag_name for element in elements] - print(*tags) + # print(*tags) return elements @allure.step("Check if elements of the 5th level of nesting are visible") @@ -75,7 +75,7 @@ def check_elements_visibility_on_5th_level(self): def get_structure_of_6th_level(self): elements = self.elements_are_present(self.locators.PAGE_SIXTH_LEVEL_ELEMENTS) tags = [element.tag_name for element in elements] - print(*tags) + # print(*tags) return elements @allure.step("Check if elements of the 6th level of nesting are visible") @@ -86,7 +86,7 @@ def check_elements_visibility_on_6th_level(self): def get_structure_of_7th_level(self): elements = self.elements_are_present(self.locators.PAGE_SEVENTH_LEVEL_ELEMENTS) tags = [element.tag_name for element in elements] - print(*tags) + # print(*tags) return elements @allure.step("Check if elements of the 7th level of nesting are visible") @@ -97,7 +97,7 @@ def check_elements_visibility_on_7th_level(self): def get_list1_of_breadcrumbs_links(self): elements = self.elements_are_present(self.locators.PAGE_LIST1) tags = [element.tag_name for element in elements] - print(*tags) + # print(*tags) return elements @allure.step("Check the list1 is visible") @@ -108,7 +108,7 @@ def check_list1_visibility(self): def get_list2_of_group_links(self): elements = self.elements_are_present(self.locators.PAGE_LIST2) tags = [element.tag_name for element in elements] - print(*tags) + # print(*tags) return elements @allure.step("Check the list2 is visible") @@ -119,7 +119,7 @@ def check_list2_visibility(self): def get_list3_of_subgroup_links(self): elements = self.elements_are_present(self.locators.PAGE_LIST3) tags = [element.tag_name for element in elements] - print(*tags) + # print(*tags) return elements @allure.step("Check the list3 is visible") @@ -130,9 +130,16 @@ def check_list3_visibility(self): def get_list4_of_links(self): elements = self.elements_are_present(self.locators.CARD_IMAGES_LIST4) tags = [element.tag_name for element in elements] - print(*tags) + # print(*tags) return elements @allure.step("Check the list4 is visible") def check_list4_visibility(self): return all(element.is_displayed() for element in self.get_list4_of_links()) + + # Checking text on the tab&page + @allure.step("Get value of the title of the tab") + def get_value_of_tab_title(self): + tab_title = self.get_current_tab_title() + print(tab_title) + return tab_title diff --git a/pages/exercises_ru_words_page.py b/pages/exercises_ru_words_page.py index b929082910..184a4017c1 100644 --- a/pages/exercises_ru_words_page.py +++ b/pages/exercises_ru_words_page.py @@ -144,6 +144,7 @@ def check_list4_visibility(self): @allure.step("Get value of the title of the tab") def get_value_of_tab_title(self): tab_title = self.get_current_tab_title() + print(tab_title) return tab_title @allure.step("Get value of the breadcrumbs on the page") @@ -262,9 +263,9 @@ def click_on_group_links(self): group_links = self.get_list2_of_group_links() for i in range(7): group_links[i].click() - time.sleep(1) + time.sleep(2) opened_pages.append(self.get_current_tab_url()) - # print(*opened_pages, sep='\n') + print(*opened_pages, sep='\n') return opened_pages @allure.step("Click on subgroup link 'Family' and thereby open corresponding web pages in the same tab") diff --git a/test_data/exercises_ru_similar_phrases_page_data.py b/test_data/exercises_ru_similar_phrases_page_data.py index cc41d02b43..420dc02d8a 100644 --- a/test_data/exercises_ru_similar_phrases_page_data.py +++ b/test_data/exercises_ru_similar_phrases_page_data.py @@ -2,4 +2,4 @@ class ExercisesRuSimilarPhrasesPageData: - pass + tab_title_ru = "Речевые упражнения (готовы для занятий) | BrainUp" diff --git a/tests/conftest.py b/tests/conftest.py index 62194dba21..8a4d647585 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -57,7 +57,7 @@ def exercises_ru_page_open(driver, auto_test_user_authorized): @allure.step(f'Open page: {ExercisesUrls.URL_EXERCISES_RU_SIMILAR_PHRASES_PAGE}') def exercises_ru_similar_phrases_page_open(driver, exercises_ru_page_open): driver.get(ExercisesUrls.URL_EXERCISES_RU_SIMILAR_PHRASES_PAGE) - time.sleep(1) + time.sleep(3) @pytest.fixture() diff --git a/tests/exercises_ru_similar_phrases_page_test.py b/tests/exercises_ru_similar_phrases_page_test.py index 67c76f842f..2761f572ae 100644 --- a/tests/exercises_ru_similar_phrases_page_test.py +++ b/tests/exercises_ru_similar_phrases_page_test.py @@ -1,6 +1,7 @@ """Auto tests for verifying web elements on the 'Exercises "Similar phrases"' page on the 'ru' local""" import allure from pages.exercises_ru_similar_phrases_page import ExercisesRuSimilarPhrasesPage +from test_data.exercises_ru_similar_phrases_page_data import ExercisesRuSimilarPhrasesPageData as ExRuSimPhrPaData @allure.epic("The Exercises 'Similar phrases' Page on the 'ru' local") @@ -65,3 +66,11 @@ def test_ersp_01_03_verify_page_structural_elements(self, driver, exercises_ru_s assert list3_visibility, "The list3 on the 5th level is invisible" assert list4_on_6th_level, "The list4 on the 6th level is absent on the page" assert list4_visibility, "The list4 on the 6th level is invisible" + + class TestExRuSimPhrPageText: + @allure.title("Verify value of the title of the tab") + def test_ersp_02_01_verify_tab_title(self, driver, exercises_ru_similar_phrases_page_open): + page = ExercisesRuSimilarPhrasesPage(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 == ExRuSimPhrPaData.tab_title_ru, "The tab title doesn't match the valid value"