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
5 changes: 3 additions & 2 deletions pages/groups_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,9 @@ def check_links_clickability(self):

@allure.step("Get attribute 'title' of links on the 'ru' local")
def get_links_titles_ru(self):
time.sleep(1)
return [element.get_attribute("title") for element in self.get_list_of_links()]
elements = self.get_list_of_links()
WebDriverWait(self.driver, 10).until(ec.visibility_of_all_elements_located(self.locators.PAGE_IMAGES))
return [element.get_attribute('title') for element in elements]

@allure.step("Get attribute 'title' of links on the 'en' local")
def get_links_titles_en(self):
Expand Down
12 changes: 9 additions & 3 deletions tests/groups_page_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,20 @@ def test_gp_03_01_verify_links(self, driver, groups_ru_page_open):
assert all(element in gPD.links_status_code for element in link_status_codes), \
"Status codes of links mismatch valid values"

@allure.title("Verify title, href of links on the 'ru' local")
def test_gp_03_02_verify_links_ru(self, driver, groups_ru_page_open):
@allure.title("Verify title of links on the 'ru' local")
def test_gp_03_02_01_verify_links_ru_title(self, driver, groups_ru_page_open):
page = gPage(driver)
link_titles_ru = page.get_links_titles_ru()
links_href_ru = page.get_links_href_ru()
print("Found alt attributes:", link_titles_ru) # temporarily for debugging
print("Expected alt attributes:", gPD.link_titles_ru)
assert link_titles_ru, "Link titles values are empty on the 'ru' local"
assert all(element in gPD.link_titles_ru for element in link_titles_ru), \
"Link titles mismatch any valid values on the 'ru' local"

@allure.title("Verify href of links on the 'ru' local")
def test_gp_03_02_02_verify_links_ru_href(self, driver, groups_ru_page_open):
page = gPage(driver)
links_href_ru = page.get_links_href_ru()
assert links_href_ru, "Links href are empty on the 'ru' local"
assert all(element.startswith(gPD.link_href_first_part) for element in links_href_ru), \
"Attributes 'href' of links on the 'ru' local mismatch valid values"
Expand Down
Loading