forked from FormidableLabs/rowdy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
226 lines (210 loc) · 5.66 KB
/
config.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
"use strict";
/**
* A base configuration.
*
* This file will automatically be loaded by rowdy if used without calling
* `require("rowdy")(config)`.
*
* **Default**: Do nothing and allow rowdy to auto-configure with this file.
*
* **Import & Override**: You can import this file like:
*
* ```js
* var config = require("rowdy/config");
* var config.client.logger = true;
* // OTHER MUTATIONS
* var rowdy = require("rowdy")(config);
* ```
*
* **Copy & Edit**: Or just copy this file to your own project and edit directly
* then import.
*
*/
var path = require("path");
// Infer Phantom path off NPM module if available.
var PHANTOM_PATH = false;
try {
PHANTOM_PATH = require("phantomjs-prebuilt").path; // eslint-disable-line global-require
} catch (err) {
// Leave false.
}
// Travis
var BUILD = process.env.TRAVIS_BUILD_NUMBER ?
process.env.TRAVIS_BUILD_NUMBER + "@" + process.env.TRAVIS_COMMIT :
"local";
// Sauce
var SAUCE_BRANCH = process.env.TRAVIS_BRANCH || "local";
var SAUCE_TAG = process.env.SAUCE_USERNAME + "@" + SAUCE_BRANCH;
var SAUCE_NAME = process.env.SAUCE_USERNAME;
// Browser Stack
var BROWSER_STACK_BRANCH = process.env.TRAVIS_BRANCH || "local";
var BROWSER_STACK_TAG = process.env.BROWSER_STACK_USERNAME + "@" +
BROWSER_STACK_BRANCH;
var BROWSER_STACK_NAME = process.env.BROWSER_STACK_USERNAME;
// Default start/stop timeout value.
var TIMEOUT = 10 * 1000; // eslint-disable-line no-magic-numbers
module.exports = {
/**
* Misc. options.
*
* Options can be globally overriden with a merge of a stringified JSON
* object like:
* ```
* ROWDY_OPTIONS='{ "client":{ "logger":true }, "server":{ "logger":true } }'
* ROWDY_OPTIONS='{ "driverLib": "wd" }'
* ROWDY_OPTIONS='{ "driverLib": "webdriverio" }'
* ```
*/
options: {
client: {
logger: false,
port: null // Selenium port to hit.
},
server: {
logger: false,
debug: false,
port: null, // Selenium port to start on.
useExisting: false, // Use existing Selenium server?
startTimeout: TIMEOUT, // Max wait for local server to start (ms).
stopTimeout: TIMEOUT // Max wait for local server to stop (ms).
// Implied Overrides
// -----------------
// start: true,
// phantomPath: PHANTOM_PATH
},
guacamole: {
// Use https://github.com/testarmada/guacamole settings?
// Note: Implicitly disabled if `guacmole` is not installed.
enabled: true,
shrinkwrap: path.join(__dirname, "guacamole-shrinkwrap.json")
},
driverLib: "wd" // "wd" or "webdriverio"
},
/**
* Webdriver settings and capabilities.
*
* Select a path within this object using `ROWDY_SETTINGS="path.to.foo"`
* Which will then infer all of the `default` settings at that level
* and merge with specific fields.
*/
settings: {
/**
* Local Selenium: `desiredCapabilities.browserName`
*
* Options:
* - "firefox",
* - "phantomjs"
* - "chrome"
* - "safari"
* - "internet explorer"
*
* See: https://code.google.com/p/selenium/wiki/DesiredCapabilities
*/
local: {
default: {
desiredCapabilities: {
browserName: "phantomjs"
},
// These options _can_ be overriden from environment options.
server: {
start: true,
phantomPath: PHANTOM_PATH
}
},
phantomjs: {
desiredCapabilities: {
browserName: "phantomjs"
}
},
firefox: {
desiredCapabilities: {
browserName: "firefox"
}
},
chrome: {
desiredCapabilities: {
browserName: "chrome"
}
},
safari: {
desiredCapabilities: {
browserName: "safari"
}
},
ie: {
desiredCapabilities: {
browserName: "internet explorer"
}
}
},
/**
* SauceLabs.
*
* https://saucelabs.com/platforms
*/
sauceLabs: {
default: {
desiredCapabilities: {
name: SAUCE_NAME,
tags: [SAUCE_TAG],
public: "public",
build: BUILD
},
remote: {
port: 80,
user: process.env.SAUCE_USERNAME,
// WD.js credentials.
hostname: "ondemand.saucelabs.com",
pwd: process.env.SAUCE_ACCESS_KEY,
// WebdriverIO credentials.
host: "ondemand.saucelabs.com",
key: process.env.SAUCE_ACCESS_KEY
},
// Custom indicator of vendor service.
isSauceLabs: true
}
},
/**
* BrowserStack.
*
* http://www.browserstack.com/automate/capabilities
*/
browserStack: {
default: {
desiredCapabilities: {
name: BROWSER_STACK_TAG,
project: BROWSER_STACK_NAME,
build: BUILD
},
remote: {
port: 80,
user: process.env.BROWSER_STACK_USERNAME,
// WD.js credentials.
hostname: "hub.browserstack.com",
pwd: process.env.BROWSER_STACK_ACCESS_KEY,
// WebdriverIO credentials.
host: "hub.browserstack.com",
key: process.env.BROWSER_STACK_ACCESS_KEY
},
// Custom indicator of vendor service.
isBrowserStack: true
},
/*eslint-disable camelcase*/
"safari-mac": {
desiredCapabilities: {
browserName: "safari",
os: "OS X",
os_version: "Mavericks"
}
},
"chrome-win7": {
desiredCapabilities: {
browserName: "chrome",
os: "WINDOWS",
os_version: "7"
}
}
/*eslint-enable camelcase*/
}
}
};