@@ -171,49 +171,71 @@ def get_links_status_codes(self):
171171 @allure .step ("Click on links on the 'ru' local and thereby open corresponding web pages in the same tab" )
172172 def click_on_links_on_ru_local (self ):
173173 opened_pages = []
174+ starting_url = self .driver .current_url
175+ print (starting_url )
174176
175177 link1 = self .element_is_present_and_clickable (self .locators .PAGE_LINK1 )
176- current_url = self .driver .current_url
178+ # current_url = self.driver.current_url
177179 link1 .click ()
178- Wait (self .driver , 10 ).until (EC .url_changes (current_url ))
180+
181+ # Waiting for the first URL change (intermediate page)
182+ Wait (self .driver , 10 ).until (EC .url_changes (starting_url ))
183+ intermediate_url = self .driver .current_url
184+ print (intermediate_url )
185+
186+ # Waiting for the second URL change (aimed page)
187+ Wait (self .driver , 10 ).until (EC .url_changes (intermediate_url ))
188+ current_url = self .driver .current_url
189+ print (current_url )
190+
179191 opened_pages .append (self .get_current_tab_url ())
192+
180193 self .element_is_present_and_clickable (self .locators1 .LOGO_LINK ).click ()
194+ starting_url = self .driver .current_url
195+ print (starting_url )
196+
197+ # Waiting for the starting page loading
198+ Wait (self .driver , 10 ).until (EC .presence_of_element_located ((By .TAG_NAME , "h3" )))
199+
181200 link2 = self .element_is_present_and_clickable (self .locators .PAGE_LINK2 )
182- current_url = self .driver .current_url
201+ # current_url = self.driver.current_url
183202 link2 .click ()
184- Wait (self .driver , 10 ).until (EC .url_changes (current_url ))
203+
204+ # Waiting for the first URL change (intermediate page)
205+ Wait (self .driver , 10 ).until (EC .url_changes (starting_url ))
206+ intermediate_url = self .driver .current_url
207+ print (intermediate_url )
208+
209+ # Waiting for the second URL change (aimed page)
210+ Wait (self .driver , 10 ).until (EC .url_changes (intermediate_url ))
211+ current_url = self .driver .current_url
212+ print (current_url )
213+
214+ # Wait(self.driver, 10).until(EC.url_changes(current_url))
215+
185216 opened_pages .append (self .get_current_tab_url ())
217+ print (opened_pages )
186218
187219 return opened_pages
188220
189221 @allure .step ("Click on links on the 'en' local and thereby open corresponding web pages in the same tab" )
190222 def click_on_links_on_en_local (self ):
191223 opened_pages = []
192224 starting_url = self .driver .current_url
193- print (starting_url )
194225
195226 link1 = self .element_is_present_and_clickable (self .locators .PAGE_LINK1 )
196227 link1 .click ()
197228
198229 # Waiting for the first URL change (intermediate page)
199230 Wait (self .driver , 10 ).until (EC .url_changes (starting_url ))
200231 intermediate_url = self .driver .current_url
201- print (intermediate_url )
202232
203233 # Waiting for the second URL change (aimed page)
204234 Wait (self .driver , 10 ).until (EC .url_changes (intermediate_url ))
205- current_url = self .driver .current_url
206- print (current_url )
207-
208235 opened_pages .append (self .get_current_tab_url ())
209236
210237 self .driver .back ()
211- intermediate_url = self .driver .current_url
212- print (intermediate_url )
213-
214238 self .driver .back ()
215- starting_url = self .driver .current_url
216- print (starting_url )
217239
218240 # Waiting for the starting page loading
219241 Wait (self .driver , 10 ).until (EC .presence_of_element_located ((By .TAG_NAME , "h3" )))
@@ -224,12 +246,9 @@ def click_on_links_on_en_local(self):
224246 # Waiting for the first URL change (intermediate page)
225247 Wait (self .driver , 10 ).until (EC .url_changes (starting_url ))
226248 intermediate_url = self .driver .current_url
227- print (intermediate_url )
228249
229250 # Waiting for the second URL change (aimed page)
230251 Wait (self .driver , 10 ).until (EC .url_changes (intermediate_url ))
231- current_url = self .driver .current_url
232- print (current_url )
233252
234253 opened_pages .append (self .get_current_tab_url ())
235254 print (opened_pages )
0 commit comments