Skip to content

Commit bc4021e

Browse files
Drew Diamantoukosjucrouzet
Drew Diamantoukos
authored andcommitted
Adding Yarn, updating dependencies, using 3.0.1 selenium by default (#259)
* Updated dependency versions with yarn. Added yarn lockfile. Using 3.0.1 selenium. Updated docs to reference newer drivers. * Using java 8 * Switched travis job to be java to get 1.8 * Using travis install and script to drive tests * Added documentation and error message to inform user of minimum java version * Removing section seperators from README * Fixed typo * Feature/touchup travis (#3) * Merged latest master * Using node version matrix * Using shorter travis matrix * Using env matrix for travis node version
1 parent 53051d5 commit bc4021e

File tree

6 files changed

+712
-33
lines changed

6 files changed

+712
-33
lines changed

.travis.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
sudo: false
22

3-
language: node_js
4-
node_js:
5-
- stable
6-
- 6
7-
- 5
8-
- 4
9-
- 0.12
3+
language: java
104

5+
jdk:
6+
- oraclejdk8
7+
8+
env:
9+
- TRAVIS_NODE_VERSION="stable"
10+
- TRAVIS_NODE_VERSION=5
11+
- TRAVIS_NODE_VERSION=4
12+
- TRAVIS_NODE_VERSION=0.12
13+
14+
before_install:
15+
- nvm install $TRAVIS_NODE_VERSION
16+
17+
install: "npm install"
18+
19+
script: "npm test"

README.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Config file can be a JSON file or a [module file](https://nodejs.org/api/modules
5353
module.exports = {
5454
drivers: {
5555
chrome: {
56-
version: '2.23',
56+
version: '2.27',
5757
arch: process.arch,
5858
baseURL: 'https://chromedriver.storage.googleapis.com'
5959
},
@@ -64,6 +64,7 @@ module.exports = {
6464
## Application Programming Interface (API)
6565

6666
### Sample configuration object
67+
6768
Here you can find an up-to-date example of the configuration object:
6869
[lib/default-config.js](lib/default-config.js)
6970

@@ -75,20 +76,20 @@ var selenium = require('selenium-standalone');
7576
selenium.install({
7677
// check for more recent versions of selenium here:
7778
// https://selenium-release.storage.googleapis.com/index.html
78-
version: '2.53.1',
79+
version: '3.0.1',
7980
baseURL: 'https://selenium-release.storage.googleapis.com',
8081
drivers: {
8182
chrome: {
8283
// check for more recent versions of chrome driver here:
8384
// https://chromedriver.storage.googleapis.com/index.html
84-
version: '2.23',
85+
version: '2.27',
8586
arch: process.arch,
8687
baseURL: 'https://chromedriver.storage.googleapis.com'
8788
},
8889
ie: {
8990
// check for more recent versions of internet explorer driver here:
9091
// https://selenium-release.storage.googleapis.com/index.html
91-
version: '2.53.1',
92+
version: '3.0.1',
9293
arch: process.arch,
9394
baseURL: 'https://selenium-release.storage.googleapis.com'
9495
}
@@ -114,12 +115,12 @@ Here are the current defaults:
114115
```js
115116
{
116117
chrome: {
117-
version: '2.23',
118+
version: '2.27',
118119
arch: process.arch,
119120
baseURL: 'https://chromedriver.storage.googleapis.com'
120121
},
121122
ie: {
122-
version: '2.53.1',
123+
version: '3.0.1',
123124
arch: process.arch,
124125
baseURL: 'https://selenium-release.storage.googleapis.com'
125126
}
@@ -185,8 +186,22 @@ After installing selenium-standalone globally, execute the following commands to
185186
ln -s /usr/local/bin/selenium-standalone /etc/init.d/
186187
update-rc.d selenium-standalone defaults
187188
```
189+
188190
For more information: https://stackoverflow.com/questions/3666794/selenium-server-on-startup/30392437#30392437
189191

192+
### Ensure you have the minimum required Java version
193+
194+
With the release of Selenium 3+, the minimum required version of Java is 8, as [7 has ceased public updates](https://java.com/en/download/faq/java_7.xml).
195+
196+
If an older selenium version is needed, you can check the requirements on the [official Selenium changelog](https://raw.githubusercontent.com/SeleniumHQ/selenium/master/java/CHANGELOG).
197+
198+
Here is a reference sheet for the more recent Selenium version:
199+
200+
| Selenium version | Minimum Java Required |
201+
| --- | --- |
202+
| 3.0.0+ | Java 8 |
203+
| 2.47.0+ | Java 7 |
204+
| 2.22.0+ | Java 6 |
190205

191206
### Running headlessly
192207

lib/default-config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
module.exports = {
22
baseURL: 'https://selenium-release.storage.googleapis.com',
3-
version: '2.53.1',
3+
version: '3.0.1',
44
drivers: {
55
chrome: {
66
version: '2.27',
77
arch: process.arch,
88
baseURL: 'https://chromedriver.storage.googleapis.com'
99
},
1010
ie: {
11-
version: '2.53.1',
11+
version: '3.0.1',
1212
arch: process.arch,
1313
baseURL: 'https://selenium-release.storage.googleapis.com'
1414
},

lib/start.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function start(opts, cb) {
1818
cb = opts;
1919
opts = {};
2020
}
21-
21+
2222
if (!opts.javaArgs) {
2323
opts.javaArgs = [];
2424
}
@@ -66,12 +66,12 @@ function start(opts, cb) {
6666
3) Selenium specific arguments
6767
6868
Example:
69-
java -Dwebdriver.chrome.driver=./.selenium/chromedriver/2.22-x64-chromedriver \
70-
-jar ./.selenium/selenium-server/2.53.1-server.jar \
69+
java -Dwebdriver.chrome.driver=./.selenium/chromedriver/2.27-x64-chromedriver \
70+
-jar ./.selenium/selenium-server/3.0.1-server.jar \
7171
-role hub
7272
*/
7373
var args = [];
74-
74+
7575
if (fsPaths.chrome) {
7676
args.push('-Dwebdriver.chrome.driver=' + fsPaths.chrome.installPath);
7777
}
@@ -85,7 +85,7 @@ function start(opts, cb) {
8585
if (fsPaths.firefox) {
8686
args.push('-Dwebdriver.gecko.driver=' + fsPaths.firefox.installPath);
8787
}
88-
88+
8989
args = args.concat(opts.javaArgs);
9090

9191
args = args.concat(['-jar', fsPaths.selenium.installPath]);
@@ -133,18 +133,21 @@ function start(opts, cb) {
133133
});
134134

135135
function errorIfNeverStarted(code) {
136-
var err;
137-
138136
neverStarted = true;
139137

138+
var errorMsg;
140139
if (code === 1) {
141-
err = new Error('Selenium server did not start.' +
142-
'Another Selenium process may already be running or your java version may be out of date.')
140+
errorMsg = 'Selenium server did not start.\n';
143141
} else {
144-
err = new Error('Selenium exited before it could start')
142+
errorMsg = 'Selenium exited before it could start\n';
145143
}
144+
errorMsg += 'Another Selenium process may already be running or your java version may be out of date.\n';
146145

147-
cb(err);
146+
// TODO: Is there a way to get this info from the api?
147+
// 3.x requires Java 8+, 2.47.0+ requires Java 7 - 7 is also end-of-life apparently ?
148+
errorMsg += 'Be sure to check the official Selenium release notes for minimum required java version: https://raw.githubusercontent.com/SeleniumHQ/selenium/master/java/CHANGELOG\n';
149+
150+
cb(new Error(errorMsg));
148151
}
149152
});
150153
}

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@
2121
"author": "Vincent Voyer <[email protected]>",
2222
"license": "MIT",
2323
"dependencies": {
24-
"async": "1.2.1",
25-
"commander": "2.6.0",
26-
"lodash": "3.9.3",
27-
"minimist": "1.1.0",
28-
"mkdirp": "0.5.0",
24+
"async": "^2.1.4",
25+
"commander": "^2.9.0",
26+
"lodash": "^4.17.4",
27+
"minimist": "^1.2.0",
28+
"mkdirp": "^0.5.1",
2929
"progress": "1.1.8",
3030
"request": "2.79.0",
3131
"tar-stream": "1.5.2",
32-
"urijs": "1.16.1",
33-
"which": "1.1.1",
32+
"urijs": "^1.18.4",
33+
"which": "^1.2.12",
3434
"yauzl": "^2.5.0"
3535
},
3636
"devDependencies": {

0 commit comments

Comments
 (0)