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
22 changes: 12 additions & 10 deletions pages/exercises_ru_words_page.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"""Methods for verifying web elements on the 'Exercises "Words"' page on the 'ru' local"""
import time

import allure
from pages.base_page import BasePage
from locators.exercises_ru_words_page_locators import ExercisesRuWordsPageLocators
from locators.exercises_ru_words_page_locators import ExercisesRuWordsPageLocators, HeaderLocators


class ExercisesRuWordsPage(BasePage):
locators = ExercisesRuWordsPageLocators
locators1 = HeaderLocators

# Checking the structure and display of elements on the page
@allure.step("Check if some content is present in DOM")
Expand All @@ -22,7 +22,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")
Expand All @@ -33,7 +33,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")
Expand All @@ -44,7 +44,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")
Expand All @@ -55,7 +55,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")
Expand All @@ -66,7 +66,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")
Expand All @@ -77,7 +77,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")
Expand All @@ -88,7 +88,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")
Expand Down Expand Up @@ -119,4 +119,6 @@ def check_list2_visibility(self):
# 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()
tab_title = self.get_current_tab_title()
print(tab_title)
return 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:
tab_title = "Речевые упражнения (готовы для занятий) | BrainUp"
tab_title = ["Речевые упражнения (готовы для занятий) | BrainUp", "Speech exercises | BrainUp"]
2 changes: 1 addition & 1 deletion tests/exercises_ru_words_page_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ 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, \
assert tab_title_value in ExercisesRuWordsPageData.tab_title, \
"The title on the tab doesn't match the valid value"
Loading