forked from webdriverio/webdriverio
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
35 lines (31 loc) · 1.07 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/**
* webdriverjs
* https://github.com/Camme/webdriverjs
*
* A WebDriver module for nodejs. Either use the super easy help commands or use the base
* Webdriver wire protocol commands. Its totally inspired by jellyfishs webdriver, but the
* goal is to make all the webdriver protocol items available, as near the original as possible.
*
* Copyright (c) 2013 Camilo Tapia <[email protected]>
* Licensed under the MIT license.
*
* Contributors:
* Dan Jenkins <[email protected]>
* Christian Bromann <[email protected]>
*/
var singletonInstance = null,
WebdriverJS = require('./lib/webdriverjs');
// expose the man function
// if we need a singleton, we provide the option here
exports.remote = function(options) {
// make sure we have a default options if none are provided
options = options || {};
if (options.singleton) {
if (!singletonInstance) {
singletonInstance = new WebdriverJS(options);
}
return singletonInstance;
} else {
return new WebdriverJS(options);
}
};