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
38 changes: 20 additions & 18 deletions pages/header_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,20 @@ def get_direct_internal_links_auth_list(self):
for i in [0, 1, 2, 4, 5, 6]:
direct_internal_links.append(direct_links[i])
att2 = [element.get_attribute("href") for element in direct_internal_links]
# print(*att2, len(att2), sep='\n')
print(*att2, len(att2), sep='\n')
return direct_internal_links

@allure.step("""Get the list with the 'Telegram' link #1
(direct external links) in the Header for an AUTHORIZED user -- ACTUAL""")
def get_direct_external_links_auth_list(self):
direct_links = self.get_direct_links_auth_list()
direct_external_links = []
for i in [3]:
direct_external_links.append(direct_links[i])
att3 = [element.get_attribute("href") for element in direct_external_links]
print(*att3, len(att3), sep='\n')
return direct_external_links

@allure.step("""Get the list of links in the 'More' dropdown in the Header for an AUTHORIZED user""")
def get_dropdown_links_auth_list(self):
dropdown_auth_links = self.elements_are_present(self.locators1.DROPDOWN_LINKS_AUTH)
Expand Down Expand Up @@ -141,24 +152,24 @@ def get_list_of_links_in_more1(self):
return more_links

@allure.step("""Get the list of links (internal and external) in the 'More' dropdown in the Header
for every user""")
for every user -- FOR REVIEW""")
def get_list_of_links_in_more(self):
return self.elements_are_present(self.locators.LINKS_IN_MORE)

@allure.step("""Check the 'Donate', 'GitHub', 'Contacts', 'Specialists', 'Contributors', 'Used Resources' links
in the 'More' dropdown are invisible for every user""")
in the 'More' dropdown are invisible for every user -- FOR REVIEW""")
def check_links_invisibility_in_more(self):
return all(self.element_is_not_visible(element) for element in self.get_list_of_links_in_more())

@allure.step("""Check the 'Donate', 'GitHub', 'Contacts', 'Specialists', 'Contributors', 'Used Resources' links
in the 'More' dropdown are visible for every user""")
in the 'More' dropdown are visible for every user -- FOR REVIEW""")
def check_links_visibility_in_more(self):
self.click_more_button()
return all(link.is_displayed() for link in self.get_list_of_links_in_more())

# Lists of links
@allure.step("""Get the list of the 'Contacts', 'Specialists', 'Contributors', 'Used Resources' links "
(internal links) in the 'More' dropdown for every user""")
(internal links) in the 'More' dropdown for every user -- FOR REVIEW""")
def get_list_of_internal_links_in_more(self):
links = self.get_list_of_links_in_more()[2:]
print(links)
Expand All @@ -168,13 +179,13 @@ def get_list_of_internal_links_in_more(self):
# return self.get_list_of_links_in_more()[2:]

@allure.step("""Get the list of the 'Donate', 'GitHub' links (external links)
in the 'More' dropdown for every user""")
in the 'More' dropdown for every user -- FOR REVIEW""")
def get_list_of_external_links_in_more(self):
# return self.get_list_of_links_in_more()[4:6]
return self.get_list_of_links_in_more()[:3]

@allure.step("""Get the list of the 'Donate', 'GitHub' links (external links)
in the 'More' dropdown for authorized user""")
in the 'More' dropdown for authorized user -- FOR REVIEW""")
def get_list_of_external_links_in_more_auth(self):
links = self.get_list_of_links_in_more()[3:6]
att = [element.get_attribute("href") for element in links]
Expand Down Expand Up @@ -206,16 +217,6 @@ def get_list_of_direct_internal_links_unauth(self):
direct_internal_links.append(links[i])
return direct_internal_links

