Command to PAUSE, SLEEP or STOP calabash
Question
I want my calabash tests in iOS to run for a certain number of steps then stop at a certain line
Is there a 'sleep', 'pause' or 'stop' command?
La solution
According to the calabash documentation, there is a sleep
method, but there are also a few wait
methods, which are recommended over sleep
. From the wiki:
Notes: Waiting for a condition to occur is superior to using the sleep function. With sleep you end up either specifying too long waits which slows the test down or you become sensitive to timing issues. Sometimes you do need sleep (to wait for animations to complete), but try to use waiting as much as possible.
Autres conseils
You can use:
sleep(10) #seconds
or
wait_for_elements_exist(elements,
{
:timeout => 10, #seconds
:retry_frequency => 1, #time to retry in seconds
:timeout_message => "Timeout message"
}
)
For sleep, use,
sleep(10) - This sleeps after 10 seconds.
For stop, use,
calabash_exit - This should be used in the console.
For pause, use,
sleep(STEP_PAUSE) - This is predefined.