Burnout is an asynchronous, chainable and DRY interface for building Selenium 2 WebDriver scripts in Node. It was written primarily for interfacing with Sauce Labs, but it should work with most Selenium 2 setups. Burnout builds on top of the excellent Selenium 2 WebDriver library wd.
npm install burnout
Burnout's API strives to map as closely as possible to the interface exposed by wd, which in turn maps closely to the Selenium JSON Wire Protocol.
An example test:
var burnout =assert = ; // Your assertion utility of choice hereburnout// Callbacks are optional..// Commands can be chained..// Chained commands are guaranteed to run synchronously..// End the test. Status automatically posted to Sauce Labs.;
These are the methods currently exposed by Burnout:
var seleniumMethods ='init''get''eval''element''elementById''elementByName''elementByCss''getAttribute''execute''executeAsync''click''doubleClick''close''setImplicitWaitTimeout''setAsyncScriptTimeout''moveTo''scroll''text''buttonDown''buttonUp''active''keyToggle';
Burnout uses a hardcoded selection of browsers when running tests. Exclusions to this selection are currently supported, but not additions. This will change as I get a feel for how people are using the library, but for my immediate purposes I wanted tests to be inclusive by default.
These are the browsers that Burnout tests by default:
var seleniumBrowsers =browserName: "googlechrome"browserName: "firefox"version: "11"platform: "XP"browserName: "firefox"version: "3.6"platform: "XP"browserName: "iexplore"version: "6"platform: "XP"browserName: "iexplore"version: "7"platform: "XP"browserName: "iexplore"version: "8"platform: "XP"browserName: "iexplore"version: "9"browserName: "opera"version: "11"platform: "LINUX";
If you want to exclude specific browsers from you test, you can specify them when you initialize Burnout:
If you just want to sanity check your code, you can set an environment variable when running your tests:
# If $ENV is set to test, only Google Chrome will be testedENV=test node ./path/to/selenium-suite.js
Alternatively, you can set 'debug' to true when initializing Burnout:
Burnout accepts Sauce Labs account information as environment variables:
SAUCE_USER=foo SAUCE_KEY=123-456-789 node ./path/to/selenium-suite.js
Or as options in the call to initialize:
Non-Sauce Labs Environments
Burnout also accepts a custom hostname and port for your local environment: