wd-selenium-hooks
Version:
Webdriver configuration hooks for starting and stopping selenium standalone server with PhantomJS.
77 lines (43 loc) • 2.15 kB
Markdown
# wd-selenium-hooks
> Webdriver configuration hooks for starting and stopping selenium standalone server with PhantomJS.
[](https://travis-ci.org/wilmoore/node-wd-selenium-hooks) [](https://codeclimate.com/github/wilmoore/node-wd-selenium-hooks) [](https://github.com/feross/standard)
```shell
npm install wd-selenium-hooks --save-dev
```
> You can also [download the files manually](https://github.com/wilmoore/node-wd-selenium-hooks/releases).
###### npm stats
[](https://www.npmjs.org/package/wd-selenium-hooks) [](https://www.npmjs.org/package/wd-selenium-hooks) [](https://gemnasium.com/wilmoore/node-wd-selenium-hooks)
## Usage
In your `wdio.config.js` add the following:
```js
var selenium = require('wd-selenium-hooks')
exports.config = {
onPrepare: function () {
selenium.onPrepare(this)
},
onComplete: function () {
selenium.onComplete(this)
}
}
```
## API
### `.onPrepare(this)`
Starts the selenium server.
###### arguments
- `object (this)` Reference to the configuration.
###### returns
- `(Undefined)`
### `.onComplete(this)`
Stops the selenium server.
###### arguments
- `object (this)` Reference to the configuration.
###### returns
- `(Undefined)`
## Reference
- [WebdriverIO Configuration](http://www.webdriver.io/guide/getstarted/configuration.html)
## Alternatives
- [Alternative approach using promises](https://gist.github.com/klamping/f48f3167775e483e712e)
## Contributing
> SEE: [contributing.md](contributing.md)
## Licenses
[](https://github.com/wilmoore/node-wd-selenium-hooks/blob/master/license)