@@ -75,6 +75,14 @@ def set_options(self, download_path: str, geckodriver_path: str,
7575 self .driver = WebDriver (options = options , executable_path = geckodriver_path )
7676 self .driver .get (self .ICOMOON_URL )
7777 assert "IcoMoon App" in self .driver .title
78+
79+ # wait until the whole web page is loaded by testing the hamburger input
80+ hamburger_input = WebDriverWait (self .driver , SeleniumRunner .LONG_WAIT_IN_SEC ).until (
81+ ec .element_to_be_clickable ((By .CSS_SELECTOR ,
82+ "button.btn5.lh-def.transparent i.icon-menu" ))
83+ )
84+ hamburger_input .click ()
85+ print ("Accessed icomoon.io" )
7886
7987 def upload_icomoon (self , icomoon_json_path : str ):
8088 """
@@ -86,7 +94,7 @@ def upload_icomoon(self, icomoon_json_path: str):
8694 try :
8795 # find the file input and enter the file path
8896 import_btn = WebDriverWait (self .driver , SeleniumRunner .LONG_WAIT_IN_SEC ).until (
89- ec .presence_of_element_located ((By .CSS_SELECTOR , "div#file input" ))
97+ ec .element_to_be_clickable ((By .CSS_SELECTOR , "div#file input" ))
9098 )
9199 import_btn .send_keys (icomoon_json_path )
92100 except Exception as e :
@@ -138,6 +146,7 @@ def upload_svgs(self, svgs: List[str]):
138146 ec .element_to_be_clickable ((By .XPATH , "//button[text()='Select All']" ))
139147 )
140148 select_all_button .click ()
149+ print ("Finished uploading the svgs..." )
141150 except Exception as e :
142151 self .close ()
143152 raise e
@@ -155,7 +164,7 @@ def click_hamburger_input(self):
155164 )
156165
157166 menu_appear_callback = ec .element_to_be_clickable (
158- (By .CSS_SELECTOR , "h1#setH2 ul" )
167+ (By .CSS_SELECTOR , "h1 ul.menuList2 " )
159168 )
160169
161170 while not menu_appear_callback (self .driver ):
0 commit comments