.wait()

  • function
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

  1. checker {Number | function()}Optional

    a 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.

  2. timeout {Number}Optional

    overrides FuncUnit.timeout. If provided, the wait will fail if not completed before this timeout.

  3. success {function()}Optional

    a callback that will run after this action completes.

  4. message {String}Optional

    if provided, an assertion will be passed when this wait condition completes successfully