@@ -6664,7 +6664,9 @@ def set_test_id_attribute(self, attribute_name: str) -> None:
6664
6664
6665
6665
class Clock(AsyncBase):
6666
6666
async def install(
6667
- self, *, time: typing.Optional[typing.Union[int, str, datetime.datetime]] = None
6667
+ self,
6668
+ *,
6669
+ time: typing.Optional[typing.Union[float, str, datetime.datetime]] = None
6668
6670
) -> None:
6669
6671
"""Clock.install
6670
6672
@@ -6686,13 +6688,13 @@ async def install(
6686
6688
6687
6689
Parameters
6688
6690
----------
6689
- time : Union[datetime.datetime, int , str, None]
6691
+ time : Union[datetime.datetime, float , str, None]
6690
6692
Time to initialize with, current system time by default.
6691
6693
"""
6692
6694
6693
6695
return mapping.from_maybe_impl(await self._impl_obj.install(time=time))
6694
6696
6695
- async def fast_forward(self, ticks: typing.Union[int , str]) -> None:
6697
+ async def fast_forward(self, ticks: typing.Union[float , str]) -> None:
6696
6698
"""Clock.fast_forward
6697
6699
6698
6700
Advance the clock by jumping forward in time. Only fires due timers at most once. This is equivalent to user
@@ -6707,14 +6709,14 @@ async def fast_forward(self, ticks: typing.Union[int, str]) -> None:
6707
6709
6708
6710
Parameters
6709
6711
----------
6710
- ticks : Union[int , str]
6712
+ ticks : Union[float , str]
6711
6713
Time may be the number of milliseconds to advance the clock by or a human-readable string. Valid string formats are
6712
6714
"08" for eight seconds, "01:00" for one minute and "02:34:10" for two hours, 34 minutes and ten seconds.
6713
6715
"""
6714
6716
6715
6717
return mapping.from_maybe_impl(await self._impl_obj.fast_forward(ticks=ticks))
6716
6718
6717
- async def pause_at(self, time: typing.Union[int , str, datetime.datetime]) -> None:
6719
+ async def pause_at(self, time: typing.Union[float , str, datetime.datetime]) -> None:
6718
6720
"""Clock.pause_at
6719
6721
6720
6722
Advance the clock by jumping forward in time and pause the time. Once this method is called, no timers are fired
@@ -6733,7 +6735,7 @@ async def pause_at(self, time: typing.Union[int, str, datetime.datetime]) -> Non
6733
6735
6734
6736
Parameters
6735
6737
----------
6736
- time : Union[datetime.datetime, int , str]
6738
+ time : Union[datetime.datetime, float , str]
6737
6739
"""
6738
6740
6739
6741
return mapping.from_maybe_impl(await self._impl_obj.pause_at(time=time))
@@ -6746,7 +6748,7 @@ async def resume(self) -> None:
6746
6748
6747
6749
return mapping.from_maybe_impl(await self._impl_obj.resume())
6748
6750
6749
- async def run_for(self, ticks: typing.Union[int , str]) -> None:
6751
+ async def run_for(self, ticks: typing.Union[float , str]) -> None:
6750
6752
"""Clock.run_for
6751
6753
6752
6754
Advance the clock, firing all the time-related callbacks.
@@ -6760,15 +6762,15 @@ async def run_for(self, ticks: typing.Union[int, str]) -> None:
6760
6762
6761
6763
Parameters
6762
6764
----------
6763
- ticks : Union[int , str]
6765
+ ticks : Union[float , str]
6764
6766
Time may be the number of milliseconds to advance the clock by or a human-readable string. Valid string formats are
6765
6767
"08" for eight seconds, "01:00" for one minute and "02:34:10" for two hours, 34 minutes and ten seconds.
6766
6768
"""
6767
6769
6768
6770
return mapping.from_maybe_impl(await self._impl_obj.run_for(ticks=ticks))
6769
6771
6770
6772
async def set_fixed_time(
6771
- self, time: typing.Union[int , str, datetime.datetime]
6773
+ self, time: typing.Union[float , str, datetime.datetime]
6772
6774
) -> None:
6773
6775
"""Clock.set_fixed_time
6774
6776
@@ -6784,14 +6786,14 @@ async def set_fixed_time(
6784
6786
6785
6787
Parameters
6786
6788
----------
6787
- time : Union[datetime.datetime, int , str]
6789
+ time : Union[datetime.datetime, float , str]
6788
6790
Time to be set.
6789
6791
"""
6790
6792
6791
6793
return mapping.from_maybe_impl(await self._impl_obj.set_fixed_time(time=time))
6792
6794
6793
6795
async def set_system_time(
6794
- self, time: typing.Union[int , str, datetime.datetime]
6796
+ self, time: typing.Union[float , str, datetime.datetime]
6795
6797
) -> None:
6796
6798
"""Clock.set_system_time
6797
6799
@@ -6807,7 +6809,7 @@ async def set_system_time(
6807
6809
6808
6810
Parameters
6809
6811
----------
6810
- time : Union[datetime.datetime, int , str]
6812
+ time : Union[datetime.datetime, float , str]
6811
6813
"""
6812
6814
6813
6815
return mapping.from_maybe_impl(await self._impl_obj.set_system_time(time=time))
@@ -8662,22 +8664,6 @@ async def main():
8662
8664
asyncio.run(main())
8663
8665
```
8664
8666
8665
- An example of passing an element handle:
8666
-
8667
- ```py
8668
- async def print(source, element):
8669
- print(await element.text_content())
8670
-
8671
- await page.expose_binding(\"clicked\", print, handle=true)
8672
- await page.set_content(\"\"\"
8673
- <script>
8674
- document.addEventListener('click', event => window.clicked(event.target));
8675
- </script>
8676
- <div>Click me</div>
8677
- <div>Or click me</div>
8678
- \"\"\")
8679
- ```
8680
-
8681
8667
Parameters
8682
8668
----------
8683
8669
name : str
@@ -8687,6 +8673,7 @@ async def print(source, element):
8687
8673
handle : Union[bool, None]
8688
8674
Whether to pass the argument as a handle, instead of passing by value. When passing a handle, only one argument is
8689
8675
supported. When passing by value, multiple arguments are supported.
8676
+ Deprecated: This option will be removed in the future.
8690
8677
"""
8691
8678
8692
8679
return mapping.from_maybe_impl(
@@ -12849,22 +12836,6 @@ async def main():
12849
12836
asyncio.run(main())
12850
12837
```
12851
12838
12852
- An example of passing an element handle:
12853
-
12854
- ```py
12855
- async def print(source, element):
12856
- print(await element.text_content())
12857
-
12858
- await context.expose_binding(\"clicked\", print, handle=true)
12859
- await page.set_content(\"\"\"
12860
- <script>
12861
- document.addEventListener('click', event => window.clicked(event.target));
12862
- </script>
12863
- <div>Click me</div>
12864
- <div>Or click me</div>
12865
- \"\"\")
12866
- ```
12867
-
12868
12839
Parameters
12869
12840
----------
12870
12841
name : str
@@ -12874,6 +12845,7 @@ async def print(source, element):
12874
12845
handle : Union[bool, None]
12875
12846
Whether to pass the argument as a handle, instead of passing by value. When passing a handle, only one argument is
12876
12847
supported. When passing by value, multiple arguments are supported.
12848
+ Deprecated: This option will be removed in the future.
12877
12849
"""
12878
12850
12879
12851
return mapping.from_maybe_impl(
0 commit comments