Skip to content

feat(locator): warn when deprecated timeout is passed to isVisible/isHidden#40028

Closed
aydinomer00 wants to merge 1 commit intomicrosoft:mainfrom
aydinomer00:feat/deprecate-isVisible-timeout
Closed

feat(locator): warn when deprecated timeout is passed to isVisible/isHidden#40028
aydinomer00 wants to merge 1 commit intomicrosoft:mainfrom
aydinomer00:feat/deprecate-isVisible-timeout

Conversation

@aydinomer00
Copy link
Copy Markdown

@aydinomer00 aydinomer00 commented Apr 2, 2026

Description

Add a console warning when the deprecated timeout option is passed to locator.isVisible() or locator.isHidden(). The timeout option has been deprecated and silently ignored for years, causing confusion among users who rely on it for waiting behavior.

Changes

  • packages/playwright-core/src/client/locator.ts: Added console.warn() when timeout option is provided to isVisible() and isHidden()
  • tests/page/locator-is-visible.spec.ts: Added 2 test cases to verify the deprecation warning is emitted

Motivation

As described in #33017, the timeout argument to Locator.isVisible and Locator.isHidden has been deprecated for years but is silently ignored. This leads to incorrect code where users think their visibility check waits for the timeout period, when it actually returns immediately.

This PR adds a visible console.warn message so users are aware the option has no effect and can update their code accordingly.

Fixes #33017

…Hidden

Add a console warning when the deprecated `timeout` option is passed
to `locator.isVisible()` or `locator.isHidden()`. The timeout option
has been deprecated and silently ignored for years, causing confusion
among users who rely on it for waiting behavior.

Fixes microsoft#33017
@aydinomer00 aydinomer00 changed the title feat(locator): warn when deprecated timeout is passed to isVisifeat(locator): warn when deprecated timeout is passed to isVisible/isHiddenble/is… feat(locator): warn when deprecated timeout is passed to isVisifeat(locator): warn when deprecated timeout is passed to isVisible/isHiddenble/is…feat(locator): warn when deprecated timeout is passed to isVisible/isHidden Apr 2, 2026
@aydinomer00 aydinomer00 changed the title feat(locator): warn when deprecated timeout is passed to isVisifeat(locator): warn when deprecated timeout is passed to isVisible/isHiddenble/is…feat(locator): warn when deprecated timeout is passed to isVisible/isHidden feat(locator): warn when deprecated timeout is passed to isVisible/isHidden Apr 2, 2026
@pavelfeldman
Copy link
Copy Markdown
Member

We don't like writing into the console outside reporters, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: remove the deprecated timeout argment to Locator.isVisible, or make the deprecation more obvious to the user

2 participants