I try to avoid the sleep() command so I want to replace it with smarter functions like wait_for_element_exists() but they seems to not work under iOS. Example:
touch("button marked:'button_in_the_first_view'")
wait_for_element_exists("button marked:'button_in_the_second_view'")
touch("button marked:'button_in_the_third_view'")
Calabash doesn't wait for the second button to be displayed on the screen, goes to line 3 without any delay and fails the test
If I try to determine the properties of the second button it is immediately available, still enabled and not hidden despite the fact that navigation view controller hasn't finished the push animation from the first view:
touch("button marked:'button_in_the_first_view'")
query("button marked:'button_in_the_second_view'").count # => 1
query("button marked:'button_in_the_second_view'", :isEnabled).first # => 1
query("button marked:'button_in_the_second_view'", :isHidden).first # => 0
Thanks in advance for your help,
Michał