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 @@ -6,3 +6,4 @@ class ExercisesRuWordsPageLocators:
PAGE_CONTENT = (By.TAG_NAME, "main")
PAGE_FIRST_LEVEL_ELEMENTS = (By.XPATH, "//main/*")
PAGE_SECOND_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*")
PAGE_THIRD_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*")
11 changes: 11 additions & 0 deletions pages/exercises_ru_words_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,14 @@ def get_structure_of_2nd_level(self):
@allure.step("Check if elements of the 2nd level of nesting are visible")
def check_elements_visibility_on_2nd_level(self):
return all(element.is_displayed() for element in self.get_structure_of_2nd_level())

@allure.step("Get structure of the 3rd level of nesting on the page")
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)
return elements

@allure.step("Check if elements of the 3rd level of nesting are visible")
def check_elements_visibility_on_3rd_level(self):
return all(element.is_displayed() for element in self.get_structure_of_3rd_level())
8 changes: 4 additions & 4 deletions pages/groups_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def get_structure_of_6th_level(self):

@allure.step("Check if elements of the 6th level of nesting are visible")
def check_elements_visibility_on_6th_level(self):
time.sleep(2)
time.sleep(3)
return all(element.is_displayed() for element in self.get_structure_of_6th_level())

@allure.step("Check the title h3 on the 2nd level of nesting is present on the page")
Expand Down Expand Up @@ -217,13 +217,13 @@ def click_on_links_on_ru_local(self):
@allure.step("Click on links on the 'en' local and thereby open corresponding web pages in the same tab")
def click_on_links_on_en_local(self):
self.click_on_en_button()
time.sleep(1)
time.sleep(2)
opened_pages = []
self.element_is_present_and_clickable(self.locators.PAGE_LINK1).click()
time.sleep(3)
time.sleep(4)
opened_pages.append(self.get_current_tab_url())
self.driver.back()
time.sleep(3)
time.sleep(4)
self.element_is_present_and_clickable(self.locators.PAGE_LINK2).click()
time.sleep(4)
opened_pages.append(self.get_current_tab_url())
Expand Down
6 changes: 3 additions & 3 deletions test_data/groups_page_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ class GroupsPageData:
"https://brainup.site/groups/1", "https://brainup.site/groups/2",
"https://brainup.site/groups/3", "https://brainup.site/groups/4",
]
link_href_first_part = "https://brainup.site/groups/"
link_href_first_part = "https://www.brainup.site/groups/"

links_status_code = 200

pages_urls = [
"https://brainup.site/groups/1/series/18", "https://brainup.site/groups/2/series/1",
"https://brainup.site/groups/3/series/14", "https://brainup.site/groups/4/series/10"
"https://www.brainup.site/groups/1/series/18", "https://www.brainup.site/groups/2/series/1",
"https://www.brainup.site/groups/3/series/14", "https://www.brainup.site/groups/4/series/10"
]

images_src = [
Expand Down
3 changes: 2 additions & 1 deletion test_data/links.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class MainPageLinks:
URL_MAIN_PAGE = "https://brainup.site/"
URL_MAIN_PAGE = "https://www.brainup.site/"
# URL_MAIN_PAGE = "https://brainup.site/"
# URL_MAIN_PAGE = "https://brainup.fun/"
URL_CONTACTS_PAGE = f"{URL_MAIN_PAGE}contact"
URL_CONTRIBUTORS_PAGE = f"{URL_MAIN_PAGE}contributors"
Expand Down
6 changes: 5 additions & 1 deletion tests/exercises_ru_words_page_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ def test_erw_01_01_verify_page_presence_and_visibility(self, driver, exercises_r
assert page_content_presence, "The page content is absent in DOM"
assert page_content_visibility, "The page content is invisible"

@allure.title("Verify composition, visibility of elements on the 1st-2nd levels of nesting on the page")
@allure.title("Verify composition, visibility of elements on the 1st-3rd levels of nesting on the page")
def test_erw_01_02_verify_page_structure_and_visibility(self, driver, exercises_ru_words_page_open):
page = ExercisesRuWordsPage(driver)
structure_of_1st_level = page.get_structure_of_1st_level()
visibility_of_elements_on_1st_level = page.check_elements_visibility_on_1st_level()
structure_of_2nd_level = page.get_structure_of_2nd_level()
visibility_of_elements_on_2nd_level = page.check_elements_visibility_on_2nd_level()
structure_of_3rd_level = page.get_structure_of_3rd_level()
visibility_of_elements_on_3rd_level = page.check_elements_visibility_on_3rd_level()
assert structure_of_1st_level, "The page is empty"
assert visibility_of_elements_on_1st_level, "1th-level elements are invisible"
assert structure_of_2nd_level, "Elements on the 2nd level are absent on the page"
assert visibility_of_elements_on_2nd_level, "2nd-level elements are invisible"
assert structure_of_3rd_level, "Elements on the 3rd level are absent on the page"
assert visibility_of_elements_on_3rd_level, "3rd-level elements are invisible"