Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix workaround for Safari 12.0.3 #9496

Conversation

kyrylodolynskyi
Copy link
Contributor

@kyrylodolynskyi kyrylodolynskyi commented Dec 31, 2022

Proposed changes

The issue is that when the element's getRect command is executed there is a Safari workaround to extract a rect from the browser executing js snippet. The workaround applied when one of the properties (x, y, width, or height) is a falsy (!) value, previously (in wdio 7) it was applied only if one of the properties were equal to null (== null). The problem happens when on appium you extract a region that has one of those properties 0, it is a valid value, but js snippet execution fails everything on appium.

Types of changes

I am replacing ! with === undefined.

  • 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)

Further comments

I didn't find any tests in this area which is why I don't know how you guys usually test things like that. Feel free to add a test or instruct me on what I should add.

Reviewers: @webdriverio/project-committers

Sorry, something went wrong.

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.

Can we add a unit test for this?

@christian-bromann
Copy link
Member

ping @kyryloonufriiev

@kyrylodolynskyi
Copy link
Contributor Author

@christian-bromann sorry, I was away last week. I did add a unit test, how does it look now?

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 👍

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.

None yet

2 participants