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 @@ -8,3 +8,4 @@ class ExercisesRuWordsPageLocators:
PAGE_SECOND_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*")
PAGE_THIRD_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*")
PAGE_FOURTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*")
PAGE_FIFTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*")
4 changes: 1 addition & 3 deletions pages/contributors_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ def check_values_of_card_descriptions(self):
full, empty = [], []
for i in range(len(values)):
full.append(values[i]) if values[i] else empty.append(values[i])
print(len(full), len(empty))
return len(full) + len(empty)

@allure.step("Check text in links in cards")
Expand All @@ -145,7 +144,6 @@ def check_text_in_card_links(self):
full, empty = [], []
for i in range(len(values)):
full.append(values[i]) if values[i] else empty.append(values[i])
print(len(full), len(empty))
return len(full) + len(empty)

@allure.step("Get text in the 'All Team' link")
Expand Down Expand Up @@ -192,5 +190,5 @@ def check_size_changes_of_images(self):
for i in range(len(images)):
changed.append(i) if images_sizes_before[i] != images_sizes_after[i] else unchanged.append(i)
lost.append(i) if images_sizes_after[i] == {'height': 0, 'width': 0} else None
print(f'\nChanged: {len(changed)}, Lost: {len(lost)}, Unchanged: {len(unchanged)}')
# print(f'\nChanged: {len(changed)}, Lost: {len(lost)}, Unchanged: {len(unchanged)}')
return changed, lost, unchanged
11 changes: 11 additions & 0 deletions pages/exercises_ru_words_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,14 @@ def get_structure_of_4th_level(self):
@allure.step("Check if elements of the 4th level of nesting are visible")
def check_elements_visibility_on_4th_level(self):
return all(element.is_displayed() for element in self.get_structure_of_4th_level())

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

@allure.step("Check if elements of the 5th level of nesting are visible")
def check_elements_visibility_on_5th_level(self):
return all(element.is_displayed() for element in self.get_structure_of_5th_level())
2 changes: 1 addition & 1 deletion pages/footer_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def click_on_links(self):
except TimeoutException:
print(f"The tab {i} has not been loaded during the allotted time")
count3 += 1
print(f'{new_tabs_urls}\nDefined tabs urls: {count1}\nUndefined tabs urls: {count2}\nUnloaded tabs: {count3}')
# print(f'{new_tabs_urls}\nDefined tabs urls: {count1}\nUndefined tabs urls: {count2}\nUnloaded tabs: {count3}')
return new_tabs_urls

@allure.step("Click on the 'Contact us' link in the Footer and thereby open an email client")
Expand Down
5 changes: 0 additions & 5 deletions pages/groups_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,11 @@ def click_on_links_on_ru_local(self):
self.element_is_present_and_clickable(self.locators.PAGE_LINK1).click()
time.sleep(4)
opened_pages.append(self.get_current_tab_url())
# self.driver.back()
self.element_is_present_and_clickable(self.locators1.LOGO_LINK).click()
time.sleep(4)
# self.click_on_ru_button()
# time.sleep(2)
self.element_is_present_and_clickable(self.locators.PAGE_LINK2).click()
time.sleep(4)
opened_pages.append(self.get_current_tab_url())
print(opened_pages)
return opened_pages

@allure.step("Click on links on the 'en' local and thereby open corresponding web pages in the same tab")
Expand All @@ -228,7 +224,6 @@ def click_on_links_on_en_local(self):
self.element_is_present_and_clickable(self.locators.PAGE_LINK2).click()
time.sleep(4)
opened_pages.append(self.get_current_tab_url())
print(opened_pages)
return opened_pages

# Checking images on the page
Expand Down
2 changes: 1 addition & 1 deletion pages/specialists_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,5 +260,5 @@ def check_size_changes_of_images(self):
for i in range(len(images)):
changed.append(i) if images_sizes_before[i] != images_sizes_after[i] else unchanged.append(i)
lost.append(i) if images_sizes_after[i] == {'height': 0, 'width': 0} else None
print(f'\nChanged: {len(changed)}, Lost: {len(lost)}, Unchanged: {len(unchanged)}')
# print(f'\nChanged: {len(changed)}, Lost: {len(lost)}, Unchanged: {len(unchanged)}')
return changed, lost, unchanged
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 @@ -25,6 +25,8 @@ def test_erw_01_02_verify_page_structure_and_visibility(self, driver, exercises_
visibility_of_elements_on_3rd_level = page.check_elements_visibility_on_3rd_level()
structure_of_4th_level = page.get_structure_of_4th_level()
visibility_of_elements_on_4th_level = page.check_elements_visibility_on_4th_level()
structure_of_5th_level = page.get_structure_of_5th_level()
visibility_of_elements_on_5th_level = page.check_elements_visibility_on_5th_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"
Expand All @@ -33,3 +35,5 @@ def test_erw_01_02_verify_page_structure_and_visibility(self, driver, exercises_
assert visibility_of_elements_on_3rd_level, "3rd-level elements are invisible"
assert structure_of_4th_level, "Elements on the 4th level are absent on the page"
assert visibility_of_elements_on_4th_level, "4th-level elements are invisible"
assert structure_of_5th_level, "Elements on the 5th level are absent on the page"
assert visibility_of_elements_on_5th_level, "5th-level elements are invisible"
1 change: 0 additions & 1 deletion tests/groups_page_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ def test_gp_02_02_verify_page_title_and_subtitles(self, driver, auto_test_user_a
subtitle_values_ru = page.get_values_of_subtitles_ru()
title_value_en = page.get_value_of_page_title_en()
subtitle_values_en = page.get_values_of_subtitles_en()
print(title_value_ru, subtitle_values_ru, title_value_en, subtitle_values_en, sep='\n')
assert title_value_ru, "The title value on the page is empty on the 'ru' local"
assert title_value_ru == GroupsPageData.page_title_ru, \
"The title on the page mismatches the valid value on the 'ru' local"
Expand Down
1 change: 0 additions & 1 deletion tests/header_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,6 @@ def test_hpa_04_03_verify_auth_icons(self, driver, auto_test_user_authorized):
icons_presence = page.get_list_of_auth_icons()
icons_visibility = page.check_auth_icons_visibility()
icons_xmlns = page.get_auth_icons_xmlns()
print(icons_xmlns)
assert icons_presence, "Icons in the Header are absent"
assert icons_visibility, "Icons in the Header are invisible"
assert icons_xmlns, "The 'xmlns' attribute value of icons in the Header are empty"
Expand Down
1 change: 0 additions & 1 deletion tests/used_resources_page_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class TestUsedResourcesPageText:
def test_ur_02_01_verify_tab_title(self, driver, used_resources_page_open):
page = UsedResourcesPage(driver)
tab_title_value = page.get_value_of_tab_title()
print(tab_title_value)
assert tab_title_value, "The title value of the tab is empty"
assert tab_title_value in UsedResourcesPageData.tab_title_expected, \
"The title value of the tab mismatches the valid value"
Expand Down