API Docs for: 0.2.7
Show:

Chain Class

Defined in: lib/chain.js:21
Module: Chain

Chain Interface for Taxi

Missing a function?

File an issue with us or create your own function by doing something like this before a Taxi instance is created:

taxi.Chain.prototype.elementClick = function (selector, button, callBack) {

    // Find elements with the selector
    return this.elements(selector, function (element) {

        // Make sure that evaluation will work for sync and async mode
        return this.driver().utils().when(

            // Click on the selected element with the object-oriented API
            element.mouse().click(button),

            // When it is done, execute the callback function in the correct scope,
            // additionally giving the element as its first parameter
            function () {
                return this._scopeCallBack(callBack, [element]);
            }.bind(this)
        );
    }.bind(this));
});

Always make sure that you return the values along the way!

This is a complete implementation of the elementClick function in this API.

Constructor

Chain

(
  • driver
)

Defined in lib/chain.js:21

Parameters:

  • driver Driver

    Taxi driver instance to communicate with the browser

Methods

_driverAction

(
  • value
  • fn
)
Chain private chainable

Defined in lib/chain.js:150

Convenience function to execute driver actions

Parameters:

  • value

    Value that needs to be evaluated

  • fn Function

    Function that needs to be triggered with evaluated value

Returns:

Chain:

The chain object

_elementAction

(
  • selector
  • fn
)
Chain private chainable

Defined in lib/chain.js:127

Convenience function to execute element actions

Parameters:

  • selector String

    Selector of element that action applies to

  • fn Function

    Function to execute for every found element

Returns:

Chain:

The chain object

_logMethodCall

(
  • event
)
private

Defined in lib/chain.js:67

Logs a method call by an event

Parameters:

_requestJSON

(
  • method
  • path
  • [body]
)
private

Defined in lib/chain.js:80

Performs a context dependent JSON request for the current session. The result is parsed for errors.

Parameters:

Returns:

:

_scopeCallBack

(
  • cb
  • args
)
Chain private chainable

Defined in lib/chain.js:168

Convenience function to handle scope for chains

Parameters:

  • cb Function

    Callback function that should be triggered with the correct scope

  • args

    List of arguments to supply to the callback function

Returns:

Chain:

The chain object

activateFrame

