.size()
FuncUnit.prototype.size
size([size] [,timeout] [,success] [,message])
Gets the number of elements matched by the selector or waits until the the selector is size. You can also provide a function that continues to the next action when it returns true.
F(".recipe").size()//gets the number of recipes
F(".recipe").size(2)//waits until there are 2 recipes
//waits until size is count
F(".recipe").size(function(size){
return size == count;
})
Parameters
-
size
{Number | function()}
Optionalnumber or a checking function.
-
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
Returns
{Number}
if the size parameter is not provided, size returns the number of elements matched.