plus.garden.webdriver
v0.0.1
Published
Webdriver for plus.garden
Downloads
1
Readme
plus.garden.webdriver
API Reference | CSS Selectors | Selenium installation guide
Webdriver for Garden.js
Installing/Configuring
Suppose, you already have a project with configured garden environment (more info here).
Now you need to add plus.garden.webdriver as a dependency in your garden/package.json
:
"dependencies": {
/* ... */
"plus.garden.webdriver": "~0.0.1",
/* ... */
}
And run npm install
npm install
Or just add and install the dependency automatically via npm:
$ cd garden
$ npm install --save plus.garden.webdriver
Now register the installed module in garden/container.js
:
module.exports = function (container) {
//...
container.register('Webdriver', require('plus.garden.webdriver'));
//...
}
And add the registered module to garden's "world"
// garden/DIR_WITH_YOUR_TESTS/support/world.js
var World = function World(callback) {
garden.get('Webdriver.Browser').create(function (browserService) {
this.browserService = browserService;
this.driver = browserService.driver;
this.browser = browserService.browser;
}.bind(this));
}
defineSupportCode(function({setWorldConstructor}) {
/* ... */
setWorldConstructor(World);
/* ... */
});
That's it. Your garden is ready to use the webdriver module.
You also can install this package with Garden generator.
Dependencies
For using plus.garden.webdriver you should install and run Selenium server. You can install and manage it in any convenient way.
We provide a list of steps for installing Selenium, which we tested in our package. See here.