examples/template_stealjs/funcunit/browser/waits.js
function( timeout, success, message ) {
		var logMessage = "Waiting for '"+this.selector+"' to exist";
		if(timeout === false){ // pass false to suppress this wait (make it not print any logMessage)
			logMessage = false
		}
		return this.size({
			condition: function(size){
				return size > 0;
			},
			timeout: timeout,
			success: success,
			message: message,
			errorMessage: "Exist failed: element with selector '"+this.selector+"' not found",
			logMessage: logMessage
		})
	}
function( timeout, success, message ) {
		var logMessage = "Waiting for '"+this.selector+"' to exist";
		if(timeout === false){ // pass false to suppress this wait (make it not print any logMessage)
			logMessage = false
		}
		return this.size({
			condition: function(size){
				return size > 0;
			},
			timeout: timeout,
			success: success,
			message: message,
			errorMessage: "Exist failed: element with selector '"+this.selector+"' not found",
			logMessage: logMessage
		})
	}
function ( timeout , success , message ) { var logMessage = "Waiting for '" + this . selector + "' to exist" ; if ( timeout === false ) { // pass false to suppress this wait (make it not print any logMessage) logMessage = false } return this . size ( { condition : function ( size ) { return size > 0 ; } , timeout : timeout , success : success , message : message , errorMessage : "Exist failed: element with selector '" + this . selector + "' not found" , logMessage : logMessage } ) }
Waits until an element exists before running the next action.
@codestart
//waits until #foo exists before clicking it.
S("#foo").exists().click()
@codeend
@param {Number} [timeout] overrides FuncUnit.timeout.  If provided, the wait will fail if not completed before this timeout.
@param {Function} [success] a success that is run after the selector exists, but before the next action.
@param {String} [message] if provided, an assertion will be passed when this wait condition completes successfully
@return {FuncUnit} returns the funcUnit for chaining.
Waits until an element exists before running the next action .