Skip to content

Commit d568d70

Browse files
committed
fix(locator): fix is_enabled method
1 parent ab02bb0 commit d568d70

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

playwright/_impl/_locator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ async def is_editable(self, timeout: float = None) -> bool:
481481

482482
async def is_enabled(self, timeout: float = None) -> bool:
483483
params = locals_to_params(locals())
484-
return await self._frame.is_editable(
484+
return await self._frame.is_enabled(
485485
self._selector,
486486
strict=True,
487487
**params,

tests/async/test_fill.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,14 @@ async def test_fill_textarea(page: Page, server: Server) -> None:
2222
assert await page.evaluate("result") == "some value"
2323

2424

25-
#
25+
async def test_is_enabled_for_non_editable_button(page: Page) -> None:
26+
await page.set_content(
27+
"""
28+
<button>button</button>
29+
"""
30+
)
31+
button = page.locator("button")
32+
assert await button.is_enabled() is True
2633

2734

2835
async def test_fill_input(page: Page, server: Server) -> None:

0 commit comments

Comments
 (0)