@allure.step("""Get the list of the 'Statistics', 'Groups', 'About', 'Profile', 'Logo' links (direct internal links)
in the Header for an authorized user""")
def get_list_of_direct_internal_links_auth(self):
links = self.get_links_auth_list()
direct_internal_links = []
for i in [2, 1, 3, 11, 0]:
direct_internal_links.append(links[i])
# print([element.get_attribute("href") for element in direct_internal_links])
return direct_internal_links

@allure.step("""Get the list of the 'Contacts', 'Specialists', 'Contributors', 'Used Resources' links "
(internal links) in the 'More' dropdown for an unauthorized user""")
def get_list_of_internal_links_in_more1(self):
Expand Down Expand Up @@ -401,7 +402,8 @@ def click_on_internal_links_in_header_unauth(self):
def click_on_internal_links_in_header_auth1(self):
opened_pages = []
# Click on the 'Statistics', 'Groups', 'About', 'Profile', 'Logo' links
for link in self.get_list_of_direct_internal_links_auth():
# for link in self.get_list_of_direct_internal_links_auth():
for link in self.get_direct_internal_links_auth_list():
current_url = self.get_current_tab_url()
link.click()
Wait(self.driver, 10).until(EC.url_changes(current_url))
Expand Down
8 changes: 4 additions & 4 deletions tests/exercises_ru_words_family_page_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,21 @@ def test_erwf_01_03_verify_page_structure_and_visibility(self, driver, exercises
structure_of_7th_level = page.get_structure_of_7th_level()
# visibility_of_elements_on_7th_level = page.check_elements_visibility_on_7th_level()
structure_of_8th_level = page.get_structure_of_8th_level()
visibility_of_elements_on_8th_level = page.check_elements_visibility_on_8th_level()
# visibility_of_elements_on_8th_level = page.check_elements_visibility_on_8th_level()
structure_of_9th_level = page.get_structure_of_9th_level()
# visibility_of_elements_on_9th_level = page.check_elements_visibility_on_9th_level()
structure_of_10th_level = page.get_structure_of_10th_level()
visibility_of_elements_on_10th_level = page.check_elements_visibility_on_10th_level()
# visibility_of_elements_on_10th_level = page.check_elements_visibility_on_10th_level()
assert structure_of_6th_level, "Elements on the 6th level are absent on the page"
# assert visibility_of_elements_on_6th_level, "6th-level elements are invisible"
assert structure_of_7th_level, "Elements on the 7th level are absent on the page"
# assert visibility_of_elements_on_7th_level, "7th-level elements are invisible"
assert structure_of_8th_level, "Elements on the 8th level are absent on the page"
assert visibility_of_elements_on_8th_level, "8th-level elements are invisible"
# assert visibility_of_elements_on_8th_level, "8th-level elements are invisible"
assert structure_of_9th_level, "Elements on the 9th level are absent on the page"
# assert not visibility_of_elements_on_9th_level, "9th-level elements are visible"
assert structure_of_10th_level, "Elements on the 10th level are absent on the page"
assert not visibility_of_elements_on_10th_level, "10th-level elements are visible"
# assert not visibility_of_elements_on_10th_level, "10th-level elements are visible"

@allure.title("Verify composition, visibility of elements on the 11st-14th levels of nesting on the page")
def test_erwf_01_04_verify_page_structure_and_visibility(self, driver, exercises_ru_words_family_page_open):
Expand Down
4 changes: 3 additions & 1 deletion tests/header_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,9 @@ def test_hpa_03_02_01_verify_auth_direct_internal_links_navigation(self, driver,
@allure.title("""test_hpa.03.02.02 Verify the list of direct external links in the Header
for an authorized user """)
def test_hpa_03_02_02_verify_auth_direct_external_links_list(self, driver, auto_test_user_authorized):
pass
page = hPage(driver)
direct_internal_links = page.get_direct_external_links_auth_list()
assert direct_internal_links, "Links are not collected in the list"

@allure.title("""test_hpa.03.02.03 Verify if direct external links in the Header
for an authorized user lead to correct pages after clicking""")
Expand Down
Loading