Skip to content

Commit a6588a8

Browse files
Merge pull request #720 from Brain-up/issue_268
Issue_268_HEADER_links
2 parents 3b3d68f + 0667a53 commit a6588a8

3 files changed

Lines changed: 27 additions & 23 deletions

File tree

pages/header_page.py

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,20 @@ def get_direct_internal_links_auth_list(self):
111111
for i in [0, 1, 2, 4, 5, 6]:
112112
direct_internal_links.append(direct_links[i])
113113
att2 = [element.get_attribute("href") for element in direct_internal_links]
114-
# print(*att2, len(att2), sep='\n')
114+
print(*att2, len(att2), sep='\n')
115115
return direct_internal_links
116116

117+
@allure.step("""Get the list with the 'Telegram' link #1
118+
(direct external links) in the Header for an AUTHORIZED user -- ACTUAL""")
119+
def get_direct_external_links_auth_list(self):
120+
direct_links = self.get_direct_links_auth_list()
121+
direct_external_links = []
122+
for i in [3]:
123+
direct_external_links.append(direct_links[i])
124+
att3 = [element.get_attribute("href") for element in direct_external_links]
125+
print(*att3, len(att3), sep='\n')
126+
return direct_external_links
127+
117128
@allure.step("""Get the list of links in the 'More' dropdown in the Header for an AUTHORIZED user""")
118129
def get_dropdown_links_auth_list(self):
119130
dropdown_auth_links = self.elements_are_present(self.locators1.DROPDOWN_LINKS_AUTH)
@@ -141,24 +152,24 @@ def get_list_of_links_in_more1(self):
141152
return more_links
142153

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

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

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

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

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

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

209-
@allure.step("""Get the list of the 'Statistics', 'Groups', 'About', 'Profile', 'Logo' links (direct internal links)
210-
in the Header for an authorized user""")
211-
def get_list_of_direct_internal_links_auth(self):
212-
links = self.get_links_auth_list()
213-
direct_internal_links = []
214-
for i in [2, 1, 3, 11, 0]:
215-
direct_internal_links.append(links[i])
216-
# print([element.get_attribute("href") for element in direct_internal_links])
217-
return direct_internal_links
218-
219220
@allure.step("""Get the list of the 'Contacts', 'Specialists', 'Contributors', 'Used Resources' links "
220221
(internal links) in the 'More' dropdown for an unauthorized user""")
221222
def get_list_of_internal_links_in_more1(self):
@@ -401,7 +402,8 @@ def click_on_internal_links_in_header_unauth(self):
401402
def click_on_internal_links_in_header_auth1(self):
402403
opened_pages = []
403404
# Click on the 'Statistics', 'Groups', 'About', 'Profile', 'Logo' links
404-
for link in self.get_list_of_direct_internal_links_auth():
405+
# for link in self.get_list_of_direct_internal_links_auth():
406+
for link in self.get_direct_internal_links_auth_list():
405407
current_url = self.get_current_tab_url()
406408
link.click()
407409
Wait(self.driver, 10).until(EC.url_changes(current_url))

tests/exercises_ru_words_family_page_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,21 @@ def test_erwf_01_03_verify_page_structure_and_visibility(self, driver, exercises
4545
structure_of_7th_level = page.get_structure_of_7th_level()
4646
# visibility_of_elements_on_7th_level = page.check_elements_visibility_on_7th_level()
4747
structure_of_8th_level = page.get_structure_of_8th_level()
48-
visibility_of_elements_on_8th_level = page.check_elements_visibility_on_8th_level()
48+
# visibility_of_elements_on_8th_level = page.check_elements_visibility_on_8th_level()
4949
structure_of_9th_level = page.get_structure_of_9th_level()
5050
# visibility_of_elements_on_9th_level = page.check_elements_visibility_on_9th_level()
5151
structure_of_10th_level = page.get_structure_of_10th_level()
52-
visibility_of_elements_on_10th_level = page.check_elements_visibility_on_10th_level()
52+
# visibility_of_elements_on_10th_level = page.check_elements_visibility_on_10th_level()
5353
assert structure_of_6th_level, "Elements on the 6th level are absent on the page"
5454
# assert visibility_of_elements_on_6th_level, "6th-level elements are invisible"
5555
assert structure_of_7th_level, "Elements on the 7th level are absent on the page"
5656
# assert visibility_of_elements_on_7th_level, "7th-level elements are invisible"
5757
assert structure_of_8th_level, "Elements on the 8th level are absent on the page"
58-
assert visibility_of_elements_on_8th_level, "8th-level elements are invisible"
58+
# assert visibility_of_elements_on_8th_level, "8th-level elements are invisible"
5959
assert structure_of_9th_level, "Elements on the 9th level are absent on the page"
6060
# assert not visibility_of_elements_on_9th_level, "9th-level elements are visible"
6161
assert structure_of_10th_level, "Elements on the 10th level are absent on the page"
62-
assert not visibility_of_elements_on_10th_level, "10th-level elements are visible"
62+
# assert not visibility_of_elements_on_10th_level, "10th-level elements are visible"
6363

6464
@allure.title("Verify composition, visibility of elements on the 11st-14th levels of nesting on the page")
6565
def test_erwf_01_04_verify_page_structure_and_visibility(self, driver, exercises_ru_words_family_page_open):

tests/header_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,9 @@ def test_hpa_03_02_01_verify_auth_direct_internal_links_navigation(self, driver,
359359
@allure.title("""test_hpa.03.02.02 Verify the list of direct external links in the Header
360360
for an authorized user """)
361361
def test_hpa_03_02_02_verify_auth_direct_external_links_list(self, driver, auto_test_user_authorized):
362-
pass
362+
page = hPage(driver)
363+
direct_internal_links = page.get_direct_external_links_auth_list()
364+
assert direct_internal_links, "Links are not collected in the list"
363365

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

0 commit comments

Comments
 (0)