I am experiencing some random errors when running my Calabash tests and trying to touch elements
uia action failed because: Timed out running command uia.tapOffset('{:x 187.5, :y 131.5}')
I am running the tests on Yosemite, Xcode 6.2 and on iOS Simulator (iPhone 6 iOS 8.1)
The version of Calabash used is 0.13.0.
Does anyone know why it is happening and how to fix it?
Update
When I say "randomly" I mean that sometimes the sames test passes and sometimes it fails with this error. I just checked and it always seems to be failing when trying to tap on a tab button after entering some text in a text field. So my guess is that the keyboard is still there when it's trying to touch the tab button
For your information, this is the method I created for entering text
def type_text(accessibilityLabel, text)
query = "textField accessibilityLabel:'#{accessibilityLabel}'"
return unless safe_query(query).first["text"] != text
wait_for_ui_animation_to_end
safe_touch(query)
map(query, :setText, '')
map(query, :setText, text)
done
end
And these are the safe_touch
and safe_query
methods I use
def safe_query(query)
wait_for(:timeout => 60, :timeout_message => "Timeout trying to query #{query}", :screenshot_on_error => true) do
element_exists(query)
end
query(query)
end
def safe_touch(query)
wait_for(:timeout => 60, :timeout_message => "Timeout trying to touch #{query}", :screenshot_on_error => true) do
element_exists(query)
end
touch(query)
end
Update 2
Here's an example of scenario that fails sometimes
Here's a screenshot of the screen when the test fails
There doesn't seem to be anything in the way when trying to tap the tabbar item...