diff --git a/playwright/_impl/_locator.py b/playwright/_impl/_locator.py index 6fe075130..a1ea180ed 100644 --- a/playwright/_impl/_locator.py +++ b/playwright/_impl/_locator.py @@ -501,19 +501,17 @@ async def is_enabled(self, timeout: float = None) -> bool: ) async def is_hidden(self, timeout: float = None) -> bool: - params = locals_to_params(locals()) + # timeout is deprecated and does nothing return await self._frame.is_hidden( self._selector, strict=True, - **params, ) async def is_visible(self, timeout: float = None) -> bool: - params = locals_to_params(locals()) + # timeout is deprecated and does nothing return await self._frame.is_visible( self._selector, strict=True, - **params, ) async def press( diff --git a/playwright/_impl/_page.py b/playwright/_impl/_page.py index 20bba35db..55ee44df2 100644 --- a/playwright/_impl/_page.py +++ b/playwright/_impl/_page.py @@ -447,12 +447,14 @@ async def is_enabled( async def is_hidden( self, selector: str, strict: bool = None, timeout: float = None ) -> bool: - return await self._main_frame.is_hidden(**locals_to_params(locals())) + # timeout is deprecated and does nothing + return await self._main_frame.is_hidden(selector=selector, strict=strict) async def is_visible( self, selector: str, strict: bool = None, timeout: float = None ) -> bool: - return await self._main_frame.is_visible(**locals_to_params(locals())) + # timeout is deprecated and does nothing + return await self._main_frame.is_visible(selector=selector, strict=strict) async def dispatch_event( self, diff --git a/tests/async/test_locators.py b/tests/async/test_locators.py index a5891f558..980de041f 100644 --- a/tests/async/test_locators.py +++ b/tests/async/test_locators.py @@ -1143,3 +1143,12 @@ async def test_locator_click_timeout_error_should_contain_call_log(page: Page) - "During handling of the above exception, another exception occurred" not in formatted_exception ) + + +async def test_locator_should_ignore_deprecated_is_hidden_and_visible_timeout( + page: Page, +) -> None: + await page.set_content("