Skip to content

Webdriverio: Fix regression in 11711#11990

Merged
christian-bromann merged 1 commit intowebdriverio:mainfrom
WillBrock:wb-isElementDisplayed
Jan 11, 2024
Merged

Webdriverio: Fix regression in 11711#11990
christian-bromann merged 1 commit intowebdriverio:mainfrom
WillBrock:wb-isElementDisplayed

Conversation

@WillBrock
Copy link
Member

#11711 was to fix issues with older browsers but also added body to a check. It looks like this was added by mistake.

Our tests started failing with this change. I don't have a specific reproducible example because it fails on a custom dropdown that we've built in our codebase.

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • I have added proper type definitions for new commands (if appropriate)

Reviewers: @webdriverio/project-committers

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@christian-bromann christian-bromann added the PR: Bug Fix 🐛 PRs that contain bug fixes label Jan 10, 2024
@christian-bromann
Copy link
Member

Our tests started failing with this change.

What was the error? Technically I believe that the difference between document.contains and document.body.contains is that with the first you can also check if a tag is existent in e.g. in <head> section of the page. For testing in the context of WebdriverIO I don't think it makes a difference between using one over the other. Still, it would be good to better understand the problem here.

@WillBrock
Copy link
Member Author

It's not seeing this Filter input box as being displayed here.

The error:
Error: element (".swift-box-option-filter-input") still not displayed after 20000ms

I didn't dig too deep into the difference between the document.body and just document since I didn't see any mention of it in the original PR and doesn't seem like that part of the code would be affected with an old browser.

Screenshot 2024-01-10 at 6 38 37 PM

@christian-bromann
Copy link
Member

Thanks for the context. It seems like document.contains is a non standard interface according to this MDN translation artifact. Interestingly there are no docs in the english version about this 🤷

@christian-bromann christian-bromann merged commit bbc2ca5 into webdriverio:main Jan 11, 2024
@colinrotherham
Copy link
Contributor

@WillBrock Ahh this has broken IE11 again 😣

You'll see Can I Use .contains() support is only for HTMLElement types (e.g. document.body) in IE11

Specifically for isElementDisplayed() we were happy to restrict to document document.body

@christian-bromann Any ideas?

@christian-bromann
Copy link
Member

@colinrotherham thanks for letting us know, I pushed a fix and will release later today.

colinrotherham added a commit to alphagov/accessible-autocomplete that referenced this pull request Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Bug Fix 🐛 PRs that contain bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants