Swipe command in calabash iOS

3.4k views Asked by At

Hi i have to swipe the bunch of screens and i tried some of the syntax like

scroll("*",:right)
swipe "left", {:query => "*"}
swipe(:left)

But it swipes and leave back the screen to same screen.

3

There are 3 answers

0
Lasse On

The GitHub for calabash-ios suggest

Swiping an unspecified place (usually when you have big scroll view in the center of the screen). Swipe directions can be left, right, up and down.

Then I swipe left

GitHub Calabash-iOS Predefines steps

0
jmoody On

There are several known bugs in Apple's UIAutomation API. Swiping on simulators has been broken on iOS Simulators since iOS 7. 1

You might be able to work around this bug by tightening up your query. Instead of using "*", refine your query to match the scroll view you want to swipe on.

swipe "left", {:query => "UIScrollView marked:'some identifying mark'"}
swipe :right, {:query => "UIScrollView index:0"}

There are many cases where scroll views are embedded in other scroll views. In that case you might need to hunt around for the scroll view that will respond to the swipe.

As an aside, I do not recommend using the "*" wildcard.

0
houbena On

No one of the answers here worked for me.

Give a try to the pan method: http://calabashapi.xamarin.com/ios/Calabash/Cucumber/Core.html#pan-instance_method