Add precise swipe actions for swipes from a start to an end point
This PR implements and fixes https://github.com/google/EarlGrey/issues/674.
Introduces new swipe actions, that take a starPoint and an endPoint and perform a swipe along those points via two new public functions:
grey_swipeFastFromStartToEndPoint(CGPoint startPoint, CGPoint endPoint);
grey_swipeSlowFromStartToEndPoint(CGPoint startPoint, CGPoint endPoint);
This is done via the new GREYPreciseSwipeAction class, that is implemented similar to GREYSwipeAction, but instead of taking a direction, duration and startPercents, the precise swipe action takes a startPoint, endPoint and duration.
When performing this action, a swipe with a single touch is executed that follows the path from the startPoint to the endPoint in the time of the given duration.
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
:memo: Please visit https://cla.developers.google.com/ to sign.
Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.
- If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address on your commit. Check your existing CLA data and verify that your email is set on your git commits.
- If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot. The email used to register you as an authorized contributor must be the email used for the Git commit.
- In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.
I signed it!
CLAs look good, thanks!
Just wanted to check in on the status here. I'd love to get this PR merged, so let me know if there is anything left for me to take care of. Thank you!
It looks like you want precision here. Is there a reason for not using scroll API which is much more precise than swipe?
Is there a reason for not using scroll API which is much more precise than swipe?
@khandpur I'm not quite sure if I understand your question correctly, so please correct me if I'm wrong.
If you are referring to GREYScrollAction, then the reason is that it doesn't allow scrolling from one point to another in any arbitrary directions, but only in predefined GREYDirections.
@khandpur Sorry for the long delay, but I've now added unit and functional tests for the precise swipe actions. Looking forward to your feedback!
@khandpur Just wanted to ping to check on the status of this PR. I would really appreciated if you could have another look at this PR and consider merging it. Let me know if there are any questions!
Thanks for the review @khandpur.
I addressed all your feedback, and fixed the code style nits, adjusted the wrong indentations, added nullability macros to GREYPreciseSwipeAction.h, and also rebased this branch to the latest master.
@tirodkar PTAL and merge if it looks good.
And thank you Stefan for adding this feature request!
Thank you for reviewing this PR and getting it merged! I really appreciate it.
@tirodkar I also addressed your review feedback now and fixed the typo.
@tirodkar I've restarted the CI. Could we merge this and make it available in earlgrey 2?
Hi! Are there any blockers left for merging this?