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
6 changes: 5 additions & 1 deletion locators/exercises_ru_words_page_locators.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ class ExercisesRuWordsPageLocators:
PAGE_SIXTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*")
PAGE_SEVENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*")
PAGE_LIST1 = (By.TAG_NAME, "ul")
PAGE_LIST2 = (By.XPATH, "//div/a")
PAGE_LIST2 = (By.XPATH, "//main//div/a")


class HeaderLocators:
RU_BUTTON = (By.XPATH, "(//span/button)[1]")
9 changes: 8 additions & 1 deletion pages/exercises_ru_words_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,17 @@ def check_list1_visibility(self):
@allure.step("Check the list2 on the 5th level of nesting is present on the page")
def check_list2_presence(self):
elements = self.elements_are_present(self.locators.PAGE_LIST2)
tags = [element.tag_name for element in elements]
# tags = [element.tag_name for element in elements]
tags = [element.text for element in elements]
print(tags)
print(len(tags))
return elements

@allure.step("Check the list2 on the 5th level level of nesting is visible")
def check_list2_visibility(self):
return self.element_is_visible(self.locators.PAGE_LIST2)

# Checking text on the tab&page
@allure.step("Get value of the title of the tab")
def get_value_of_tab_title(self):
return self.get_current_tab_title()
2 changes: 1 addition & 1 deletion test_data/exercises_ru_words_page_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


class ExercisesRuWordsPageData:
pass
tab_title = "Речевые упражнения (готовы для занятий) | BrainUp"
12 changes: 11 additions & 1 deletion tests/exercises_ru_words_page_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Auto tests for verifying web elements on the 'Exercises "Words"' page on the 'ru' local"""
import allure
from pages.exercises_ru_words_page import ExercisesRuWordsPage
from test_data.exercises_ru_words_page_data import ExercisesRuWordsPageData


@allure.epic("The Exercises 'Words' Page on the 'ru' local")
Expand Down Expand Up @@ -48,7 +49,7 @@ def test_erw_01_02_verify_page_structure_and_visibility(self, driver, exercises_
assert visibility_of_elements_on_7th_level, "7th-level elements are invisible"

@allure.title("Verify presence, visibility of lists on the page")
def test_erw_01_03_verify_page_structural_elements(self, driver, auto_test_user_authorized):
def test_erw_01_03_verify_page_structural_elements(self, driver, exercises_ru_words_page_open):
page = ExercisesRuWordsPage(driver)
list1_on_3rd_level = page.check_list1_presence()
list1_visibility = page.check_list1_visibility()
Expand All @@ -58,3 +59,12 @@ def test_erw_01_03_verify_page_structural_elements(self, driver, auto_test_user_
assert list1_visibility, "The list1 on the 3rd level is invisible"
assert list2_on_5th_level, "The list2 on the 5th level is absent on the page"
assert list2_visibility, "The list2 on the 5th level is invisible"

class TestGroupsPageText:
@allure.title("Verify value of the title of the tab")
def test_erw_02_01_verify_tab_title(self, driver, exercises_ru_words_page_open):
page = ExercisesRuWordsPage(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 == ExercisesRuWordsPageData.tab_title, \
"The title on the tab doesn't match the valid value"
Loading