A small, rambuctious configuration wrapper for WD.js or WebdriverIO
Main features:
- Easy configuration for local, Sauce Labs, BrowserStack testing.
- Invokes selenium server for local runs automagically.
- Integration helpers for Mocha tests.
- Auto-magic setting of Sauce Labs test status.
- Use your own test framework and test runner.
First, install the library.
$ npm install --save-dev rowdy
If you want to have Rowdy run and control a local Selenium server, then install the standalone client and run the install scripts:
$ npm install --save-dev selenium-standalone
$ npm run install-selenium
This shells out to selenium-standalone
and is necessary at some point in your
integration if using the standalone (local) server.
The above steps are necessary if the configuration value
settings.local.server.start
is true
. You can skip the steps if you are
separately running / managing a local Selenium server or using a remote Selenium
farm (e.g., Sauce Labs or BrowserStack).
Then, install the necessary client libraries.
$ npm install --save-dev wd
$ npm install --save-dev webdriverio saucelabs
Note: If using SauceLabs + WebdriverIO, we lazy require
the Sauce Labs
module to upload results of "done" to your SL account.
By default Rowdy will lazy initialize the library's included
config.js configuration file. (The first access of most
rowdy.*
properties / methods will force this.)
However, on first import of Rowdy, you can override this behavior to do things like override parts of the default configuration:
// Start with default configuration.
var config = require("rowdy/config");
config.serverLogger = true;
// ... any other mutations
// Pass configuration in.
var rowdy = require("rowdy")(config);
Or, you can simply copy config.js to your project, edit it as appropriate and load:
var config = require("./PATH/TO/config");
var rowdy = require("rowdy")(config);
One of the Rowdy peer dependencies is selenium-standalone
. This package
contains an install script that you may need (and do need on Windows):
$ node_modules/.bin/selenium-standalone install
Some other tips and tricks:
Recent Safari updates have broken automatic driver usage, so you need a series of tedious steps per http://elementalselenium.com/tips/69-safari:
- Download the driver at your current version from
https://github.com/SeleniumHQ/selenium/raw/selenium-VERSION/javascript/safari-driver/prebuilt/SafariDriver.safariextz
. A current version used inselenium-standalone
is2.45.0
, so that would correspond to: github.com/SeleniumHQ/selenium/raw/selenium-2.45.0/javascript/safari-driver/prebuilt/SafariDriver.safariextz - Double click the downloaded driver file. Click "Install" when prompted by Safari.
See https://code.google.com/p/selenium/wiki/InternetExplorerDriver#Required_Configuration for extra steps needed to work with local IE. Anecdotally, for Win7+IE11 in a VM, the only actually tweak needed was:
- Create key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BFCACHE
and add DWORD ofiexplore.exe
defaulted to0
value.
TODO: API is still settling out.
We provide full working examples of the Mocha Adapter:
- examples/mocha/wd: Basic Mocha/Chai tests with WD.js
- examples/mocha/webdriverio: The same Mocha/Chai tests with WebdriverIO.
TODO: Add a full guide for configuring the adapter and (1) the options,
(2) adapter.refreshClient()
use, (3) adapter.client
use.
The full API to WD.js is available at: https://github.com/admc/wd/blob/master/doc/api.md
WebdriverIO provides the following useful documentation:
Please see the Contributions Guide for how to help out with the plugin.
We test all changes with Travis CI. Here's our current build status:
We also do multi-browser testing thanks to donated VM time from Sauce Labs and BrowserStack. Here's our Sauce Labs build matrix:
All code not otherwise specified is Copyright Formidable Labs, Inc. Released under the MIT License.