@@ -56,6 +56,7 @@ def __init__(
5656 ) -> None :
5757 super ().__init__ (parent , type , guid , initializer )
5858 self ._frame = cast ("Frame" , parent )
59+ self ._channel ._set_timeout_calculator (self ._frame ._timeout )
5960
6061 async def _createSelectorForTest (self , name : str ) -> Optional [str ]:
6162 return await self ._channel .send ("createSelectorForTest" , dict (name = name ))
@@ -105,9 +106,7 @@ async def dispatch_event(self, type: str, eventInit: Dict = None) -> None:
105106 )
106107
107108 async def scroll_into_view_if_needed (self , timeout : float = None ) -> None :
108- await self ._channel .send (
109- "scrollIntoViewIfNeeded" , self ._locals_to_params_with_timeout (locals ())
110- )
109+ await self ._channel .send ("scrollIntoViewIfNeeded" , locals_to_params (locals ()))
111110
112111 async def hover (
113112 self ,
@@ -118,7 +117,7 @@ async def hover(
118117 force : bool = None ,
119118 trial : bool = None ,
120119 ) -> None :
121- await self ._channel .send ("hover" , self . _locals_to_params_with_timeout (locals ()))
120+ await self ._channel .send ("hover" , locals_to_params (locals ()))
122121
123122 async def click (
124123 self ,
@@ -132,7 +131,7 @@ async def click(
132131 noWaitAfter : bool = None ,
133132 trial : bool = None ,
134133 ) -> None :
135- await self ._channel .send ("click" , self . _locals_to_params_with_timeout (locals ()))
134+ await self ._channel .send ("click" , locals_to_params (locals ()))
136135
137136 async def dblclick (
138137 self ,
@@ -145,9 +144,7 @@ async def dblclick(
145144 noWaitAfter : bool = None ,
146145 trial : bool = None ,
147146 ) -> None :
148- await self ._channel .send (
149- "dblclick" , self ._locals_to_params_with_timeout (locals ())
150- )
147+ await self ._channel .send ("dblclick" , locals_to_params (locals ()))
151148
152149 async def select_option (
153150 self ,
@@ -159,7 +156,7 @@ async def select_option(
159156 force : bool = None ,
160157 noWaitAfter : bool = None ,
161158 ) -> List [str ]:
162- params = self . _locals_to_params_with_timeout (
159+ params = locals_to_params (
163160 dict (
164161 timeout = timeout ,
165162 force = force ,
@@ -177,7 +174,7 @@ async def tap(
177174 noWaitAfter : bool = None ,
178175 trial : bool = None ,
179176 ) -> None :
180- await self ._channel .send ("tap" , self . _locals_to_params_with_timeout (locals ()))
177+ await self ._channel .send ("tap" , locals_to_params (locals ()))
181178
182179 async def fill (
183180 self ,
@@ -186,17 +183,13 @@ async def fill(
186183 noWaitAfter : bool = None ,
187184 force : bool = None ,
188185 ) -> None :
189- await self ._channel .send ("fill" , self . _locals_to_params_with_timeout (locals ()))
186+ await self ._channel .send ("fill" , locals_to_params (locals ()))
190187
191188 async def select_text (self , force : bool = None , timeout : float = None ) -> None :
192- await self ._channel .send (
193- "selectText" , self ._locals_to_params_with_timeout (locals ())
194- )
189+ await self ._channel .send ("selectText" , locals_to_params (locals ()))
195190
196191 async def input_value (self , timeout : float = None ) -> str :
197- return await self ._channel .send (
198- "inputValue" , self ._locals_to_params_with_timeout (locals ())
199- )
192+ return await self ._channel .send ("inputValue" , locals_to_params (locals ()))
200193
201194 async def set_input_files (
202195 self ,
@@ -228,7 +221,7 @@ async def type(
228221 timeout : float = None ,
229222 noWaitAfter : bool = None ,
230223 ) -> None :
231- await self ._channel .send ("type" , self . _locals_to_params_with_timeout (locals ()))
224+ await self ._channel .send ("type" , locals_to_params (locals ()))
232225
233226 async def press (
234227 self ,
@@ -237,7 +230,7 @@ async def press(
237230 timeout : float = None ,
238231 noWaitAfter : bool = None ,
239232 ) -> None :
240- await self ._channel .send ("press" , self . _locals_to_params_with_timeout (locals ()))
233+ await self ._channel .send ("press" , locals_to_params (locals ()))
241234
242235 async def set_checked (
243236 self ,
@@ -271,7 +264,7 @@ async def check(
271264 noWaitAfter : bool = None ,
272265 trial : bool = None ,
273266 ) -> None :
274- await self ._channel .send ("check" , self . _locals_to_params_with_timeout (locals ()))
267+ await self ._channel .send ("check" , locals_to_params (locals ()))
275268
276269 async def uncheck (
277270 self ,
@@ -281,9 +274,7 @@ async def uncheck(
281274 noWaitAfter : bool = None ,
282275 trial : bool = None ,
283276 ) -> None :
284- await self ._channel .send (
285- "uncheck" , self ._locals_to_params_with_timeout (locals ())
286- )
277+ await self ._channel .send ("uncheck" , locals_to_params (locals ()))
287278
288279 async def bounding_box (self ) -> Optional [FloatRect ]:
289280 return await self ._channel .send ("boundingBox" )
@@ -302,7 +293,7 @@ async def screenshot(
302293 maskColor : str = None ,
303294 style : str = None ,
304295 ) -> bytes :
305- params = self . _locals_to_params_with_timeout (locals ())
296+ params = locals_to_params (locals ())
306297 if "path" in params :
307298 del params ["path" ]
308299 if "mask" in params :
@@ -378,9 +369,7 @@ async def wait_for_element_state(
378369 ],
379370 timeout : float = None ,
380371 ) -> None :
381- await self ._channel .send (
382- "waitForElementState" , self ._locals_to_params_with_timeout (locals ())
383- )
372+ await self ._channel .send ("waitForElementState" , locals_to_params (locals ()))
384373
385374 async def wait_for_selector (
386375 self ,
@@ -390,16 +379,9 @@ async def wait_for_selector(
390379 strict : bool = None ,
391380 ) -> Optional ["ElementHandle" ]:
392381 return from_nullable_channel (
393- await self ._channel .send (
394- "waitForSelector" , self ._locals_to_params_with_timeout (locals ())
395- )
382+ await self ._channel .send ("waitForSelector" , locals_to_params (locals ()))
396383 )
397384
398- def _locals_to_params_with_timeout (self , args : Dict ) -> Dict :
399- params = locals_to_params (args )
400- params ["timeout" ] = self ._frame ._timeout (params .get ("timeout" ))
401- return params
402-
403385
404386def convert_select_option_values (
405387 value : Union [str , Sequence [str ]] = None ,
0 commit comments