google / google/EarlGrey

Support swipe actions from a given start point to an end point

Open
#674 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Objective-C
Stars
5.7k
Forks
737
Avg merge
1d 20h
Merged PRs (30d)
5

Description

With the currently existing API it's not possible to swipe in any arbitrary direction, but only in a defined `GREYDirection` (left, right, up or down).
Swiping in any direction, for example from a given start point to a given end point, might also be needed to test some UI components.

I propose adding new public swipe actions, that take a start point and an end point and perform a swipe along these points.

The API for the actions might look like this:

`grey_swipeFastFromStartToEndPoint(CGPoint startPoint, CGPoint endPoint);`
`grey_swipeSlowFromStartToEndPoint(CGPoint startPoint, CGPoint endPoint);`

---

The implementation might be either a new `GREYBaseAction` subclass, or by extending `GREYSwipeAction` with this functionality.

This can be implemented similar to the existing `GREYSwipeAction`, by using

`[GREYPathGestureUtils touchPathForDragGestureWithStartPoint: endPoint: cancelInertia:]`

instead of
https://github.com/google/EarlGrey/blob/d1f48ddee051172ecea83835f2495d9e1a501d8c/EarlGrey/Action/GREYSwipeAction.m#L127-L130

Contributor guide

Open the contributing guide

Research direction

Start with EarlGrey/Action/GREYSwipeAction.m, especially the existing swipe implementation referenced in the issue, and compare it with GREYPathGestureUtils touchPathForDragGestureWithStartPoint:endPoint:cancelInertia:. Review how the current public swipe actions are exposed. Done means arbitrary start-to-end swipes are supported through the proposed fast and slow actions, with behavior consistent with existing swipe actions.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, objective-c
Domain
mobile-dev, testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.