File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ def __init__(self, page: Page):
5757 def click_main_menu_link (self ) -> None :
5858 """Click the Base Page 'Main Menu' link if it is visible."""
5959 loops = 0
60+ text = None
61+
6062 while loops <= 3 :
6163 if self .main_menu_link .is_visible ():
6264 self .click (self .main_menu_link )
@@ -70,13 +72,17 @@ def click_main_menu_link(self) -> None:
7072 text = None
7173
7274 if text and self .main_menu_string in text :
73- break
75+ return # Success
7476 else :
7577 logging .warning ("Main Menu click failed, retrying after 0.2 seconds" )
7678 # The timeout is in place here to allow the page ample time to load if it has not already been loaded
7779 self .page .wait_for_timeout (200 )
7880
7981 loops += 1
82+ # All attempts failed
83+ raise RuntimeError (
84+ f"Failed to navigate to Main Menu after { loops } attempts. Last page title was: '{ text or 'unknown' } '"
85+ )
8086
8187 def click_log_out_link (self ) -> None :
8288 """Click the Base Page 'Log-out' link."""
You can’t perform that action at this time.
0 commit comments