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

feat: Add /calibrate endpoint #785

Merged
merged 2 commits into from
Oct 5, 2023
Merged

feat: Add /calibrate endpoint #785

merged 2 commits into from
Oct 5, 2023

Conversation

mykola-mokhnach
Copy link

The PR adds GET /calibrate endpoint to WDA.

The idea is to use this special web page behind the endpoint to properly calibrate coordinates offset for nativeWebTap feature without applying ugly hacks like we do now.
Basically I am going to add mobile: calibrateNativeToWebCoordinates endpoint, which will only work in web/safari context and it will be loading this url to mobile Safari. Then we perform native click at the window center, which should also show actual web click coordinates. Then we can calculate the actual native/web coordinates delta and keep it to properly transform further native gesture coordinates. Ofc, the recalibration would be needed if the device changes orientation and there will be corner cases, but that method would be much more reliable in comparison to the ugly platform-dependent algorithm we use now in the xcuitest driver.

Kudos to Benjamin Karran for sharing this great idea.

Copy link
Member

@jlipps jlipps left a comment

Choose a reason for hiding this comment

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

yeah cool idea

@mykola-mokhnach mykola-mokhnach merged commit ae1603a into master Oct 5, 2023
46 checks passed
@mykola-mokhnach mykola-mokhnach deleted the calibrate branch October 5, 2023 20:13
github-actions bot pushed a commit that referenced this pull request Oct 5, 2023
## [5.11.0](v5.10.1...v5.11.0) (2023-10-05)

### Features

* Add /calibrate endpoint ([#785](#785)) ([ae1603a](ae1603a))
@github-actions
Copy link

github-actions bot commented Oct 5, 2023

🎉 This PR is included in version 5.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants