From a4eabe49acb57572eae0e284707b250b6378a488 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 23:49:55 +0100 Subject: [PATCH 01/57] build(deps): bump black from 24.8.0 to 25.1.0 (#2729) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- local-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local-requirements.txt b/local-requirements.txt index 7134a315e..ac33a871c 100644 --- a/local-requirements.txt +++ b/local-requirements.txt @@ -1,5 +1,5 @@ autobahn==23.1.2 -black==24.8.0 +black==25.1.0 build==1.2.2.post1 flake8==7.1.1 flaky==3.8.1 From ab02bb04d2c8d775ec03ad4b6d5d623ac24d9978 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 23:50:04 +0100 Subject: [PATCH 02/57] build(deps): bump pytest-asyncio from 0.25.2 to 0.25.3 (#2728) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- local-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local-requirements.txt b/local-requirements.txt index ac33a871c..a81932b5e 100644 --- a/local-requirements.txt +++ b/local-requirements.txt @@ -10,7 +10,7 @@ pixelmatch==0.3.0 pre-commit==3.5.0 pyOpenSSL==24.3.0 pytest==8.3.4 -pytest-asyncio==0.25.2 +pytest-asyncio==0.25.3 pytest-cov==6.0.0 pytest-repeat==0.9.3 pytest-timeout==2.3.1 From c88f12a6d6f292bacf3571dc15700df1f8d2e6d6 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Wed, 5 Feb 2025 12:39:15 +0100 Subject: [PATCH 03/57] fix(locator): fix is_enabled method (#2732) --- playwright/_impl/_locator.py | 2 +- tests/async/test_fill.py | 9 ++++++++- tests/async/test_locators.py | 18 +++--------------- tests/sync/test_locators.py | 18 +++--------------- 4 files changed, 15 insertions(+), 32 deletions(-) diff --git a/playwright/_impl/_locator.py b/playwright/_impl/_locator.py index 91ea79064..1ad18f999 100644 --- a/playwright/_impl/_locator.py +++ b/playwright/_impl/_locator.py @@ -481,7 +481,7 @@ async def is_editable(self, timeout: float = None) -> bool: async def is_enabled(self, timeout: float = None) -> bool: params = locals_to_params(locals()) - return await self._frame.is_editable( + return await self._frame.is_enabled( self._selector, strict=True, **params, diff --git a/tests/async/test_fill.py b/tests/async/test_fill.py index 4dd6db321..c5f0a55be 100644 --- a/tests/async/test_fill.py +++ b/tests/async/test_fill.py @@ -22,7 +22,14 @@ async def test_fill_textarea(page: Page, server: Server) -> None: assert await page.evaluate("result") == "some value" -# +async def test_is_enabled_for_non_editable_button(page: Page) -> None: + await page.set_content( + """ + + """ + ) + button = page.locator("button") + assert await button.is_enabled() is True async def test_fill_input(page: Page, server: Server) -> None: diff --git a/tests/async/test_locators.py b/tests/async/test_locators.py index 385538461..aceb39991 100644 --- a/tests/async/test_locators.py +++ b/tests/async/test_locators.py @@ -128,27 +128,15 @@ async def test_locators_is_enabled_and_is_disabled_should_work(page: Page) -> No ) div = page.locator("div") - with pytest.raises( - Error, - match=r"Element is not an ,