@@ -110,32 +110,33 @@ def wait_for_element(self, css_selector, timeout=None):
110110
111111 # keep these two wait_for API for easy migration
112112 def wait_for_element_by_css_selector (self , selector , timeout = None ):
113- _time = timeout or self ._wait_timeout
114113 return self ._wait_for (
115114 EC .presence_of_element_located ,
116115 ((By .CSS_SELECTOR , selector ),),
117116 timeout ,
118- "timeout {}s => waiting for selector {}" .format (_time , selector ),
117+ "timeout {}s => waiting for selector {}" .format (
118+ timeout if timeout else self ._wait_timeout , selector
119+ ),
119120 )
120121
121122 def wait_for_style_to_equal (self , selector , style , val , timeout = None ):
122- _time = timeout or self ._wait_timeout
123123 return self ._wait_for (
124124 method = style_to_equal ,
125125 args = (selector , style , val ),
126126 timeout = timeout ,
127127 msg = "style val => {} {} not found within {}s" .format (
128- style , val , _time
128+ style , val , timeout if timeout else self . _wait_timeout
129129 ),
130130 )
131131
132132 def wait_for_text_to_equal (self , selector , text , timeout = None ):
133- _time = timeout or self ._wait_timeout
134133 return self ._wait_for (
135134 method = text_to_equal ,
136135 args = (selector , text ),
137136 timeout = timeout ,
138- msg = "text -> {} not found within {}s" .format (text , _time ),
137+ msg = "text -> {} not found within {}s" .format (
138+ text , timeout if timeout else self ._wait_timeout
139+ ),
139140 )
140141
141142 def wait_for_page (self , url = None , timeout = 10 ):
0 commit comments