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 @@ -12,3 +12,4 @@ 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")
13 changes: 13 additions & 0 deletions pages/exercises_ru_words_page.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""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
Expand Down Expand Up @@ -100,3 +102,14 @@ def check_list1_presence(self):
@allure.step("Check the list1 on the 3rd level level of nesting is visible")
def check_list1_visibility(self):
return self.element_is_visible(self.locators.PAGE_LIST1)

@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]
print(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)
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 @@ -52,5 +52,9 @@ def test_erw_01_03_verify_page_structural_elements(self, driver, auto_test_user_
page = ExercisesRuWordsPage(driver)
list1_on_3rd_level = page.check_list1_presence()
list1_visibility = page.check_list1_visibility()
list2_on_5th_level = page.check_list2_presence()
list2_visibility = page.check_list2_visibility()
assert list1_on_3rd_level, "The list1 on the 3rd level is absent on the page"
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"