Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb7882d9

Browse files
authored
fix(api): ignore deprecated timeout arg provided to is_visible/hidden (#2905)
1 parent3713a32 commitb7882d9

File tree

6 files changed

+40
-6
lines changed

6 files changed

+40
-6
lines changed

‎playwright/_impl/_locator.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -501,19 +501,17 @@ async def is_enabled(self, timeout: float = None) -> bool:
501501
)
502502

503503
asyncdefis_hidden(self,timeout:float=None)->bool:
504-
params=locals_to_params(locals())
504+
# timeout is deprecated and does nothing
505505
returnawaitself._frame.is_hidden(
506506
self._selector,
507507
strict=True,
508-
**params,
509508
)
510509

511510
asyncdefis_visible(self,timeout:float=None)->bool:
512-
params=locals_to_params(locals())
511+
# timeout is deprecated and does nothing
513512
returnawaitself._frame.is_visible(
514513
self._selector,
515514
strict=True,
516-
**params,
517515
)
518516

519517
asyncdefpress(

‎playwright/_impl/_page.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,12 +447,14 @@ async def is_enabled(
447447
asyncdefis_hidden(
448448
self,selector:str,strict:bool=None,timeout:float=None
449449
)->bool:
450-
returnawaitself._main_frame.is_hidden(**locals_to_params(locals()))
450+
# timeout is deprecated and does nothing
451+
returnawaitself._main_frame.is_hidden(selector=selector,strict=strict)
451452

452453
asyncdefis_visible(
453454
self,selector:str,strict:bool=None,timeout:float=None
454455
)->bool:
455-
returnawaitself._main_frame.is_visible(**locals_to_params(locals()))
456+
# timeout is deprecated and does nothing
457+
returnawaitself._main_frame.is_visible(selector=selector,strict=strict)
456458

457459
asyncdefdispatch_event(
458460
self,

‎tests/async/test_locators.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,3 +1143,12 @@ async def test_locator_click_timeout_error_should_contain_call_log(page: Page) -
11431143
"During handling of the above exception, another exception occurred"
11441144
notinformatted_exception
11451145
)
1146+
1147+
1148+
asyncdeftest_locator_should_ignore_deprecated_is_hidden_and_visible_timeout(
1149+
page:Page,
1150+
)->None:
1151+
awaitpage.set_content("<div>foo</div>")
1152+
div=page.locator("div")
1153+
assertawaitdiv.is_hidden(timeout=10)isFalse
1154+
assertawaitdiv.is_visible(timeout=10)isTrue

‎tests/async/test_page.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,3 +1451,11 @@ async def test_page_pause_should_reset_custom_timeouts(
14511451
server.set_route("/empty.html",lambdaroute:None)
14521452
withpytest.raises(Error,match="Timeout 456ms exceeded."):
14531453
awaitpage.goto(server.EMPTY_PAGE)
1454+
1455+
1456+
asyncdeftest_page_should_ignore_deprecated_is_hidden_and_visible_timeout(
1457+
page:Page,
1458+
)->None:
1459+
awaitpage.set_content("<div>foo</div>")
1460+
assertawaitpage.is_hidden("div",timeout=10)isFalse
1461+
assertawaitpage.is_visible("div",timeout=10)isTrue

‎tests/sync/test_locators.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -997,3 +997,12 @@ def test_locator_click_timeout_error_should_contain_call_log(page: Page) -> None
997997
"During handling of the above exception, another exception occurred"
998998
notinformatted_exception
999999
)
1000+
1001+
1002+
deftest_locator_should_ignore_deprecated_is_hidden_and_visible_timeout(
1003+
page:Page,
1004+
)->None:
1005+
page.set_content("<div>foo</div>")
1006+
div=page.locator("div")
1007+
assertdiv.is_hidden(timeout=10)isFalse
1008+
assertdiv.is_visible(timeout=10)isTrue

‎tests/sync/test_page.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,11 @@ def test_page_pause_should_reset_custom_timeouts(
114114
server.set_route("/empty.html",lambdaroute:None)
115115
withpytest.raises(Error,match="Timeout 456ms exceeded."):
116116
page.goto(server.EMPTY_PAGE)
117+
118+
119+
deftest_page_should_ignore_deprecated_is_hidden_and_visible_timeout(
120+
page:Page,
121+
)->None:
122+
page.set_content("<div>foo</div>")
123+
assertpage.is_hidden("div",timeout=10)isFalse
124+
assertpage.is_visible("div",timeout=10)isTrue

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp