hasClass
FuncUnit.prototype.hasClass

hasClass(className [,value] [,timeout] [,success] [,message])

//returns if the element has the class in its className
S("#something").hasClass("selected");
//waits until #something has selected in its className
S("#something").hasClass("selected",true);
//waits until #something does not have selected in its className
S("#something").hasClass("selected",false);

Parameters

className
{String}

The part of the className to search for.

value
{Boolean | function()}Optional

If provided uses this as a check before continuing to the next action.

timeout
{Number}Optional

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

success
{function()}Optional

a callback that will run after this action completes.

message
{String}Optional

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

Returns

{Boolean | funcUnit}

if the value parameter is not provided, returns
if the className is found in the element's className. If a value paramters is provided, returns funcUnit for chaining.