calabash / calabash-android-server

Automated Functional testing for Android based on cucumber
Other
28 stars 41 forks source link

Vertical-horizontal backward scrolling #120

Closed ManjunathaThimmaiah closed 1 year ago

ManjunathaThimmaiah commented 1 year ago

The Uiautomator method has mechanism to scroll vertically and horizontally to find/locate elements and it supports only forward scrolling at the moment and it does not support backward scrolling.

With this PR, there is new class added to support both forward and backward scrolling to element by vertically and horizontally and it is implemented within the class UiautomatorVerticallyScrollingFowardOrBackward and UiautomatorHorizontallyScrollingFowardOrBackward. The direction will be decided based on the input parameter direction which can be either FORWARD and BACKWARD.

The command to run scrolling forward/ backward vertically will be:

perform_action('uiautomator_vertically_scroll_forward_or_backward_to_element', 'direction','strategy', 'locator', 'max_scrolls')

the direction is either 'FORWARD' / 'BACKWARD'

The command to run scrolling forward or backward horizontally will be:

Horizontal: perform_action('uiautomator_horizontally_scroll_forward_or_backward_to_element', 'direction', 'strategy', 'locator', 'max_scrolls')

the direction is either 'FORWARD' / 'BACKWARD'

more information on the other parameters/arguments can be found at https://github.com/calabash/calabash-android/wiki/UIAutomator2

ManjunathaThimmaiah commented 1 year ago

@JoeSSS could you please merge this PR? :)