cucumber-wd-plugin
Provide this plugin with a reference to the cucumber runtime and it will initialize a selenium session given
a set of configuration data and automatically close your session after cucumber completes
Configuration
see lib/defaultConfig.js for an example config
If you are using SauceLabs be sure to set your SAUCE_USERNAME and SAUCE_ACCESS_KEY in your environment variables
or pass them in your config. See wd's readme for details.
Example usage
In a step definitions file create a listener using
var browserPlugin = wdPlugin(config)
which will provide a browser interface to the selenium browser and establish a connection. Once the connection is
established the browser is available from the plugin, so you can do something like:
this.Before(function(callback) {
this.browser = browserPlugin.browser
callback()
}
and provide browser access on the world object
See the node-bdd-example project for usage
Support
If you're using cucumber-js with grunt-cucumber
like I am you'll want to take a look at this pull request