@@ -6774,7 +6774,9 @@ def set_test_id_attribute(self, attribute_name: str) -> None:
6774
6774
6775
6775
class Clock(SyncBase):
6776
6776
def install(
6777
- self, *, time: typing.Optional[typing.Union[int, str, datetime.datetime]] = None
6777
+ self,
6778
+ *,
6779
+ time: typing.Optional[typing.Union[float, str, datetime.datetime]] = None
6778
6780
) -> None:
6779
6781
"""Clock.install
6780
6782
@@ -6796,7 +6798,7 @@ def install(
6796
6798
6797
6799
Parameters
6798
6800
----------
6799
- time : Union[datetime.datetime, int , str, None]
6801
+ time : Union[datetime.datetime, float , str, None]
6800
6802
Time to initialize with, current system time by default.
6801
6803
"""
6802
6804
@@ -6826,7 +6828,7 @@ def fast_forward(self, ticks: typing.Union[int, str]) -> None:
6826
6828
self._sync(self._impl_obj.fast_forward(ticks=ticks))
6827
6829
)
6828
6830
6829
- def pause_at(self, time: typing.Union[int , str, datetime.datetime]) -> None:
6831
+ def pause_at(self, time: typing.Union[float , str, datetime.datetime]) -> None:
6830
6832
"""Clock.pause_at
6831
6833
6832
6834
Advance the clock by jumping forward in time and pause the time. Once this method is called, no timers are fired
@@ -6845,7 +6847,8 @@ def pause_at(self, time: typing.Union[int, str, datetime.datetime]) -> None:
6845
6847
6846
6848
Parameters
6847
6849
----------
6848
- time : Union[datetime.datetime, int, str]
6850
+ time : Union[datetime.datetime, float, str]
6851
+ Time to pause at.
6849
6852
"""
6850
6853
6851
6854
return mapping.from_maybe_impl(self._sync(self._impl_obj.pause_at(time=time)))
@@ -6879,7 +6882,7 @@ def run_for(self, ticks: typing.Union[int, str]) -> None:
6879
6882
6880
6883
return mapping.from_maybe_impl(self._sync(self._impl_obj.run_for(ticks=ticks)))
6881
6884
6882
- def set_fixed_time(self, time: typing.Union[int , str, datetime.datetime]) -> None:
6885
+ def set_fixed_time(self, time: typing.Union[float , str, datetime.datetime]) -> None:
6883
6886
"""Clock.set_fixed_time
6884
6887
6885
6888
Makes `Date.now` and `new Date()` return fixed fake time at all times, keeps all the timers running.
@@ -6894,15 +6897,17 @@ def set_fixed_time(self, time: typing.Union[int, str, datetime.datetime]) -> Non
6894
6897
6895
6898
Parameters
6896
6899
----------
6897
- time : Union[datetime.datetime, int , str]
6900
+ time : Union[datetime.datetime, float , str]
6898
6901
Time to be set.
6899
6902
"""
6900
6903
6901
6904
return mapping.from_maybe_impl(
6902
6905
self._sync(self._impl_obj.set_fixed_time(time=time))
6903
6906
)
6904
6907
6905
- def set_system_time(self, time: typing.Union[int, str, datetime.datetime]) -> None:
6908
+ def set_system_time(
6909
+ self, time: typing.Union[float, str, datetime.datetime]
6910
+ ) -> None:
6906
6911
"""Clock.set_system_time
6907
6912
6908
6913
Sets current system time but does not trigger any timers.
@@ -6917,7 +6922,8 @@ def set_system_time(self, time: typing.Union[int, str, datetime.datetime]) -> No
6917
6922
6918
6923
Parameters
6919
6924
----------
6920
- time : Union[datetime.datetime, int, str]
6925
+ time : Union[datetime.datetime, float, str]
6926
+ Time to be set.
6921
6927
"""
6922
6928
6923
6929
return mapping.from_maybe_impl(
@@ -8689,22 +8695,6 @@ def run(playwright: Playwright):
8689
8695
run(playwright)
8690
8696
```
8691
8697
8692
- An example of passing an element handle:
8693
-
8694
- ```py
8695
- def print(source, element):
8696
- print(element.text_content())
8697
-
8698
- page.expose_binding(\"clicked\", print, handle=true)
8699
- page.set_content(\"\"\"
8700
- <script>
8701
- document.addEventListener('click', event => window.clicked(event.target));
8702
- </script>
8703
- <div>Click me</div>
8704
- <div>Or click me</div>
8705
- \"\"\")
8706
- ```
8707
-
8708
8698
Parameters
8709
8699
----------
8710
8700
name : str
@@ -8714,6 +8704,7 @@ def print(source, element):
8714
8704
handle : Union[bool, None]
8715
8705
Whether to pass the argument as a handle, instead of passing by value. When passing a handle, only one argument is
8716
8706
supported. When passing by value, multiple arguments are supported.
8707
+ Deprecated: This option will be removed in the future.
8717
8708
"""
8718
8709
8719
8710
return mapping.from_maybe_impl(
@@ -12871,22 +12862,6 @@ def run(playwright: Playwright):
12871
12862
run(playwright)
12872
12863
```
12873
12864
12874
- An example of passing an element handle:
12875
-
12876
- ```py
12877
- def print(source, element):
12878
- print(element.text_content())
12879
-
12880
- context.expose_binding(\"clicked\", print, handle=true)
12881
- page.set_content(\"\"\"
12882
- <script>
12883
- document.addEventListener('click', event => window.clicked(event.target));
12884
- </script>
12885
- <div>Click me</div>
12886
- <div>Or click me</div>
12887
- \"\"\")
12888
- ```
12889
-
12890
12865
Parameters
12891
12866
----------
12892
12867
name : str
@@ -12896,6 +12871,7 @@ def print(source, element):
12896
12871
handle : Union[bool, None]
12897
12872
Whether to pass the argument as a handle, instead of passing by value. When passing a handle, only one argument is
12898
12873
supported. When passing by value, multiple arguments are supported.
12874
+ Deprecated: This option will be removed in the future.
12899
12875
"""
12900
12876
12901
12877
return mapping.from_maybe_impl(
0 commit comments