.wait()
FuncUnit.prototype.wait
wait([checker] [,timeout] [,success] [,message])
Waits until some condition is true before calling the next action. Or if no checker function is provided, waits a timeout before calling the next queued method. This can be used as a flexible wait condition to check various things in the tested page:
F('#testData').wait(function(){
return F.win.$(this).data('idval') === 1000;
}, "Data value matched");
Parameters
-
checker
{Number | function()}
Optionala checking function. It runs repeatedly until the condition becomes true or the timeout period passes. If a number is provided, a time in milliseconds to wait before running the next queued method.
-
timeout
{Number}
Optionaloverrides FuncUnit.timeout. If provided, the wait will fail if not completed before this timeout.
-
success
{function()}
Optionala callback that will run after this action completes.
-
message
{String}
Optionalif provided, an assertion will be passed when this wait condition completes successfully