-
-
Notifications
You must be signed in to change notification settings - Fork 423
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
feat: Add 'mobile: calibrateWebToRealCoordinatesTranslation' API #2071
Conversation
@KazuCocoa Could you please help to test the feature on real devices? |
sure, I'll check on real device(s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw, is it helpful to do this calculation instead of opening /health
by default, or before opening the default page /health
or safariInitialUrl
(in the future)?
In iPad, the Probably... we may need to get proper pixelRatio...? (I haven't researched yet) |
did you recalibrate after changing the orientation? |
Yes, it seems like |
This is weird. Let me try to use then the scale value returned by xctest |
hmmm, confirmed the device had |
I haven't found a better way for across devices yet. e.g. 69b462f but this was not good. What I have tried so far as testing is:
So far, the existing |
I am now using a more sophisticated algorithm to measure actual pixel ratio values |
hm, the latest one worked only my iPad landscape only. Simulator iPhones, iPad portrait etc did not click the element position, especially the Y was far from the target element, almost center in iPhone 15 simulator. |
strange, the translation did work in my local tests on ios 17 simulator. At least both x and y offsets as well as scale factors were calculated properly. I've changed Math.trunc to Math.round to have better approximations since xctest operates with float coordinates, but otherwise seems good to me. Could you please provide me your client code, so I could run it locally? |
Sure, like below. Not the same as #2071 (comment) , but this also did not click the element. With an iPhone 15 iOS 17 simulator, the click did not click the element. (I haven't checked other simulator variations). WDA was already launching on the simulator
https://gist.github.com/KazuCocoa/7bf791f54317bd464feb29095a2f6088 is the log that I ran with the above with the latest PR code. The last click did not click the expected element. Current master clicked Btw, I noticed |
Thanks @KazuCocoa The more I dive into this topic the more complicated it looks. Made it work with Simulator properly. Please check with real devices again |
Sure, thanks. I'll take a look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm 🚀
## [5.7.0](v5.6.0...v5.7.0) (2023-10-13) ### Features * Add 'mobile: calibrateWebToRealCoordinatesTranslation' API ([#2071](#2071)) ([b3fa78d](b3fa78d))
🎉 This PR is included in version 5.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Based on appium/WebDriverAgent#785
Also removed the deprecated moveTo endpoint