(
  • id
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2724

Available since 0.2.0

Activates one of the available frames within the currently active document

Parameters:

  • id String

    Identifier of the frame to activate

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (activeWindow)

Scope

{Chain}

Parameters

  • activeWindow {ActiveWindow} - Active browser document/window

activateParentFrame

(
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2757

Available since 0.2.0

Activates the parent frame (i.e. the document) when a frame was previously activated.

Parameters:

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (activeWindow)

Scope

{Chain}

Parameters

  • activeWindow {ActiveWindow} - Active browser document/window

activateWindow

(
  • id
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2791

Available since 0.2.0

Activates a window, switching the currently active document

If you have multiple documents, you need to switch to each in turn to interact with them. You can only interact with the currently active document. That is where this function call comes in handy.

Parameters:

  • id String

    Identifier of a window. This might have been given by some executing JavaScript within the browser.

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (browser)

Scope

{Chain}

Parameters

  • browser {Browser} - The browser session

activeElement

(
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2063

Available since 0.2.0

Activates a selected element

Parameters:

  • [callBack] Function optional

    Callback function that will be triggered with the currently active element

Returns:

Chain:

The chain object


Callback function

function (element, activeWindow)

Scope

{Chain}

Parameters

  • element {Element} - Currently active element in the active browser document
  • activeWindow {ActiveWindow} - Active browser document/window

adjust

(
  • [options]
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:187

Available since 0.2.6

Adjusts the configurations according to the browsers behavior.

Note: This is needed especially when screenshots should be taken since browsers behave here very different from each other.

Needs to be called only once per taxi instance.

Parameters:

  • [options] Object optional

    Preparation options for chaining

    • [url='http://www.example.org'] Int optional

      Default website for adjustment for browser

    • [horizontalPadding=0] Int optional

      Padding of the document

  • [callBack] Function optional

    Callback function that will be triggered with each selected element in turn

Returns:

Chain:

The chain object


Callback function

function ()

Scope

{Chain}

Parameters

none

backward

(
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2510

Available since 0.2.0

Goes backward in the document history, equivalent to a user pressing the back button within the browser

Parameters:

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (activeWindow)

Scope

{Chain}

Parameters

  • activeWindow {ActiveWindow} - Active browser document/window

captureArea

(
  • [x=0]
  • [y=0]
  • [width=document.width-x]
  • [height=document.height-y]
  • [options]
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:1871

Available since 0.2.0

Captures a selected area in a PNG buffer

Parameters:

  • [x=0] Int optional

    X-coordinate for area. Uses the left corner of the document as default.

  • [y=0] Int optional

    Y-coordinate for area. Uses the top corner of the document as default.

  • [width=document.width-x] Int optional

    Width of area to be captured. Uses the rest width of the document as the default.

  • [height=document.height-y] Int optional

    Height of area to be captured. Uses the rest height of the document as the default.

  • [options] Object optional

    Options for taking the screenshots. See elementCapture for more information on the screenshot options.

    • [eachFn] Function optional

      Will execute the function on client before each screenshot is taken

    • [completeFn] Function optional

      Will execute the function on client after all screenshots are taken

    • [blockOuts] Object[] | Element[] | String[] optional

      List of areas/elements that should be blocked-out

    • [blockOutColor=black] Object optional

      Color to be used for blocking-out areas {red, green, blue, alpha}

    • [wait=100] Int optional

      Wait in ms before each screenshot

  • [callBack] Function optional

    Callback function that will be triggered with the image-buffer of the area screenshot

Returns:

Chain:

The chain object


Callback function

function (imageBuffer, element, index)

Scope

{Chain}

Parameters

  • imageBuffer {Buffer} - Binary buffer of the PNG image
  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

captureDocument

(
  • [options]
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:1791

Available since 0.2.0

Captures the complete document in a PNG buffer

Parameters:

  • [options] Object optional

    Options for taking the screenshots. See elementCapture for more information on the screenshot options.

    • [eachFn] Function optional

      Will execute the function on client before each screenshot is taken

    • [completeFn] Function optional

      Will execute the function on client after all screenshots are taken

    • [blockOuts] Object[] | Element[] | String[] optional

      List of areas/elements that should be blocked-out

    • [blockOutColor=black] Object optional

      Color to be used for blocking-out areas {red, green, blue, alpha}

    • [wait=100] Int optional

      Wait in ms before each screenshot

  • [callBack] Function optional

    Callback function that will be triggered with the image-buffer of the document screenshot

Returns:

Chain:

The chain object


Callback function

function (imageBuffer, element, index)

Scope

{Chain}

Parameters

  • imageBuffer {Buffer} - Binary buffer of the PNG image
  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

captureViewPort

(
  • [options]
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:1831

Available since 0.2.0

Captures the current view-port in a PNG buffer

Parameters:

  • [options] Object optional

    Options for taking the screenshots. See elementCapture for more information on the screenshot options.

    • [eachFn] Function optional

      Will execute the function on client before each screenshot is taken

    • [completeFn] Function optional

      Will execute the function on client after all screenshots are taken

    • [blockOuts] Object[] | Element[] | String[] optional

      List of areas/elements that should be blocked-out

    • [blockOutColor=black] Object optional

      Color to be used for blocking-out areas {red, green, blue, alpha}

    • [wait=100] Int optional

      Wait in ms before each screenshot

  • [callBack] Function optional

    Callback function that will be triggered with the image-buffer of the view-port screenshot

Returns:

Chain:

The chain object


Callback function

function (imageBuffer, element, index)

Scope

{Chain}

Parameters

  • imageBuffer {Buffer} - Binary buffer of the PNG image
  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

click

(
  • x
  • y
  • [button=Mouse.BUTTON_LEFT]
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2294

Available since 0.2.0

Clicks on the active document at the specified absolute coordinates

Parameters:

  • x Int

    Absolute x-coordinate to click on

  • y Int

    Absolute y-coordinate to click on

  • [button=Mouse.BUTTON_LEFT] Int optional

    Button that should be pressed when click action is executed.

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (activeWindow)

Scope

{Chain}

Parameters

  • activeWindow {ActiveWindow} - Active browser document/window

Note

You can use the constants available in the mouse-object or submit the following values:

  • 0 - Left Button
  • 1 - Middle Button
  • 2 - Right Button

closeWindow

(
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2095

Available since 0.2.0

Closes the currently active window, switching the focus to the next available window

Parameters:

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (activeWindow)

Scope

{Chain}

Parameters

  • activeWindow {ActiveWindow} - Active browser document/window

compareArea

(
  • title
  • [x=0]
  • [y=0]
  • [width=document.width-x]
  • [height=document.height-y]
  • [options]
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2011

Available since 0.2.0

Compares a specific and fixed area of the document with previously captured images

Parameters:

  • title String

    Title of the comparison

  • [x=0] Int optional

    X-coordinate for area. Uses the left corner of the document as default.

  • [y=0] Int optional

    Y-coordinate for area. Uses the top corner of the document as default.

  • [width=document.width-x] Int optional

    Width of area to be captured. Uses the rest width of the document as the default.

  • [height=document.height-y] Int optional

    Height of area to be captured. Uses the rest height of the document as the default.

  • [options] Object optional

    Options for the screenshots and compare the data. See elementCapture for more information on the screenshot options.

    • [eachFn] Function optional

      Will execute the function on client before each screenshot is taken

    • [completeFn] Function optional

      Will execute the function on client after all screenshots are taken

    • [blockOuts] Object[] | Element[] | String[] optional

      List of areas/elements that should be blocked-out

    • [blockOutColor=black] Object optional

      Color to be used for blocking-out areas {red, green, blue, alpha}

    • [wait=100] Int optional

      Wait in ms before each screenshot

    • [compare] Object optional

      Options for the comparison. See the Blink-Diff documentation

      • [id=1] Object optional
        Additional identifier to differentiate comparison
  • [callBack] Function optional

    Callback function that will be triggered with the result fo the request

Returns:

Chain:

The chain object


Callback function

function (isSimilar, activeWindow)

Scope

{Chain}

Parameters

  • isSimilar {boolean|null} - Is comparison similar to previous one?
  • activeWindow {ActiveWindow} - Active browser document/window

Notes

See elementCompare for more information on the comparison options.

compareDocument

(
  • title
  • [options]
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:1915

Available since 0.2.0

Compares the whole document with images that were captured previously

Parameters:

  • title String

    Title of the comparison

  • [options] Object optional

    Options for the screenshots and compare the data. See elementCapture for more information on the screenshot options.

    • [eachFn] Function optional

      Will execute the function on client before each screenshot is taken

    • [completeFn] Function optional

      Will execute the function on client after all screenshots are taken

    • [blockOuts] Object[] | Element[] | String[] optional

      List of areas/elements that should be blocked-out

    • [blockOutColor=black] Object optional

      Color to be used for blocking-out areas {red, green, blue, alpha}

    • [wait=100] Int optional

      Wait in ms before each screenshot

    • [compare] Object optional

      Options for the comparison. See the Blink-Diff documentation

      • [id=1] Object optional
        Additional identifier to differentiate comparison
  • [callBack] Function optional

    Callback function that will be triggered with the reuslt of the request

Returns:

Chain:

The chain object


Callback function

function (isSimilar, activeWindow)

Scope

{Chain}

Parameters

  • isSimilar {boolean|null} - Is comparison similar to previous one?
  • activeWindow {ActiveWindow} - Active browser document/window

Notes

See elementCompare for more information on the comparison options.

compareViewPort

(
  • title
  • [options]
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:1963

Available since 0.2.0

Compares the view-port with images previously taken

Parameters:

  • title String

    Title of the comparison

  • [options] Object optional

    Options for the screenshots and compare the data. See elementCapture for more information on the screenshot options.

    • [eachFn] Function optional

      Will execute the function on client before each screenshot is taken

    • [completeFn] Function optional

      Will execute the function on client after all screenshots are taken

    • [blockOuts] Object[] | Element[] | String[] optional

      List of areas/elements that should be blocked-out

    • [blockOutColor=black] Object optional

      Color to be used for blocking-out areas {red, green, blue, alpha}

    • [wait=100] Int optional

      Wait in ms before each screenshot

    • [compare] Object optional

      Options for the comparison. See the Blink-Diff documentation

      • [id=1] Object optional
        Additional identifier to differentiate comparison
  • [callBack] Function optional

    Callback function that will be triggered with the result of the request

Returns:

Chain:

The chain object


Callback function

function (isSimilar, activeWindow)

Scope

{Chain}

Parameters

  • isSimilar {boolean|null} - Is comparison similar to previous one?
  • activeWindow {ActiveWindow} - Active browser document/window

Notes

See elementCompare for more information on the comparison options.

dblClick

(
  • x
  • y
  • [button=Mouse.BUTTON_LEFT]
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2336

Available since 0.2.0

Double-clicks on the active document at the specified absolute coordinates

Parameters:

  • x Int

    Absolute x-coordinate to double-click on

  • y Int

    Absolute y-coordinate to double-click on

  • [button=Mouse.BUTTON_LEFT] Int optional

    Button that should be pressed when click action is executed.

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (activeWindow)

Scope

{Chain}

Parameters

  • activeWindow {ActiveWindow} - Active browser document/window

Note

You can use the constants available in the mouse-object or submit the following values:

  • 0 - Left Button
  • 1 - Middle Button
  • 2 - Right Button

dialogAccept

(
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2648

Available since 0.2.1

Accepts the currently displayed dialog

In most cases, this will be the "OK" button.

Parameters:

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (activeWindow)

Scope

{Chain}

Parameters

  • activeWindow {ActiveWindow} - Active browser document/window

Note This dialog could be an alert, a prompt, or any other browser dialog that the browser supports.

dialogDismiss

(
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2684

Available since 0.2.1

Dismisses the currently displayed dialog

In most cases, this will be the "Cancel" button.

Parameters:

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (activeWindow)

Scope

{Chain}

Parameters

  • activeWindow {ActiveWindow} - Active browser document/window

Note This dialog could be an alert, a prompt, or any other browser dialog that the browser supports.

dialogSendKeys

(
  • keys
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2611

Available since 0.2.1

Sends a string or a list of key-strokes to the currently displayed dialog.

This is useful when there is a prompt() currently open, requesting user input.

Parameters:

  • keys String | String[]

    or key-strokes to send

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (activeWindow)

Scope

{Chain}

Parameters

  • activeWindow {ActiveWindow} - Active browser document/window

Note This dialog could be an alert, a prompt, or any other browser dialog that the browser supports.

dialogText

(
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2576

Available since 0.2.1

Determines the text content of the currently displayed dialog

Parameters:

  • [callBack] Function optional

    Callback function that will be triggered with the text-content of the dialog

Returns:

Chain:

The chain object


Callback function

function (text, activeWindow)

Scope

{Chain}

Parameters

  • text {string} - Text content of the currently displayed dialog
  • activeWindow {ActiveWindow} - Active browser document/window

Note This dialog could be an alert, a prompt, or any other browser dialog that the browser supports.

driver

() Driver

Defined in lib/chain.js:100

Available since 0.2.1

Gets the driver object.

Returns:

Example:

driver === driver.chain().driver() // true

elementAbsoluteCenter

(
  • selector
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:975

Available since 0.2.0

Determines the absolute coordinates of the center of the selected elements

Parameters:

  • selector String

    CSS selector of DOM elements

  • [callBack] Function optional

    Callback function that will be triggered with the absolute center coordinates of the selected element

Returns:

Chain:

The chain object


Callback function

function (coordinates, element, index)

Scope

{Chain}

Parameters

  • coordinates {object} - Absolute coordinates of the center of the selected element
    • x {int} - Absolute x-coordinate of the selected elements center
    • y {int} - Absolute y-coordinate of the selected elements center
  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

elementAttribute

(
  • selector
  • attribute
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:268

Available since 0.2.0

Retrieves the attribute value of the selected elements

Parameters:

  • selector String

    CSS selector of DOM elements

  • attribute String

    Name of the attribute to get the value of

  • [callBack] Function optional

    Callback function that will be triggered with the attribute value

Returns:

Chain:

The chain object

Example:

// Determines the value of all input tags and prints them out to the console.

driver.elementAttribute('input', 'value', function (value) {
  console.log(value);
});

Callback function

function (value, element, index)

Scope

{Chain}

Parameters

  • value {string} - Value of attribute
  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

elementCapture

(
  • selector
  • [options]
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:1049

Available since 0.2.0

Captures an element in a PNG buffer, discarding or ignoring the rest of the document from the image

Parameters:

  • selector String

    CSS selector of DOM elements

  • [options] Object optional

    Options for taking the screenshot

    • [eachFn] Function optional

      Will execute the function on client before each screenshot is taken

    • [completeFn] Function optional

      Will execute the function on client after all screenshots are taken

    • [blockOuts] Object[] | Element[] | String[] optional

      List of areas/elements that should be blocked-out

    • [blockOutColor=black] Object optional

      Color to be used for blocking-out areas {red, green, blue, alpha}

    • [wait=100] Int optional

      Wait in ms before each screenshot

    • [allPadding] Int optional

      Padding for all sides

    • [hPadding] Int optional

      Padding on left and right side of the element

    • [vPadding] Int optional

      Padding on the top and on the bottom of the element

    • [leftPadding] Int optional

      Padding on the left of the element

    • [rightPadding] Int optional

      Padding on the right of the element

    • [topPadding] Int optional

      Padding on the top of the element

    • [bottomPadding] Int optional

      Padding on the bottom of the element

  • [callBack] Function optional

    Callback function that will be triggered with the image-buffer of the screenshot from the selected element

Returns:

Chain:

The chain object


Callback function

function (imageBuffer, element, index)

Scope

{Chain}

Parameters

  • imageBuffer {Buffer} - Binary buffer of the PNG image
  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

options.eachFn (index)

This function is executed on the client-side just before a new screenshot is taken. How often this function is executed depends on the browser and should only be used to prepare for screenshots (i.e. removing a floating header on the second image).

Scope

{document.window} - within the browser

Parameters

  • index {int} - Zero-based index of screenshot that will be taken

Note Since this function is executed on the client, it will not be able to capture variables in the lexical scope. The function will be serialized, sent to the client, de-serialized, and executed without knowing the context of its initial definition.


options.completeFn ()

This function is executed on the client-side just after all screenshots were taken. This function will only be called once and it can be used to revert changes applied to the document during eachFn calls (i.e. re-attaching a floating header).

Scope

{document.window} - within the browser

Parameters

none

Note Since this function is executed on the client, it will not be able to capture variables in the lexical scope. The function will be serialized, sent to the client, de-serialized, and executed without knowing the context of its initial definition.


options.blockOuts

Sometimes, you want to block-out areas on a screenshot, be it for censoring purposes or for comparison during multiple test-runs with every changing data (i.e. date/time label). In this list, you can supply CSS selectors, a list of already selected elements, or even a list of pre-defined fixed areas. All of these different "selectors" can be combined in the same list.

CSS Selector

The supplied CSS selector will be used to find single or multiple DOM element in the document. Taxi will flatten the list whenever multiple items are found.

Element Selector

These are objects that were already selected previously and re-used for this purpose.

Static object

This object holds static information about the location and the size of the area to block-out.

The object has following properties:

  • x {int} - X-coordinate of the area
  • y {int} - Y-coordinate of the area
  • width {int} - Width of the area
  • height {int} - Height of the area
  • [color] {object} - Custom block-out color for this area only. See options.blockOutColor for more information.

options.blockOutColor

This is the default color for all block-out areas that do not have custom colors.

Properties

  • [red] {int} - Red component of the color for blocking-out the area. Accepted values are from 0-255. 0 means that there is no intensity of this component within the resulting color; 255 is the full intensity.
  • [green] {int} - Green component of the color for blocking-out the area. Accepted values are from 0-255. 0 means that there is no intensity of this component within the resulting color; 255 is the full intensity.
  • [blue] {int} - Blue component of the color for blocking-out the area. Accepted values are from 0-255. 0 means that there is no intensity of this component within the resulting color; 255 is the full intensity.
  • [alpha] {int} - Alpha channel of the color for blocking-out the area. Accepted values are from 0.0-1.0. 0 means that there is no intensity of this component within the resulting color; 1.0 is the full intensity.

options.wait

Sometimes, it is required to slow-down the screen-capturing process. By default, Taxi will wait 100 milliseconds before each screenshot to make sure that changes caused by the scrolling behavior were applied in the browser view-port. Extend this time if the screenshot needs special behavior.

options.*padding

Padding that reaches outside of the document itself will be reduced to the extend of the document.

elementClasses

(
  • selector
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:359

Available since 0.2.0

Determines a list of classes assigned to the selected elements

Parameters:

  • selector String

    CSS selector of DOM elements

  • [callBack] Function optional

    Callback function that will be triggered with the list of classes

Returns:

Chain:

The chain object

Example:

// Prints a comma-separated list of classes that the element with the id "search" has.

driver.elementClasses('#search', function (classes) {
  console.log(classes.join(', '));
});

Callback function

function (classes, element, index)

Scope

{Chain}

Parameters

  • classes {string[]} - List of classes of the selected element
  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

elementClear

(
  • selector
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:750

Available since 0.2.0

Clears the contents of the selected elements

Note This will only work on elements that can be cleared like input boxes and text areas.

Parameters:

  • selector String

    CSS selector of DOM elements

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (element, index)

Scope

{Chain}

Parameters

  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

elementClick

(
  • selector
  • [button=Mouse.BUTTON_LEFT]
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:1294

Available since 0.2.0

Clicks on the selected elements

Parameters:

  • selector String

    CSS selector of DOM elements

  • [button=Mouse.BUTTON_LEFT] Int optional

    Button that should be pressed when click action is executed.

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (element, index)

Scope

{Chain}

Parameters

  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

Note

You can use the constants available in the mouse-object or submit the following values:

  • 0 - Left Button
  • 1 - Middle Button
  • 2 - Right Button

elementClickAt

(
  • selector
  • xOffset
  • yOffset
  • [button=Mouse.BUTTON_LEFT]
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:1337

Available since 0.2.0

Clicks on a specific coordinate relative to the upper-left corner of the selected elements

Parameters:

  • selector String

    CSS selector of DOM elements

  • xOffset Int

    X-offset relative to the left corner of the selected element

  • yOffset Int

    Y-offset relative to the top corner of the selected element

  • [button=Mouse.BUTTON_LEFT] Int optional

    Button that should be pressed when click action is executed.

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (element, index)

Scope

{Chain}

Parameters

  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

Note

You can use the constants available in the mouse-object or submit the following values:

  • 0 - Left Button
  • 1 - Middle Button
  • 2 - Right Button

elementCompare

(
  • selector
  • title
  • [options]
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:1192

Available since 0.2.0

Compares the image of selected elements from previous captures/comparisons

Parameters:

  • selector String

    CSS selector of DOM elements

  • title String

    Title of the comparison

  • [options] Object optional

    Options for the screenshots and compare the data. See elementCapture for more information on the screenshot options.

    • [eachFn] Function optional

      Will execute the function on client before each screenshot is taken

    • [completeFn] Function optional

      Will execute the function on client after all screenshots are taken

    • [blockOuts] Object[] | Element[] | String[] optional

      List of areas/elements that should be blocked-out

    • [blockOutColor=black] Object optional

      Color to be used for blocking-out areas {red, green, blue, alpha}

    • [wait=100] Int optional

      Wait in ms before each screenshot

    • [compare] Object optional

      Options for the comparison. See the Blink-Diff documentation

      • [id=1] Object optional
        Additional identifier to differentiate comparison
    • [allPadding] Int optional

      Padding for all sides

    • [hPadding] Int optional

      Padding on left and right side of the element

    • [vPadding] Int optional

      Padding on the top and on the bottom of the element

    • [leftPadding] Int optional

      Padding on the left of the element

    • [rightPadding] Int optional

      Padding on the right of the element

    • [topPadding] Int optional

      Padding on the top of the element

    • [bottomPadding] Int optional

      Padding on the bottom of the element

  • [callBack] Function optional

    Callback function that will be triggered with the result of the request

Returns:

Chain:

The chain object


Callback function

function (isSimilar, element, index)

Scope

{Chain}

Parameters

  • isSimilar {boolean|null} - Is comparison similar to previous one?
  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

Notes

  • isSimilar will be NULL when the value cannot be determined at the time of comparison due to the comparison process, or simply because there was no previous image to compare to.
  • isSimilar will be true when all of the comparison APIs determined a similarity to previously captured data, depending on the configuration setting for each of those comparison APIs.
  • isSimilar will be false when at least one comparison API determines a difference in the current and previous state.

Notes

  • title The title needs to be unique to identify each of these comparisons across all test-runs. Additionally, the id parameter can be used to make this identifier unique.
  • options.compare.id The id will be added to the title to get a unique identifier.

Comparison configuration

General comparison options can be set globally in the driver through the setValue/getValue methods. The options for the comparison, however, need to be supplied for every comparison itself.

Changing configuration options

driver.setValue('blinkDiff.outputOnSuccess', true);

Options

  • blinkDiff.outputOnSuccess {boolean} [default=true] - Should an output be created when comparison is successful? There will always be an output if the comparison fails.
  • blinkDiff.failOnDifference {boolean} [default=true] - Should Taxi trigger an error when a difference is recognized?
  • blinkDiff.autoApprove {boolean} [default=false] - Should Taxi auto-approve screenshots when no previous comparison exist? Otherwise, the test will ignore this comparison, saving the current build screenshot.
  • blinkDiff.approvedPath {string} [default=cwd] - Path to the approved folder. Defaults to the current working directory.
  • blinkDiff.buildPath {string} [default=approvedPath] - Path to the build folder, holding all the screenshots taken in the recent build. Defaults to the approved folder.
  • blinkDiff.diffPath {string} [default=buildPath] - Path to the difference folder, keeping the highlighted differences between the approved image and the build image. Default to the build folder.
  • blinkDiff.options {object} - Default values for Blink-Diff options. See the Blink-Diff documentation
  • blinkDiff.batchFailures {boolean} [default=false] - Failures are batched to the end of the tests when this flag is set.
  • blinkDiff.failOnAdditions {boolean} [default=false] - Fail when no approved screenshot is found.

elementCssValue

(
  • selector
  • property
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:568

Available since 0.2.0

Determines the value of a CSS property for each selected element

Note Use the original CSS property name according to the CSS standard, not the JavaScript naming convention for CSS properties.

Parameters:

  • selector String

    CSS selector of DOM elements

  • property String

    Name of the CSS property to determine the value of

  • [callBack] Function optional

    Callback function that will trigger with the value of the CSS property of the selected element

Returns:

Chain:

The chain object


Callback function

function (value, element, index)

Scope

{Chain}

Parameters

  • value {string} - Value of the requested CSS-property of the selected element
  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

elementDblClick

(
  • selector
  • [button=Mouse.BUTTON_LEFT]
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:1382

Available since 0.2.0

Double-clicks on the selected elements

Parameters:

  • selector String

    CSS selector of DOM elements

  • [button=Mouse.BUTTON_LEFT] Int optional

    Button that should be pressed when click action is executed.

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (element, index)

Scope

{Chain}

Parameters

  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

Note

You can use the constants available in the mouse-object or submit the following values:

  • 0 - Left Button
  • 1 - Middle Button
  • 2 - Right Button

elementDblClickAt

(
  • selector
  • xOffset
  • yOffset
  • [button=Mouse.BUTTON_LEFT]
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:1425

Available since 0.2.0

Double-clicks on a specific coordinate relative to the upper-left corner of the selected elements

Parameters:

  • selector String

    CSS selector of DOM elements

  • xOffset Int

    X-offset relative to the left corner of the selected element

  • yOffset Int

    Y-offset relative to the top corner of the selected element

  • [button=Mouse.BUTTON_LEFT] Int optional

    Button that should be pressed when click action is executed.

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (element, index)

Scope

{Chain}

Parameters

  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

Note

You can use the constants available in the mouse-object or submit the following values:

  • 0 - Left Button
  • 1 - Middle Button
  • 2 - Right Button

elementDblTap

(
  • selector
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:1648

Available since 0.2.0

Double-taps on the selected elements

Parameters:

  • selector String

    CSS selector of DOM elements

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (element, index)

Scope

{Chain}

Parameters

  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

elementFrame

(
  • selector
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:936

Available since 0.2.0

Determines the absolute location and size of the selected elements

Parameters:

  • selector String

    CSS selector of DOM elements

  • [callBack] Function optional

    Callback function that will be triggered with the size and location of the selected element

Returns:

Chain:

The chain object


Callback function

function (frame, element, index)

Scope

{Chain}

Parameters

  • frame {object} - Absolute coordinates and size of the selected element
    • x {int} - Absolute x-coordinate of the selected element
    • y {int} - Absolute y-coordinate of the selected element
    • width {int} - Width of the selected element
    • height {int} - Height of the selected element
  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

elementHasClass

(
  • selector
  • className
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:312

Available since 0.2.0

Checks if the selected elements have a specific class

Parameters:

  • selector String

    CSS selector of DOM elements

  • className String

    Name of class to look for

  • [callBack] Function optional

    Callback function that will be triggered with the result of the request

Returns:

Chain:

The chain object

Example:

// Selects all input tags, checking if they have the "name" class,
// and printing out the value of the input element when they have the class.

driver.elementHasClass('input', 'name', function (hasClass, element) {
  if (hasClass) {
    console.log(element.getValue());
  }
});

Callback function

function (hasClass, element, index)

Scope

{Chain}

Parameters

  • hasClass {boolean} - Does the selected element have the supplied class-name?
  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

elementHasText

(
  • selector
  • text
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:445

Available since 0.2.0

Determines if selected elements have a string or even a sub-string in their text content

Parameters:

  • selector String

    CSS selector of DOM elements

  • text String | RegEx

    String, sub-string, or regular expression to look for in the elements

  • [callBack] Function optional

    Callback function that will be called with the result of the request

Returns:

Chain:

The chain object

Example:

// Checks if the article synopsis has the word "Lion" in it.

driver.elementHasText('.synopsis', 'Lion', function (hasText) {
  if (hasText) {
    console.log('Found "Lion" in the synopsis!');
  }
});

Callback function

function (hasText, element, index)

Scope

{Chain}

Parameters

  • hasText {boolean} - Does selected element have the supplied text as string or substring?
  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

Note The text search is case sensitive. If you want case insensitivity, then please use regular expressions. (i.e. //i)

elementHover

(
  • selector
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:1470

Available since 0.2.0

Hovers the mouse over the selected elements

Parameters:

  • selector String

    CSS selector of DOM elements

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (element, index)

Scope

{Chain}

Parameters

  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

elementHoverAt

(
  • selector
  • xOffset
  • yOffset
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:1504

Available since 0.2.0

Hovers the mouse over a specific coordinate relative to the upper-left corner of the selected elements

Parameters:

  • selector String

    CSS selector of DOM elements

  • xOffset Int

    X-offset relative to the left corner of the selected element

  • yOffset Int

    Y-offset relative to the top corner of the selected element

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (element, index)

Scope

{Chain}

Parameters

  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

elementIsDisplayed

(
  • selector
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:607

Available since 0.2.0

Checks if the selected elements are displayed somewhere on the page

Parameters:

  • selector String

    CSS selector of DOM elements

  • [callBack] Function optional

    Callback function that will be triggered with the result of the request

Returns:

Chain:

The chain object


Callback function

function (isDisplayed, element, index)

Scope

{Chain}

Parameters

  • isDisplayed {boolean} - Is the selected element displayed?
  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

elementIsEnabled

(
  • selector
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:680

Available since 0.2.0

Checks if the selected elements are enabled

Parameters:

  • selector String

    CSS selector of DOM elements

  • [callBack] Function optional

    Callback function that will be triggered with the result of the request

Returns:

Chain:

The chain object


Callback function

function (isEnabled, element, index)

Scope

{Chain}

Parameters

  • isEnabled {boolean} - Is the selected element enabled?
  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

elementIsSelected

(
  • selector
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:642

Available since 0.2.0

Checks if the selected elements are checked

Note This function will only work on elements which have a "checked"-value (i.e. checkbox, radiobox, or options element).

Parameters:

  • selector String

    CSS selector of DOM elements

  • [callBack] Function optional

    Callback function that will be triggered with the result of the request

Returns:

Chain:

The chain object


Callback function

function (isSelected, element, index)

Scope

{Chain}

Parameters

  • isSelected {boolean} - Is the selected element checked/selected?
  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

elementLocation

(
  • selector
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:862

Available since 0.2.0

Determines the absolute location of the selected elements

Parameters:

  • selector String

    CSS selector of DOM elements

  • [callBack] Function optional

    Callback function that will be triggered with the location of the selected element

Returns:

Chain:

The chain object


Callback function

function (location, element, index)

Scope

{Chain}

Parameters

  • location {object} - Absolute location of the selected element
    • x {int} - Absolute x-coordinate of the selected element
    • y {int} - Absolute y-coordinate of the selected element
  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

elementLocationInView

(
  • selector
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:899

Available since 0.2.0

Determines the location of the selected elements relative to the current view-ports top-left corner

Parameters:

  • selector String

    CSS selector of DOM elements

  • [callBack] Function optional

    Callback function that will be triggered with the location of the selected element

Returns:

Chain:

The chain object


Callback function

function (location, element, index)

Scope

{Chain}

Parameters

  • location {object} - Location of the selected element relative to the view-port
    • x {int} - X-coordinate of the selected element relative to the view-port
    • y {int} - Y-coordinate of the selected element relative to the view-port
  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

elementLongTap

(
  • selector
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:1682

Available since 0.2.0

Triggers a long-tap on the selected elements

Parameters:

  • selector String

    CSS selector of DOM elements

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (element, index)

Scope

{Chain}

Parameters

  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

elementRelativeCenter

(
  • selector
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:1012

Available since 0.2.0

Determines the coordinates of the center of the selected elements relative to the elements top-left corner

Parameters:

  • selector String

    CSS selector of DOM elements

  • [callBack] Function optional

    Callback function that will be triggered with the relative center coordinates of the selected element

Returns:

Chain:

The chain object


Callback function

function (coordinates, element, index)

Scope

{Chain}

Parameters

  • coordinates {object} - Coordinates of the center of the selected element relative to the upper-left corner of the element itself
    • x {int} - X-coordinate of the selected elements center relative to the upper-left corner of the element itself
    • y {int} - Y-coordinate of the selected elements center relative to the upper-left corner of the element itself
  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

elements

(
  • selector
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:227

Available since 0.2.0

Selects DOM elements, triggering each selected element on the supplied callback function

Parameters:

  • selector String

    CSS selector of DOM elements

  • [callBack] Function optional

    Callback function that will be triggered with each selected element in turn

Returns:

Chain:

The chain object

Example:

// Determines all element with the "title" class and prints the
// text content of these elements to the console, one-by-one

driver.elements('.title', function (element) {
  console.log(element.getText());
});

Callback function

function (element, index)

Scope

{Chain}

Parameters

  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

elementSendKeys

(
  • selector
  • keys
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:715

Available since 0.2.0

Types complete strings or key-strokes into the selected element

Parameters:

  • selector String

    CSS selector of DOM elements

  • keys String | String[]

    or key-strokes to send

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (element, index)

Scope

{Chain}

Parameters

  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

elementSize

(
  • selector
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:825

Available since 0.2.0

Determines the size of the selected elements

Parameters:

  • selector String

    CSS selector of DOM elements

  • [callBack] Function optional

    Callback function that will be triggered with the size of the selected element

Returns:

Chain:

The chain object


Callback function

function (size, element, index)

Scope

{Chain}

Parameters

  • size {object} - Size of the selected element
    • width {int} - Width of the selected element
    • height {int} - Height of the selected element
  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

elementSubmit

(
  • selector
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:787

Available since 0.2.0

Submits the selected form elements

Note This should be usually only one form element. It doesn't make sense to apply this to any other element type.

Parameters:

  • selector String

    CSS selector of DOM elements

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (element, index)

Scope

{Chain}

Parameters

  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

elementTagName

(
  • selector
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:533

Available since 0.2.0

Gets the name of the tag for each selected element

Parameters:

  • selector String

    CSS selector of DOM elements

  • [callBack] Function optional

    Callback function that will be triggered with the name of the tag of the selected element

Returns:

Chain:

The chain object


Callback function

function (tagName, element, index)

Scope

{Chain}

Parameters

  • tagName {string} - Tag-name of the selected element
  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

elementTap

(
  • selector
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:1614

Available since 0.2.0

Taps on the selected elements

Parameters:

  • selector String

    CSS selector of DOM elements

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (element, index)

Scope

{Chain}

Parameters

  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

elementText

(
  • selector
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:402

Available since 0.2.0

Gets the text content of the selected elements

Parameters:

  • selector String

    CSS selector of DOM elements

  • [callBack] Function optional

    Callback function that will be called with the text content of the selected element

Returns:

Chain:

The chain object

Example:

// Retrieves the contents of an article synopsis

driver.elementText('.synopsis', function (text) {
  console.log(text);
});

Callback function

function (text, element, index)

Scope

{Chain}

Parameters

  • text {string} - Text content of selected element
  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

elementTouch

(
  • selector
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:1544

Available since 0.2.0

Triggers a touch-event on the selected elements

Parameters:

  • selector String

    CSS selector of DOM elements

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (element, index)

Scope

{Chain}

Parameters

  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

elementTouchAt

(
  • selector
  • xOffset
  • yOffset
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:1578

Available since 0.2.0

Triggers a touch-event on the selected element relative to the upper-left corner of the elements

Parameters:

  • selector String

    CSS selector of DOM elements

  • xOffset Int

    X-offset relative to the left corner of the selected element

  • yOffset Int

    Y-offset relative to the top corner of the selected element

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (element, index)

Scope

{Chain}

Parameters

  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

elementValue

(
  • selector
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:495

Available since 0.2.0

Determines the contents of the value attribute on each selected element

Note This will only work on elements that have a value attribute.

Parameters:

  • selector String

    CSS selector of DOM elements

  • [callBack] Function optional

    Callback function that will be called with the value of the selected element

Returns:

Chain:

The chain object


Callback function

function (value, element, index)

Scope

{Chain}

Parameters

  • value {string} - Value of the "value" attribute of the selected element
  • element {Element} - Selected element
  • index {int} - Zero-based index of the selected element

end

() Driver

Defined in lib/chain.js:2891

Available since 0.2.0

Completes the session by finishing up comparison tasks and closing the browser window

Note You cannot chain after this function call anymore, and the driver will be closed so that there is no way anymore to access the browser through the same session. To get access again to the browser, you need to create a whole new Taxi instance.

Returns:

Driver:

Callback function

none

forward

(
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2479

Available since 0.2.0

Goes forward in the document history, equivalent to a user pressing the forward button within the browser

Parameters:

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (activeWindow)

Scope

{Chain}

Parameters

  • activeWindow {ActiveWindow} - Active browser document/window

getDriver

() Driver

Defined in lib/chain.js:115

Available since 0.2.0

Gets the driver object.

This is an alias for driver().

Returns:

hover

(
  • x
  • y
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2378

Available since 0.2.0

Hovers the mouse over the active document at the specified absolute coordinates

Parameters:

  • x Int

    Absolute x-coordinate to hover above

  • y Int

    Absolute y-coordinate to hover above

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (activeWindow)

Scope

{Chain}

Parameters

  • activeWindow {ActiveWindow} - Active browser document/window

location

(
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:3153

Available since 0.2.2

Determines the absolute location of the active window

Parameters:

  • [callBack] Function optional

    Callback function that will be triggered with the location of the window

Returns:

Chain:

The chain object


Callback function

function (location, activeWindow)

Scope

{Chain}

Parameters

  • location {object} - Absolute location of the selected element
    • x {int} - Absolute x-coordinate of the selected element
    • y {int} - Absolute y-coordinate of the selected element
  • activeWindow {ActiveWindow} - Active browser document/window

maximize

(
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:3220

Available since 0.2.2

Expands the active window to its maximum size

Parameters:

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (activeWindow)

Scope

{Chain}

Parameters

  • activeWindow {ActiveWindow} - Active browser document/window

navigateTo

(
  • url
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2415

Available since 0.2.0

Navigates the current document to the supplied URL

Parameters:

  • url String

    URL that should be navigated to

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (activeWindow)

Scope

{Chain}

Parameters

  • activeWindow {ActiveWindow} - Active browser document/window

refresh

(
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2541

Available since 0.2.0

Refreshes the current document as if the user pressed the refresh button within the browser

Parameters:

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (activeWindow)

Scope

{Chain}

Parameters

  • activeWindow {ActiveWindow} - Active browser document/window

relocate

(
  • x
  • y
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:3187

Available since 0.2.2

Determines the absolute location of the active window

Parameters:

  • x Int

    Absolute x-coordinate of the next window location

  • y Int

    Absolute y-coordinate of the next window location

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (activeWindow)

Scope

{Chain}

Parameters

  • activeWindow {ActiveWindow} - Active browser document/window

resize

(
  • width
  • height
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:3120

Available since 0.2.2

Re-sizes the active window

Parameters:

  • width Int

    Width of the window

  • height Int

    Height of the window

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (activeWindow)

Scope

{Chain}

Parameters

  • activeWindow {ActiveWindow} - Active browser document/window

scrollBy

(
  • xOffset
  • yOffset
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2257

Available since 0.2.0

Scrolls the currently active document to a specific offset relative to the current scroll location

Parameters:

  • xOffset Int

    X-offset to scroll to relative to the current scroll position

  • yOffset Int

    Y-offset to scroll to relative to the current scroll position

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (activeWindow)

Scope

{Chain}

Parameters

  • activeWindow {ActiveWindow} - Active browser document/window

scrollLocation

(
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2190

Available since 0.2.0

Determines the scroll location coordinates within the currently active document

Parameters:

  • [callBack] Function optional

    Callback function that will be triggered with the scroll-location of the active window

Returns:

Chain:

The chain object


Callback function

function (coordinates, activeWindow)

Scope

{Chain}

Parameters

  • coordinates {object} - Absolute coordinates of the view-port scroll location
    • x {int} - Absolute x-coordinate of the view-port scroll location
    • y {int} - Absolute y-coordinate of the view-port scroll location
  • activeWindow {ActiveWindow} - Active browser document/window

scrollTo

(
  • x
  • y
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2224

Available since 0.2.0

Scrolls to an absolute scroll location within the currently active document

Parameters:

  • x Int

    Absolute x-coordinate to scroll to

  • y Int

    Absolute y-coordinate to scroll to

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (activeWindow)

Scope

{Chain}

Parameters

  • activeWindow {ActiveWindow} - Active browser document/window

sendKeys

(
  • keys
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:1759

Available since 0.2.0

Types complete strings or key-strokes into the active window, effectively sending key-strokes to the focused element

Parameters:

  • keys String | String[]

    or key-strokes to send

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (activeWindow)

Scope

{Chain}

Parameters

  • activeWindow {ActiveWindow} - Active browser document/window

size

(
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:3086

Available since 0.2.2

Determines the size of the active window

Parameters:

  • [callBack] Function optional

    Callback function that will be triggered with the size of the window

Returns:

Chain:

The chain object


Callback function

function (size, activeWindow)

Scope

{Chain}

Parameters

  • size {object} - Size of the selected element
    • width {int} - Width of the selected element
    • height {int} - Height of the selected element
  • activeWindow {ActiveWindow} - Active browser document/window

sleep

(
  • ms
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2862

Available since 0.2.0

Puts Taxi to sleep for a specific amount of time

Parameters:

  • ms Int

    Time in milliseconds to wait

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (activeWindow)

Scope

{Chain}

Parameters

  • activeWindow {ActiveWindow} - Active browser document/window

source

(
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2158

Available since 0.2.0

Determines the source-code of the currently active document

Parameters:

  • [callBack] Function optional

    Callback function that will be triggered with the source-code of the document

Returns:

Chain:

The chain object


Callback function

function (source, activeWindow)

Scope

{Chain}

Parameters

  • source {string} - Source-code of the active browser document
  • activeWindow {ActiveWindow} - Active browser document/window

title

(
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2126

Available since 0.2.0

Determines the title of the currently active document

Parameters:

  • [callBack] Function optional

    Callback function that will be triggered with the title of the document

Returns:

Chain:

The chain object


Callback function

function (title, activeWindow)

Scope

{Chain}

Parameters

  • title {string} - Title of the active browser document
  • activeWindow {ActiveWindow} - Active browser document/window

url

(
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2447

Available since 0.2.0

Determines the current URL of the active document

Parameters:

  • [callBack] Function optional

    Callback function that will be called with the URL of the document

Returns:

Chain:

The chain object


Callback function

function (activeWindow)

Scope

{Chain}

Parameters

  • url {string} - URL of the active document
  • activeWindow {ActiveWindow} - Active browser document/window

waitForElementDisplay

(
  • selector
  • [timeOut=10000]
  • [abortOnFailure=true]
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:3042

Available since 0.2.0

Waits for a specific amount of time that an element will be shown

Parameters:

  • selector String

    CSS selector of DOM elements

  • [timeOut=10000] Int optional

    Max. time-out in waiting on the element

  • [abortOnFailure=true] Boolean optional

    Should an exception be thrown when time-out is reached?

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (activeWindow)

Scope

{Chain}

Parameters

  • activeWindow {ActiveWindow} - Active browser document/window

waitForElementNotDisplayed

(
  • selector
  • [timeOut=10000]
  • [abortOnFailure=true]
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2958

Available since 0.2.0

Waits for a specific amount of time that an element will be hidden

Parameters:

  • selector String

    CSS selector of DOM elements

  • [timeOut=10000] Int optional

    Max. time-out in waiting on the element

  • [abortOnFailure=true] Boolean optional

    Should an exception be thrown when time-out is reached?

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (activeWindow)

Scope

{Chain}

Parameters

  • activeWindow {ActiveWindow} - Active browser document/window

waitForElementNotPresent

(
  • selector
  • [timeOut=10000]
  • [abortOnFailure=true]
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2917

Available since 0.2.0

Waits for a specific amount of time that an element disappears from the DOM

Parameters:

  • selector String

    CSS selector of DOM elements

  • [timeOut=10000] Int optional

    Max. time-out in waiting on the element

  • [abortOnFailure=true] Boolean optional

    Should an exception be thrown when time-out is reached?

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (activeWindow)

Scope

{Chain}

Parameters

  • activeWindow {ActiveWindow} - Active browser document/window

waitForElementPresent

(
  • selector
  • [timeOut=10000]
  • [abortOnFailure=true]
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:3001

Available since 0.2.0

Waits for a specific amount of time that an element appears in the DOM

Parameters:

  • selector String

    CSS selector of DOM elements

  • [timeOut=10000] Int optional

    Max. time-out in waiting on the element

  • [abortOnFailure=true] Boolean optional

    Should an exception be thrown when time-out is reached?

  • [callBack] Function optional

    Callback function that will be triggered when the action completes

Returns:

Chain:

The chain object


Callback function

function (activeWindow)

Scope

{Chain}

Parameters

  • activeWindow {ActiveWindow} - Active browser document/window

windows

(
  • [callBack]
)
Chain chainable

Defined in lib/chain.js:2827

Available since 0.2.0

Determines a list of available windows/documents within the same browser session

Parameters:

  • [callBack] Function optional

    Callback function that will be triggered with a list of available windows

Returns:

Chain:

The chain object


Callback function

function (windows, browser)

Scope

{Chain}

Parameters

  • windows {WindowHandler[]} - A list of window objects that are open in the browser
  • browser {Browser} - The browser session