@@ -171,20 +171,18 @@ def get_subgroup_link_status_codes(self):
171171
172172 @allure .step ("Click on breadcrumbs links and thereby open corresponding web pages in the same tab" )
173173 def click_on_breadcrumbs_links (self ):
174- opened_pages = []
175- self .element_is_present_and_clickable (self .locators .PAGE_LIST1_1 ).click ()
176- Wait (self .driver , self .timeout ).until (EC .url_changes (self .get_current_tab_url ()))
177- opened_pages .append (self .get_current_tab_url ())
178- self .driver .back ()
179-
180- self .element_is_present_and_clickable (self .locators .PAGE_LIST1_2 ).click ()
181- opened_pages .append (self .get_current_tab_url ())
182- self .driver .back ()
174+ breadcrumbs_locators = [self .locators .PAGE_LIST1_1 , self .locators .PAGE_LIST1_2 , self .locators .PAGE_LIST1_3 ]
175+ group_page_url = self .get_current_tab_url ()
176+ opened_pages = [self .get_current_tab_url ()]
183177
184- self .element_is_present_and_clickable (self .locators .PAGE_LIST1_3 ).click ()
185- opened_pages .append (self .get_current_tab_url ())
178+ for link_locator in breadcrumbs_locators [:2 ]:
179+ self .element_is_clickable (link_locator ).click ()
180+ Wait (self .driver , self .timeout ).until (EC .url_changes (group_page_url ))
181+ opened_pages .append (self .get_current_tab_url ())
182+ self .driver .back ()
183+ Wait (self .driver , self .timeout ).until (EC .url_to_be (group_page_url ))
186184
187- # print(*opened_pages, sep='\n')
185+ print (* opened_pages , sep = '\n ' )
188186 return opened_pages
189187
190188 @allure .step ("Click on group links and thereby open corresponding web pages in the same tab" )
0 commit comments