Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions playwright/_impl/_api_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,5 @@ class SecurityDetails(TypedDict):
issuer: Optional[str]
protocol: Optional[str]
subjectName: Optional[str]
validFrom: Optional[int]
validTo: Optional[int]
validFrom: Optional[float]
validTo: Optional[float]
4 changes: 2 additions & 2 deletions playwright/_impl/_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,10 @@ async def is_editable(self, selector: str, timeout: float = None) -> bool:
async def is_enabled(self, selector: str, timeout: float = None) -> bool:
return await self._channel.send("isEnabled", locals_to_params(locals()))

async def is_hidden(self, selector: str) -> bool:
async def is_hidden(self, selector: str, timeout: float = None) -> bool:
return await self._channel.send("isHidden", locals_to_params(locals()))

async def is_visible(self, selector: str) -> bool:
async def is_visible(self, selector: str, timeout: float = None) -> bool:
return await self._channel.send("isVisible", locals_to_params(locals()))

async def dispatch_event(
Expand Down
4 changes: 2 additions & 2 deletions playwright/_impl/_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,10 @@ async def is_editable(self, selector: str, timeout: float = None) -> bool:
async def is_enabled(self, selector: str, timeout: float = None) -> bool:
return await self._main_frame.is_enabled(**locals_to_params(locals()))

async def is_hidden(self, selector: str) -> bool:
async def is_hidden(self, selector: str, timeout: float = None) -> bool:
return await self._main_frame.is_hidden(**locals_to_params(locals()))

async def is_visible(self, selector: str) -> bool:
async def is_visible(self, selector: str, timeout: float = None) -> bool:
return await self._main_frame.is_visible(**locals_to_params(locals()))

async def dispatch_event(
Expand Down
34 changes: 25 additions & 9 deletions playwright/async_api/_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ async def security_details(self) -> typing.Optional[SecurityDetails]:

Returns
-------
Union[{issuer: Union[str, NoneType], protocol: Union[str, NoneType], subjectName: Union[str, NoneType], validFrom: Union[int, NoneType], validTo: Union[int, NoneType]}, NoneType]
Union[{issuer: Union[str, NoneType], protocol: Union[str, NoneType], subjectName: Union[str, NoneType], validFrom: Union[float, NoneType], validTo: Union[float, NoneType]}, NoneType]
"""

return mapping.from_impl_nullable(
Expand Down Expand Up @@ -3283,7 +3283,7 @@ async def is_enabled(self, selector: str, *, timeout: float = None) -> bool:
)
)

async def is_hidden(self, selector: str) -> bool:
async def is_hidden(self, selector: str, *, timeout: float = None) -> bool:
"""Frame.is_hidden

Returns whether the element is hidden, the opposite of [visible](./actionability.md#visible). `selector` that does not
Expand All @@ -3294,6 +3294,9 @@ async def is_hidden(self, selector: str) -> bool:
selector : str
A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See
[working with selectors](./selectors.md) for more details.
timeout : Union[float, NoneType]
Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
using the `browser_context.set_default_timeout()` or `page.set_default_timeout()` methods.

Returns
-------
Expand All @@ -3302,11 +3305,12 @@ async def is_hidden(self, selector: str) -> bool:

return mapping.from_maybe_impl(
await self._async(
"frame.is_hidden", self._impl_obj.is_hidden(selector=selector)
"frame.is_hidden",
self._impl_obj.is_hidden(selector=selector, timeout=timeout),
)
)

async def is_visible(self, selector: str) -> bool:
async def is_visible(self, selector: str, *, timeout: float = None) -> bool:
"""Frame.is_visible

Returns whether the element is [visible](./actionability.md#visible). `selector` that does not match any elements is
Expand All @@ -3317,6 +3321,9 @@ async def is_visible(self, selector: str) -> bool:
selector : str
A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See
[working with selectors](./selectors.md) for more details.
timeout : Union[float, NoneType]
Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
using the `browser_context.set_default_timeout()` or `page.set_default_timeout()` methods.

Returns
-------
Expand All @@ -3325,7 +3332,8 @@ async def is_visible(self, selector: str) -> bool:

return mapping.from_maybe_impl(
await self._async(
"frame.is_visible", self._impl_obj.is_visible(selector=selector)
"frame.is_visible",
self._impl_obj.is_visible(selector=selector, timeout=timeout),
)
)

Expand Down Expand Up @@ -5455,7 +5463,7 @@ async def is_enabled(self, selector: str, *, timeout: float = None) -> bool:
)
)

async def is_hidden(self, selector: str) -> bool:
async def is_hidden(self, selector: str, *, timeout: float = None) -> bool:
"""Page.is_hidden

Returns whether the element is hidden, the opposite of [visible](./actionability.md#visible). `selector` that does not
Expand All @@ -5466,6 +5474,9 @@ async def is_hidden(self, selector: str) -> bool:
selector : str
A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See
[working with selectors](./selectors.md) for more details.
timeout : Union[float, NoneType]
Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
using the `browser_context.set_default_timeout()` or `page.set_default_timeout()` methods.

Returns
-------
Expand All @@ -5474,11 +5485,12 @@ async def is_hidden(self, selector: str) -> bool:

return mapping.from_maybe_impl(
await self._async(
"page.is_hidden", self._impl_obj.is_hidden(selector=selector)
"page.is_hidden",
self._impl_obj.is_hidden(selector=selector, timeout=timeout),
)
)

async def is_visible(self, selector: str) -> bool:
async def is_visible(self, selector: str, *, timeout: float = None) -> bool:
"""Page.is_visible

Returns whether the element is [visible](./actionability.md#visible). `selector` that does not match any elements is
Expand All @@ -5489,6 +5501,9 @@ async def is_visible(self, selector: str) -> bool:
selector : str
A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See
[working with selectors](./selectors.md) for more details.
timeout : Union[float, NoneType]
Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
using the `browser_context.set_default_timeout()` or `page.set_default_timeout()` methods.

Returns
-------
Expand All @@ -5497,7 +5512,8 @@ async def is_visible(self, selector: str) -> bool:

return mapping.from_maybe_impl(
await self._async(
"page.is_visible", self._impl_obj.is_visible(selector=selector)
"page.is_visible",
self._impl_obj.is_visible(selector=selector, timeout=timeout),
)
)

Expand Down
42 changes: 33 additions & 9 deletions playwright/sync_api/_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ def security_details(self) -> typing.Optional[SecurityDetails]:

Returns
-------
Union[{issuer: Union[str, NoneType], protocol: Union[str, NoneType], subjectName: Union[str, NoneType], validFrom: Union[int, NoneType], validTo: Union[int, NoneType]}, NoneType]
Union[{issuer: Union[str, NoneType], protocol: Union[str, NoneType], subjectName: Union[str, NoneType], validFrom: Union[float, NoneType], validTo: Union[float, NoneType]}, NoneType]
"""

return mapping.from_impl_nullable(
Expand Down Expand Up @@ -3261,7 +3261,7 @@ def is_enabled(self, selector: str, *, timeout: float = None) -> bool:
)
)

def is_hidden(self, selector: str) -> bool:
def is_hidden(self, selector: str, *, timeout: float = None) -> bool:
"""Frame.is_hidden

Returns whether the element is hidden, the opposite of [visible](./actionability.md#visible). `selector` that does not
Expand All @@ -3272,17 +3272,23 @@ def is_hidden(self, selector: str) -> bool:
selector : str
A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See
[working with selectors](./selectors.md) for more details.
timeout : Union[float, NoneType]
Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
using the `browser_context.set_default_timeout()` or `page.set_default_timeout()` methods.

Returns
-------
bool
"""

return mapping.from_maybe_impl(
self._sync("frame.is_hidden", self._impl_obj.is_hidden(selector=selector))
self._sync(
"frame.is_hidden",
self._impl_obj.is_hidden(selector=selector, timeout=timeout),
)
)

def is_visible(self, selector: str) -> bool:
def is_visible(self, selector: str, *, timeout: float = None) -> bool:
"""Frame.is_visible

Returns whether the element is [visible](./actionability.md#visible). `selector` that does not match any elements is
Expand All @@ -3293,14 +3299,20 @@ def is_visible(self, selector: str) -> bool:
selector : str
A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See
[working with selectors](./selectors.md) for more details.
timeout : Union[float, NoneType]
Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
using the `browser_context.set_default_timeout()` or `page.set_default_timeout()` methods.

Returns
-------
bool
"""

return mapping.from_maybe_impl(
self._sync("frame.is_visible", self._impl_obj.is_visible(selector=selector))
self._sync(
"frame.is_visible",
self._impl_obj.is_visible(selector=selector, timeout=timeout),
)
)

def dispatch_event(
Expand Down Expand Up @@ -5417,7 +5429,7 @@ def is_enabled(self, selector: str, *, timeout: float = None) -> bool:
)
)

def is_hidden(self, selector: str) -> bool:
def is_hidden(self, selector: str, *, timeout: float = None) -> bool:
"""Page.is_hidden

Returns whether the element is hidden, the opposite of [visible](./actionability.md#visible). `selector` that does not
Expand All @@ -5428,17 +5440,23 @@ def is_hidden(self, selector: str) -> bool:
selector : str
A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See
[working with selectors](./selectors.md) for more details.
timeout : Union[float, NoneType]
Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
using the `browser_context.set_default_timeout()` or `page.set_default_timeout()` methods.

Returns
-------
bool
"""

return mapping.from_maybe_impl(
self._sync("page.is_hidden", self._impl_obj.is_hidden(selector=selector))
self._sync(
"page.is_hidden",
self._impl_obj.is_hidden(selector=selector, timeout=timeout),
)
)

def is_visible(self, selector: str) -> bool:
def is_visible(self, selector: str, *, timeout: float = None) -> bool:
"""Page.is_visible

Returns whether the element is [visible](./actionability.md#visible). `selector` that does not match any elements is
Expand All @@ -5449,14 +5467,20 @@ def is_visible(self, selector: str) -> bool:
selector : str
A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See
[working with selectors](./selectors.md) for more details.
timeout : Union[float, NoneType]
Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
using the `browser_context.set_default_timeout()` or `page.set_default_timeout()` methods.

Returns
-------
bool
"""

return mapping.from_maybe_impl(
self._sync("page.is_visible", self._impl_obj.is_visible(selector=selector))
self._sync(
"page.is_visible",
self._impl_obj.is_visible(selector=selector, timeout=timeout),
)
)

def dispatch_event(
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
InWheel = None
from wheel.bdist_wheel import bdist_wheel as BDistWheelCommand

driver_version = "1.13.0-next-1625812834000"
driver_version = "1.13.0-next-1626254028000"


def extractall(zip: zipfile.ZipFile, path: str) -> None:
Expand Down