@@ -141,7 +141,7 @@ async def check(
141
141
noWaitAfter : bool = None ,
142
142
trial : bool = None ,
143
143
) -> None :
144
- params = locals_to_params (locals ())
144
+ params = self . _locals_to_params_with_timeout (locals ())
145
145
return await self ._frame .check (self ._selector , strict = True , ** params )
146
146
147
147
async def click (
@@ -156,7 +156,7 @@ async def click(
156
156
noWaitAfter : bool = None ,
157
157
trial : bool = None ,
158
158
) -> None :
159
- params = locals_to_params (locals ())
159
+ params = self . _locals_to_params_with_timeout (locals ())
160
160
return await self ._frame .click (self ._selector , strict = True , ** params )
161
161
162
162
async def dblclick (
@@ -170,7 +170,7 @@ async def dblclick(
170
170
noWaitAfter : bool = None ,
171
171
trial : bool = None ,
172
172
) -> None :
173
- params = locals_to_params (locals ())
173
+ params = self . _locals_to_params_with_timeout (locals ())
174
174
return await self ._frame .dblclick (self ._selector , strict = True , ** params )
175
175
176
176
async def dispatch_event (
@@ -179,7 +179,7 @@ async def dispatch_event(
179
179
eventInit : Dict = None ,
180
180
timeout : float = None ,
181
181
) -> None :
182
- params = locals_to_params (locals ())
182
+ params = self . _locals_to_params_with_timeout (locals ())
183
183
return await self ._frame .dispatch_event (self ._selector , strict = True , ** params )
184
184
185
185
async def evaluate (
@@ -191,7 +191,7 @@ async def evaluate(
191
191
)
192
192
193
193
async def evaluate_all (self , expression : str , arg : Serializable = None ) -> Any :
194
- params = locals_to_params (locals ())
194
+ params = self . _locals_to_params_with_timeout (locals ())
195
195
return await self ._frame .eval_on_selector_all (self ._selector , ** params )
196
196
197
197
async def evaluate_handle (
@@ -208,7 +208,7 @@ async def fill(
208
208
noWaitAfter : bool = None ,
209
209
force : bool = None ,
210
210
) -> None :
211
- params = locals_to_params (locals ())
211
+ params = self . _locals_to_params_with_timeout (locals ())
212
212
return await self ._frame .fill (self ._selector , strict = True , ** params )
213
213
214
214
async def clear (
@@ -311,7 +311,7 @@ async def element_handle(
311
311
self ,
312
312
timeout : float = None ,
313
313
) -> ElementHandle :
314
- params = locals_to_params (locals ())
314
+ params = self . _locals_to_params_with_timeout (locals ())
315
315
handle = await self ._frame .wait_for_selector (
316
316
self ._selector , strict = True , state = "attached" , ** params
317
317
)
@@ -377,7 +377,7 @@ def and_(self, locator: "Locator") -> "Locator":
377
377
)
378
378
379
379
async def focus (self , timeout : float = None ) -> None :
380
- params = locals_to_params (locals ())
380
+ params = self . _locals_to_params_with_timeout (locals ())
381
381
return await self ._frame .focus (self ._selector , strict = True , ** params )
382
382
383
383
async def blur (self , timeout : float = None ) -> None :
@@ -413,14 +413,14 @@ async def drag_to(
413
413
sourcePosition : Position = None ,
414
414
targetPosition : Position = None ,
415
415
) -> None :
416
- params = locals_to_params (locals ())
416
+ params = self . _locals_to_params_with_timeout (locals ())
417
417
del params ["target" ]
418
418
return await self ._frame .drag_and_drop (
419
419
self ._selector , target ._selector , strict = True , ** params
420
420
)
421
421
422
422
async def get_attribute (self , name : str , timeout : float = None ) -> Optional [str ]:
423
- params = locals_to_params (locals ())
423
+ params = self . _locals_to_params_with_timeout (locals ())
424
424
return await self ._frame .get_attribute (
425
425
self ._selector ,
426
426
strict = True ,
@@ -436,79 +436,79 @@ async def hover(
436
436
force : bool = None ,
437
437
trial : bool = None ,
438
438
) -> None :
439
- params = locals_to_params (locals ())
439
+ params = self . _locals_to_params_with_timeout (locals ())
440
440
return await self ._frame .hover (
441
441
self ._selector ,
442
442
strict = True ,
443
443
** params ,
444
444
)
445
445
446
446
async def inner_html (self , timeout : float = None ) -> str :
447
- params = locals_to_params (locals ())
447
+ params = self . _locals_to_params_with_timeout (locals ())
448
448
return await self ._frame .inner_html (
449
449
self ._selector ,
450
450
strict = True ,
451
451
** params ,
452
452
)
453
453
454
454
async def inner_text (self , timeout : float = None ) -> str :
455
- params = locals_to_params (locals ())
455
+ params = self . _locals_to_params_with_timeout (locals ())
456
456
return await self ._frame .inner_text (
457
457
self ._selector ,
458
458
strict = True ,
459
459
** params ,
460
460
)
461
461
462
462
async def input_value (self , timeout : float = None ) -> str :
463
- params = locals_to_params (locals ())
463
+ params = self . _locals_to_params_with_timeout (locals ())
464
464
return await self ._frame .input_value (
465
465
self ._selector ,
466
466
strict = True ,
467
467
** params ,
468
468
)
469
469
470
470
async def is_checked (self , timeout : float = None ) -> bool :
471
- params = locals_to_params (locals ())
471
+ params = self . _locals_to_params_with_timeout (locals ())
472
472
return await self ._frame .is_checked (
473
473
self ._selector ,
474
474
strict = True ,
475
475
** params ,
476
476
)
477
477
478
478
async def is_disabled (self , timeout : float = None ) -> bool :
479
- params = locals_to_params (locals ())
479
+ params = self . _locals_to_params_with_timeout (locals ())
480
480
return await self ._frame .is_disabled (
481
481
self ._selector ,
482
482
strict = True ,
483
483
** params ,
484
484
)
485
485
486
486
async def is_editable (self , timeout : float = None ) -> bool :
487
- params = locals_to_params (locals ())
487
+ params = self . _locals_to_params_with_timeout (locals ())
488
488
return await self ._frame .is_editable (
489
489
self ._selector ,
490
490
strict = True ,
491
491
** params ,
492
492
)
493
493
494
494
async def is_enabled (self , timeout : float = None ) -> bool :
495
- params = locals_to_params (locals ())
495
+ params = self . _locals_to_params_with_timeout (locals ())
496
496
return await self ._frame .is_enabled (
497
497
self ._selector ,
498
498
strict = True ,
499
499
** params ,
500
500
)
501
501
502
502
async def is_hidden (self , timeout : float = None ) -> bool :
503
- params = locals_to_params (locals ())
503
+ params = self . _locals_to_params_with_timeout (locals ())
504
504
return await self ._frame .is_hidden (
505
505
self ._selector ,
506
506
strict = True ,
507
507
** params ,
508
508
)
509
509
510
510
async def is_visible (self , timeout : float = None ) -> bool :
511
- params = locals_to_params (locals ())
511
+ params = self . _locals_to_params_with_timeout (locals ())
512
512
return await self ._frame .is_visible (
513
513
self ._selector ,
514
514
strict = True ,
@@ -522,7 +522,7 @@ async def press(
522
522
timeout : float = None ,
523
523
noWaitAfter : bool = None ,
524
524
) -> None :
525
- params = locals_to_params (locals ())
525
+ params = self . _locals_to_params_with_timeout (locals ())
526
526
return await self ._frame .press (self ._selector , strict = True , ** params )
527
527
528
528
async def screenshot (
@@ -539,7 +539,7 @@ async def screenshot(
539
539
maskColor : str = None ,
540
540
style : str = None ,
541
541
) -> bytes :
542
- params = locals_to_params (locals ())
542
+ params = self . _locals_to_params_with_timeout (locals ())
543
543
return await self ._with_element (
544
544
lambda h , timeout : h .screenshot (
545
545
** {** params , "timeout" : timeout },
@@ -574,15 +574,15 @@ async def select_option(
574
574
noWaitAfter : bool = None ,
575
575
force : bool = None ,
576
576
) -> List [str ]:
577
- params = locals_to_params (locals ())
577
+ params = self . _locals_to_params_with_timeout (locals ())
578
578
return await self ._frame .select_option (
579
579
self ._selector ,
580
580
strict = True ,
581
581
** params ,
582
582
)
583
583
584
584
async def select_text (self , force : bool = None , timeout : float = None ) -> None :
585
- params = locals_to_params (locals ())
585
+ params = self . _locals_to_params_with_timeout (locals ())
586
586
return await self ._with_element (
587
587
lambda h , timeout : h .select_text (** {** params , "timeout" : timeout }),
588
588
timeout ,
@@ -600,7 +600,7 @@ async def set_input_files(
600
600
timeout : float = None ,
601
601
noWaitAfter : bool = None ,
602
602
) -> None :
603
- params = locals_to_params (locals ())
603
+ params = self . _locals_to_params_with_timeout (locals ())
604
604
return await self ._frame .set_input_files (
605
605
self ._selector ,
606
606
strict = True ,
@@ -616,15 +616,15 @@ async def tap(
616
616
noWaitAfter : bool = None ,
617
617
trial : bool = None ,
618
618
) -> None :
619
- params = locals_to_params (locals ())
619
+ params = self . _locals_to_params_with_timeout (locals ())
620
620
return await self ._frame .tap (
621
621
self ._selector ,
622
622
strict = True ,
623
623
** params ,
624
624
)
625
625
626
626
async def text_content (self , timeout : float = None ) -> Optional [str ]:
627
- params = locals_to_params (locals ())
627
+ params = self . _locals_to_params_with_timeout (locals ())
628
628
return await self ._frame .text_content (
629
629
self ._selector ,
630
630
strict = True ,
@@ -638,7 +638,7 @@ async def type(
638
638
timeout : float = None ,
639
639
noWaitAfter : bool = None ,
640
640
) -> None :
641
- params = locals_to_params (locals ())
641
+ params = self . _locals_to_params_with_timeout (locals ())
642
642
return await self ._frame .type (
643
643
self ._selector ,
644
644
strict = True ,
@@ -662,7 +662,7 @@ async def uncheck(
662
662
noWaitAfter : bool = None ,
663
663
trial : bool = None ,
664
664
) -> None :
665
- params = locals_to_params (locals ())
665
+ params = self . _locals_to_params_with_timeout (locals ())
666
666
return await self ._frame .uncheck (
667
667
self ._selector ,
668
668
strict = True ,
@@ -859,6 +859,11 @@ def nth(self, index: int) -> "FrameLocator":
859
859
def __repr__ (self ) -> str :
860
860
return f"<FrameLocator frame={ self ._frame !r} selector={ self ._frame_selector !r} >"
861
861
862
+ def _locals_to_params_with_timeout (self , args : Dict ) -> Dict :
863
+ params = locals_to_params (args )
864
+ params ["timeout" ] = self ._frame ._timeout (params .get ("timeout" ))
865
+ return params
866
+
862
867
863
868
_test_id_attribute_name : str = "data-testid"
864
869
0 commit comments