API

Methods

addStep( step )

Description: Add step to scenario.


step

Type: Function()


For synchronous step:

scenario.addStep(function(context) {
    // step code
})                   
For asynchronous step:
using jQuery.Deferred
scenario.addStep(function(context) {
    return jQuery.Deferred(function(def){
        // step code
        def.resolve();
    })
})                      
using callback function
scenario.addStep(function(context, done) {
    // step code
    done();
})                      

Use context parameter to share data between steps.

addStepWait( milliseconds )

Description: pause execution for specified number of milliseconds.


milliseconds

Type: Number

addStepBlockScreen( className )

Description: create DIV element that covers entire window, to block user input.


className

Type: String

CSS class to add to DIV element

addStepUnblockScreen( )

Description: remove DIV element added by addStepBlockScreen method.

addStepGlow( options )

Description: add glow effect to specified element.


options

Type: PlainObject

A map of glow effect options.

element

Type: String (jQuery selector), or jQuery object, or DOM Element

Element(s) to which you want to apply glow effect


color

Type: String

Default: red

Glow color


blur

Type: Number

Default: 5

Glow blur


spread

Type: Number

Default: 3

Glow spread


duration

Type: Number

Default: 200

Glow animation duration in milliseconds


easing

Type: String

Default: swing

Glow animation easing


scenario.addStepGlow({
    element: '.selector',
    color: '#00FF00',
    duration: 500
})              
addStepUnglow( options )

Description: remove glow effect for specified element.


options

Type: PlainObject

A map of glow effect options.

element

Type: String (jQuery selector), or jQuery object, or DOM Element

Element(s) for which you want to remove glow effect


color

Type: String

Default: red

Glow color


blur

Type: Number

Default: 5

Glow blur


spread

Type: Number

Default: 3

Glow spread


duration

Type: Number

Default: 200

Animation duration in milliseconds


easing

Type: String

Default: swing

Animation easing


scenario.addStepUnglow({
    element: '.selector',
    color: '#00FF00',
    duration: 500
})              
addStepAnimate( fromVal, toVal, duration, step, easing )

Description: add a custom animation step


fromVal

Type: Number

Initial animation value


toVal

Type: Number

Value that the animation will move toward


duration

Type: Number

A number determining how long the animation will run


step

Type: Function

A function to be called after each step of the animation


easing

Type: String

Default: swing

Animation easing


scenario.addStepAnimate(0, 100, 500, function(val){
    $('.slider').slider('setValue', val);
}, 'swing')
addStepAnimateMultiple( from, to, duration, step, easing )

Description: add a custom multi-property animation step


from

Type: PlainObject

Initial animation values


to

Type: PlainObject

Values that the animation will move toward


duration

Type: Number

A number determining how long the animation will run


step

Type: Function

A function to be called after each step of the animation


easing

Type: String

Default: swing

Animation easing


// Animate three sliders simultaneously
scenario.addStepAnimateMultiple(
    {red: 0, green: 255, blue: 0}, 
    {red: 255, green: 0, blue: 255}, 
    500, 
    function(val){
        $('#slider-r').slider('setValue', val.red);
        $('#slider-g').slider('setValue', val.green);
        $('#slider-b').slider('setValue', val.blue);
    }, 'swing')
execute( context )

Description: start scenario execution.


context

Type: Object

Execution context. You can use this parameter to pass state to your custom steps

stop( )

Description: stop scenario execution.

clearSteps()

Description: remove all steps from the scenario.

getIsInProgress

Description: returns true if scenario execution is now in progress otherwise - false.

Events

start

Description: triggered when execution started.

end

Description: triggered when execution completed.