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
1 change: 1 addition & 0 deletions locators/exercises_ru_words_page_locators.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class ExercisesRuWordsPageLocators:
PAGE_LIST2 = (By.XPATH, "//aside//li")
PAGE_LIST3 = (By.XPATH, '//div[contains(@class, "series-page")]//a')
# PAGE_LIST3 = (By.XPATH, "//main//div/a")
CARD_IMAGES_LIST4 = (By.XPATH, '//div[contains(@style, "svg")]')


class HeaderLocators:
Expand Down
31 changes: 22 additions & 9 deletions pages/exercises_ru_words_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ def check_elements_visibility_on_7th_level(self):
def check_list1_presence(self):
elements = self.elements_are_present(self.locators.PAGE_LIST1)
# tags = [element.tag_name for element in elements]
tags = [element.text for element in elements]
print(tags)
print(len(tags))
tags_text = [element.text for element in elements]
print(tags_text)
print(len(tags_text))
return elements

@allure.step("Check the list1 is visible")
Expand All @@ -112,9 +112,9 @@ def check_list1_visibility(self):
def check_list2_presence(self):
elements = self.elements_are_present(self.locators.PAGE_LIST2)
# tags = [element.tag_name for element in elements]
tags = [element.text for element in elements]
print(tags)
print(len(tags))
tags_text = [element.text for element in elements]
print(tags_text)
print(len(tags_text))
return elements

@allure.step("Check the list2 is visible")
Expand All @@ -125,15 +125,28 @@ def check_list2_visibility(self):
def check_list3_presence(self):
elements = self.elements_are_present(self.locators.PAGE_LIST3)
# tags = [element.tag_name for element in elements]
tags = [element.text for element in elements]
print(tags)
print(len(tags))
tags_text = [element.text for element in elements]
print(tags_text)
print(len(tags_text))
return elements

@allure.step("Check the list3 is visible")
def check_list3_visibility(self):
return self.element_is_visible(self.locators.PAGE_LIST3)

@allure.step("Check the list4 on the 6th level of nesting is present on the page")
def check_list4_presence(self):
elements = self.elements_are_present(self.locators.CARD_IMAGES_LIST4)
# tags = [element.tag_name for element in elements]
style = [element.get_attribute("style") for element in elements]
print(*style, sep='\n')
print(len(style))
return elements

@allure.step("Check the list4 is visible")
def check_list4_visibility(self):
return self.element_is_visible(self.locators.CARD_IMAGES_LIST4)

# Checking text on the tab&page
@allure.step("Get value of the title of the tab")
def get_value_of_tab_title(self):
Expand Down
4 changes: 4 additions & 0 deletions tests/exercises_ru_words_page_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,16 @@ def test_erw_01_03_verify_page_structural_elements(self, driver, exercises_ru_wo
list2_visibility = page.check_list2_visibility()
list3_on_5th_level = page.check_list3_presence()
list3_visibility = page.check_list3_visibility()
list4_on_6th_level = page.check_list4_presence()
list4_visibility = page.check_list4_visibility()
assert list1_on_4th_level, "The list1 on the 4th level is absent on the page"
assert list1_visibility, "The list1 on the 4th level is invisible"
assert list2_on_4th_level, "The list2 on the 4th level is absent on the page"
assert list2_visibility, "The list2 on the 4th level is invisible"
assert list3_on_5th_level, "The list3 on the 5th level is absent on the page"
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 TestGroupsPageText:
@allure.title("Verify value of the title of the tab")
Expand Down
Loading