Skip to content

[🐛 Bug]: element.isDisplayed() is no longer true for elements with display: contents #14098

@pan-kot

Description

@pan-kot

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

latest

Node.js Version

v20

Mode

Standalone Mode

Which capabilities are you using?

{
  browserName: 'chrome'
}

What happened?

A recent change (ea3f50b) to the element.isDisplayed() to utilise the browser's checkVisibility() method introduced a regression. Now this method returns false when targeting elements with CSS display: contents.

What is your expected behavior?

I think the element.isDisplayed() should actually return true in such cases provided the actual contents of the target element are displayed. If not possible, then at least the documentation page should be updated accordingly: https://webdriver.io/docs/api/element/isDisplayed.

How to reproduce the bug.

To reproduce a bug, run the element.isVisibility() on an element with CSS display: contents that includes another element with the actually visible content.

Relevant log output

The logs are application specific as there is no exception thrown by the WebdriverIO - it is only that the result of the element.isDisplayed() is now different.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions