Closed gbrhaz closed 7 years ago
Use wait_for_none_animating
or an explicit 0.4
sleep before the gesture.
This is a classic problem - the view is visible, but it not ready for gestures.
@gbrhaz we found this issue after the upgrade as well and we changed our methods to use wait_tap instead of the wait and touch combination that you have. It seems to be reliably working for us.
def wait_tap(uiquery, options={})
wait_for_none_animating
wait_for_element_exists(uiquery, options)
touch(uiquery, options)
end
run_loop
:2.4.1
calabash-cucumber
:0.20.5
I've noticed recently that when you call
wait_for_elements_exist
and thentouch
on an element that is animating in, thetouch
call will try and touch while the animation is progressing. Most of the time this fails, because by the time it's touched the element it seems to have moved on (pure conjecture)?Is there a solid way with Calabash to "wait" for the animation to complete without invoking
sleep
? I like to try and keep out as many sleeps as I can because I feel it's hacky. Another solution I came up with is to create a loop, check if the element exists, and then tap on it... and iterate through the loop until the element no longer exists. But because of the animations, Calabash could be tapping on the element multiple times.Loop solution: