API Docs for: 0.0.2
Show:

Dalek.Sauce Class

Defined in: index.js:77
Module: Driver

This module is a driver plugin for DalekJS. It connects Daleks testsuite with the remote testing environment of Sauce Labs.

The driver can be installed with the following command:

$ npm install dalek-driver-sauce --save-dev

You can use the driver by adding a config option to the your Dalekfile

"driver": ["sauce"]

Or you can tell Dalek that it should run your tests via sauces service via the command line:

$ dalek mytest.js -d sauce

In order to run your tests within the Sauce Labs infrastructure, you must add your sauce username & key to your dalek configuration. Those two parameters must be set in order to get this driver up & running. You can specifiy them within your Dalekfile like so:

"driver.sauce": {
  "user": "dalekjs",
  "key": "aaaaaa-1234-567a-1abc-1br6d9f68689"
}

It is also possible to specify a set of other extra saucy parameters like name & tags:

"driver.sauce": {
  "user": "dalekjs",
  "key": "aaaaaa-1234-567a-1abc-1br6d9f68689",
  "name": "Guineapig",
  "tags": ["dalek", "testproject"]
}

If you would like to have a more control over the browser/OS combinations that are available, you are able to configure you custom combinations:

"browsers": [{
  "chrome": {
    "platform": "OS X 10.6",
    "actAs": "chrome",
    "version": 27
  },
  "chromeWin": {
    "platform": "Windows 7",
    "actAs": "chrome",
    "version": 27
  },
  "chromeLinux": {
    "platform": "Linux",
    "actAs": "chrome",
    "version": 26
  }

You can then call your custom browsers like so:

$ dalek mytest.js -d sauce -b chrome,chromeWin,chromeLinux

or you can define them in your Dalekfile:

"browser": ["chrome", "chromeWin", "chromeLinux"]

A list of all available browser/OS combinations, can be found here.

Methods

_actionQueueNonReturneeTemplate

(
  • fnName
  • hash
  • uuid
)
private chainable

Defined in index.js:369

Generates a chain of webdriver calls for webdriver methods that don't have a return value TODO: Name is weird, should be saner

Parameters:

  • fnName String

    Name of the webdriver function that should be called

  • hash String

    Unique action hash

  • uuid String

    Unique action hash

_createNonReturnee

(
  • fnName
)
Function private

Defined in index.js:353

Creates an anonymus function that calls a webdriver method that has no return value, emits an empty result event if the function has been run TODO: Name is weird, should be saner

Parameters:

  • fnName String

    Name of the webdriver function that should be called

Returns:

Function:

fn

_driverStatus

(
  • statusInfo
)
Object private

Defined in index.js:336

Loads the browser driver status

Parameters:

  • statusInfo Object

    Driver status information

Returns:

Object:

promise Driver status promise

_generateDummyDriverMessageFn

(
  • fnName
  • hash
  • uuid
)
Object private

Defined in index.js:388

Creates a driver notification with an empty value TODO: Name is weird, should be saner

Parameters:

  • fnName String

    Name of the webdriver function that should be called

  • hash String

    Unique action hash

  • uuid String

    Unique action hash

Returns:

Object:

promise Driver message promise

_initializeProperties

(
  • browser
)
private chainable

Defined in index.js:189

Binds listeners on browser events

Parameters:

  • browser Object

    Browser module

_initializeProperties

(
  • opts
)
private chainable

Defined in index.js:166

Initializes the driver properties

Parameters:

  • opts Object

    Options needed to kick off the driver

_sessionStatus

(
  • sessionInfo
)
Object private

Defined in index.js:319

Loads the browser session status

Parameters:

  • sessionInfo Object

    Session information

Returns:

Object:

promise Browser session promise

_startBrowserSession

(
  • deferred
)
private chainable

Defined in index.js:228

Creates a new webdriver session Gets the driver status Gets the session status Resolves the promise (e.g. let them tests run)

Parameters:

  • deferred Object

    Browser session deferred

create

(
  • opts
)
Sauce

Defined in index.js:455

Creates a new driver instance

Parameters:

  • opts Object

    Options needed to kick off the driver

Returns:

Sauce:

driver

dummyBrowser

() Bool

Defined in index.js:432

Determines if the driver comes with its own browsers bundled

Returns:

Bool:

isDummyBrowser Driver does not rely on Dalek browser modules

end

() chainable

Defined in index.js:274

Starts to execution of a batch of tests

flushQueue

() chainable

Defined in index.js:297

Flushes the action queue (e.g. commands that should be send to the wbdriver server)

getBrowser

(
  • driver
)
Object

Defined in index.js:443

Returnes the browser that comes bundled with the driver

Parameters:

  • driver Object

    Driver instance

Returns:

Object:

Browser module

isMultiBrowser

() Bool

Defined in index.js:408

Determines if the driver is a "multi" browser driver, e.g. can handle more than one browser

Returns:

Bool:

isMultiBrowser Driver can handle more than one browser

start

() Object

Defined in index.js:206

Checks if a webdriver session has already been established, if not, create a new one

Returns:

Object:

promise Driver promise

verifyBrowser

() Bool

Defined in index.js:420

Verifies a browser request TODO: Still a noop, need to add "verify the browser" logic

Returns:

Bool:

isVerifiedBrowser Driver can handle this browser