@@ -76,8 +76,8 @@ def check_elements_invisibility_on_6th_level_in_header(self):
7676 def get_list_of_links_unauth (self ):
7777 return self .elements_are_present (self .locators .HEADER_LINKS_UNAUTH )
7878
79- @allure .step ("Get the list of links on different levels of nesting in the Header for an authorized user" )
80- def get_list_of_links_auth (self ):
79+ @allure .step ("Get the list of links on different levels of nesting in the Header for an authorized user -- ACTUAL " )
80+ def get_links_auth_list (self ):
8181 return self .elements_are_present (self .locators1 .HEADER_LINKS_AUTH )
8282
8383 @allure .step ("""Get the list of the 'About', 'Telegram', 'Registration', 'Logo' links (direct links) in the Header
@@ -89,25 +89,37 @@ def get_list_of_direct_links_unauth(self):
8989 direct_links .append (links [i ])
9090 return direct_links
9191
92- @allure .step ("""Get the list of the 'Groups', 'Statistics', 'About', 'Telegram', 'Profile', 'Logo' links
93- (direct links) in the Header for an authorized user""" )
94- def get_list_of_direct_links_auth (self ):
95- links = self .get_list_of_links_auth ()
92+ @allure .step ("""Get the list of the 'Groups', 'Statistics' (x2) , 'About', 'Telegram', 'Profile', 'Logo' links
93+ (direct links) in the Header for an AUTHORIZED user -- ACTUAL """ )
94+ def get_direct_links_auth_list (self ):
95+ links = self .get_links_auth_list ()
9696 direct_links = []
97- # for i in [1, 2, 3, 4, 11, 0]:
98- for i in [1 , 2 , 3 , 4 , 17 , 0 ]:
97+ for i in [1 , 2 , 3 , 4 , 16 , 17 , 0 ]:
9998 direct_links .append (links [i ])
100- # print(*direct_links)
10199 return direct_links
102100
101+ @allure .step ("""Get the list of the 'Groups', 'Statistics' (x2), 'About', 'Profile', 'Logo' links
102+ (direct internal links) in the Header for an AUTHORIZED user -- ACTUAL""" )
103+ def get_direct_internal_links_auth_list (self ):
104+ direct_links = self .get_direct_links_auth_list ()
105+ direct_internal_links = []
106+ for i in [0 , 1 , 2 , 4 , 5 , 6 ]:
107+ direct_internal_links .append (direct_links [i ])
108+ att1 = [element .get_attribute ("href" ) for element in direct_links ]
109+ print (* att1 , len (att1 ), sep = '\n ' )
110+ att2 = [element .get_attribute ("href" ) for element in direct_internal_links ]
111+ print (* att2 , len (att2 ), sep = '\n ' )
112+ return direct_internal_links
113+
114+
103115 @allure .step ("Check the 'About', 'Telegram', 'Registration', 'Logo' links are visible for an unauthorized user" )
104116 def check_direct_links_visibility_unauth (self ):
105117 return all (link .is_displayed () for link in self .get_list_of_direct_links_unauth ())
106118
107119 @allure .step ("""Check the 'Groups', 'Statistics', 'About', 'Telegram', 'Registration', 'Logo' links are visible "
108120 for an authorized user""" )
109121 def check_direct_links_visibility_auth (self ):
110- return all (link .is_displayed () for link in self .get_list_of_direct_links_auth ())
122+ return all (link .is_displayed () for link in self .get_direct_links_auth_list ())
111123
112124 @allure .step ("""Get the list of the 'Contacts', 'Specialists', 'Contributors', 'Used Resources', "
113125 'Donate', 'GitHub' links in the 'More' dropdown in the Header for every user""" )
@@ -138,7 +150,12 @@ def check_links_visibility_in_more(self):
138150 @allure .step ("""Get the list of the 'Contacts', 'Specialists', 'Contributors', 'Used Resources' links "
139151 (internal links) in the 'More' dropdown for every user""" )
140152 def get_list_of_internal_links_in_more (self ):
141- return self .get_list_of_links_in_more ()[2 :]
153+ links = self .get_list_of_links_in_more ()[2 :]
154+ print (links )
155+ att = [element .get_attribute ("href" ) for element in links ]
156+ print (* att , len (att ), sep = '\n ' )
157+ return links
158+ # return self.get_list_of_links_in_more()[2:]
142159
143160 @allure .step ("""Get the list of the 'Donate', 'GitHub' links (external links)
144161 in the 'More' dropdown for every user""" )
@@ -183,7 +200,7 @@ def get_list_of_direct_internal_links_unauth(self):
183200 @allure .step ("""Get the list of the 'Statistics', 'Groups', 'About', 'Profile', 'Logo' links (direct internal links)
184201 in the Header for an authorized user""" )
185202 def get_list_of_direct_internal_links_auth (self ):
186- links = self .get_list_of_links_auth ()
203+ links = self .get_links_auth_list ()
187204 direct_internal_links = []
188205 for i in [2 , 1 , 3 , 11 , 0 ]:
189206 direct_internal_links .append (links [i ])
@@ -295,10 +312,9 @@ def get_text_in_direct_links_unauth(self):
295312 @allure .step ("""Get text in the 'Groups', 'Statistics', 'About', 'Telegram' links in the Header
296313 for an authorized user""" )
297314 def get_text_in_direct_links_auth (self ):
298- direct_links_text = [link .text for link in self .get_list_of_direct_links_auth ()[:4 ]]
315+ direct_links_text = [link .text for link in self .get_direct_links_auth_list ()[:4 ]]
299316 print (* direct_links_text , len (direct_links_text ), sep = '\n ' )
300317 return direct_links_text
301- # return [link.text for link in self.get_list_of_direct_links_auth()[:5]]
302318
303319 @allure .step ("""Get text in the 'Donate', 'GitHub', 'Contacts', 'Specialists', 'Contributors', 'Used Resources'
304320 links in the Header""" )
@@ -328,7 +344,7 @@ def check_links_clickability_unauth(self):
328344
329345 @allure .step ("Check if links are clickable in the Header for an authorized user" )
330346 def check_links_clickability_auth (self ):
331- return all (link .is_enabled () for link in self .get_list_of_links_auth ())
347+ return all (link .is_enabled () for link in self .get_links_auth_list ())
332348
333349 @allure .step ("Get attribute 'title' of the 'Telegram' link in the Header" )
334350 def get_tg_link_title (self ):
@@ -340,7 +356,7 @@ def get_links_href_unauth(self):
340356
341357 @allure .step ("Get attribute 'href' of links in the Header for an authorized user" )
342358 def get_links_href_auth (self ):
343- att = [element .get_attribute ("href" ) for element in self .get_list_of_links_auth ()]
359+ att = [element .get_attribute ("href" ) for element in self .get_links_auth_list ()]
344360 # print(*att, len(att), sep='\n')
345361 return att
346362 # return [element.get_attribute("href") for element in self.get_list_of_links_auth()]
@@ -371,8 +387,8 @@ def click_on_internal_links_in_header_unauth(self):
371387 opened_pages .append (self .get_current_tab_url ())
372388 return opened_pages
373389
374- @allure .step ("""Click on internal links in the Header and thereby open corresponding web pages in the same tab
375- for an authorized user""" )
390+ @allure .step ("""Click on internal links in the Header
391+ and thereby open corresponding web pages in the same tab for an AUTHORIZED user -- unusable till changing UI """ )
376392 def click_on_internal_links_in_header_auth1 (self ):
377393 opened_pages = []
378394 # Click on the 'Statistics', 'Groups', 'About', 'Profile', 'Logo' links
@@ -392,7 +408,7 @@ def click_on_internal_links_in_header_auth1(self):
392408 return opened_pages
393409
394410 @allure .step ("""Click on direct internal links in the Header
395- and thereby open corresponding web pages in the same tab for an authorized user""" )
411+ and thereby open corresponding web pages in the same tab for an AUTHORIZED user""" )
396412 def click_on_direct_internal_links_in_header_auth (self ):
397413 opened_pages = []
398414 current_url = self .get_current_tab_url ()
@@ -430,32 +446,32 @@ def click_on_direct_internal_links_in_header_auth(self):
430446
431447 return opened_pages
432448
433- @allure .step ("Click on the 'Groups' link #2 for authorized user" )
449+ @allure .step ("Click on the 'Groups' link #2 for AUTHORIZED user" )
434450 def click_on_Groups_link_auth2 (self ):
435451 self .click_more_button ()
436452 self .element_is_present_and_clickable (self .locators1 .LINK_GROUPS_AUTH2 ).click ()
437453 current_tab_url = self .get_current_tab_url ()
438454 print (current_tab_url )
439455 return current_tab_url
440456
441- @allure .step ("Click on the 'Statistics' link #2 for authorized user" )
457+ @allure .step ("Click on the 'Statistics' link #2 for AUTHORIZED user" )
442458 def click_on_Statistics_link_auth2 (self ):
443459 self .click_more_button ()
444460 self .element_is_present_and_clickable (self .locators1 .LINK_STATISTICS_AUTH2 ).click ()
445461 current_tab_url = self .get_current_tab_url ()
446462 # print(current_tab_url)
447463 return current_tab_url
448464
449- @allure .step ("Click on the 'About' link #2 for authorized user" )
465+ @allure .step ("Click on the 'About' link #2 for AUTHORIZED user" )
450466 def click_on_About_link_auth2 (self ):
451467 self .click_more_button ()
452468 self .element_is_present_and_clickable (self .locators1 .LINK_ABOUT_AUTH2 ).click ()
453469 current_tab_url = self .get_current_tab_url ()
454470 print (current_tab_url )
455471 return current_tab_url
456472
457- @allure .step ("""Click on external links in the Header and thereby open corresponding web pages on new tabs
458- for authorized user -- unusable till changing UI""" )
473+ @allure .step ("""Click on external links in the Header
474+ and thereby open corresponding web pages on new tabs for AUTHORIZED user -- unusable till changing UI""" )
459475 def click_on_auth_external_links_in_header (self ):
460476 opened_pages = []
461477 # Click on the 'Telegram' link
@@ -474,15 +490,15 @@ def click_on_auth_external_links_in_header(self):
474490 print (* opened_pages )
475491 return opened_pages
476492
477- @allure .step ("Click on the 'Telegram' link #1 for authorized user" )
493+ @allure .step ("Click on the 'Telegram' link #1 for AUTHORIZED user" )
478494 def click_on_Telegram_link_auth1 (self ):
479495 self .element_is_present_and_clickable (self .locators1 .LINK_TELEGRAM_AUTH ).click ()
480496 self .driver .switch_to .window (self .driver .window_handles [1 ])
481497 current_tab_url = self .get_current_tab_url ()
482498 self .driver .switch_to .window (self .driver .window_handles [0 ])
483499 return current_tab_url
484500
485- @allure .step ("Click on the 'Telegram' link #2 for authorized user" )
501+ @allure .step ("Click on the 'Telegram' link #2 for AUTHORIZED user" )
486502 def click_on_Telegram_link_auth2 (self ):
487503 self .click_more_button ()
488504 self .element_is_present_and_clickable (self .locators1 .LINK_TELEGRAM_AUTH2 ).click ()
@@ -491,7 +507,7 @@ def click_on_Telegram_link_auth2(self):
491507 self .driver .switch_to .window (self .driver .window_handles [0 ])
492508 return current_tab_url
493509
494- @allure .step ("Click on the 'Donate' link for authorized user" )
510+ @allure .step ("Click on the 'Donate' link for AUTHORIZED user" )
495511 def click_on_Donate_link_auth (self ):
496512 self .click_more_button ()
497513 self .element_is_present_and_clickable (self .locators1 .LINK_DONATE_AUTH ).click ()
@@ -500,7 +516,7 @@ def click_on_Donate_link_auth(self):
500516 self .driver .switch_to .window (self .driver .window_handles [0 ])
501517 return current_tab_url
502518
503- @allure .step ("Click on the 'GitHub' link for authorized user" )
519+ @allure .step ("Click on the 'GitHub' link for AUTHORIZED user" )
504520 def click_on_GitHub_link_auth (self ):
505521 self .click_more_button ()
506522 self .element_is_present_and_clickable (self .locators1 .LINK_GITHUB_AUTH ).click ()
@@ -511,8 +527,8 @@ def click_on_GitHub_link_auth(self):
511527 print (self .get_current_tab_url ())
512528 return current_tab_url
513529
514- @allure .step ("""Click on external links in the Header and thereby open corresponding web pages on new tabs
515- for unauthorized user""" )
530+ @allure .step ("""Click on external links in the Header
531+ and thereby open corresponding web pages on new tabs for unauthorized user""" )
516532 def click_on_unauth_external_links_in_header (self ):
517533 opened_pages = []
518534 # Click on the 'Telegram' link
0 commit comments