Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit 15a1872

Browse files
authored
fix(firefox): Fix directConnect for Firefox 51+ (#3953)
1 parent 879aac6 commit 15a1872

File tree

5 files changed

+30
-19
lines changed

5 files changed

+30
-19
lines changed

circle.yml

+9-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,18 @@ dependencies:
1414
post:
1515
- ./node_modules/.bin/gulp lint
1616
- ./node_modules/.bin/webdriver-manager update
17-
- ./node_modules/.bin/webdriver-manager start:
18-
background: true
17+
- wget http://selenium-release.storage.googleapis.com/3.0-beta4/selenium-server-standalone-3.0.0-beta4.jar -P ./node_modules/webdriver-manager/selenium
18+
- ./node_modules/.bin/webdriver-manager start --versions.standalone 3.0.0-beta4:
19+
background: true
1920
- cd testapp && npm update
2021
- npm start:
2122
background: true
23+
# Install the latest Firefox beta
24+
- pip install mozdownload mozinstall
25+
- mozdownload --version latest-beta --destination firefox.tar.bz2
26+
- mozinstall firefox.tar.bz2
27+
- sudo cp -R firefox/* /opt/firefox/
28+
# Extra tcp logging for BlockingProxy
2229
- sudo tcpdump -i lo 'tcp && dst localhost' -w $CIRCLE_ARTIFACTS/localdump.pcap:
2330
background: true
2431

lib/driverProviders/direct.ts

+18-6
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,26 @@ export class Direct extends DriverProvider {
9090
.Driver.createSession(new Capabilities(this.config_.capabilities), chromeService);
9191
break;
9292
case 'firefox':
93-
if (this.config_.firefoxPath) {
94-
this.config_.capabilities['firefox_binary'] = this.config_.firefoxPath;
93+
let geckoDriverFile: string;
94+
try {
95+
let updateJson = path.resolve(SeleniumConfig.getSeleniumDir(), 'update-config.json');
96+
let updateConfig = JSON.parse(fs.readFileSync(updateJson).toString());
97+
geckoDriverFile = updateConfig.gecko.last;
98+
} catch (e) {
99+
throw new BrowserError(
100+
logger,
101+
'Could not find update-config.json. ' +
102+
'Run \'webdriver-manager update\' to download binaries.');
95103
}
96104

97-
// TODO(cnishina): Add in a service builder with marionette. Direct connect
98-
// currently supports FF legacy version 47.
99-
driver = require('selenium-webdriver/firefox')
100-
.Driver.createSession(new Capabilities(this.config_.capabilities));
105+
// TODO (mgiambalvo): Turn this into an import when the selenium typings are updated.
106+
const FirefoxServiceBuilder = require('selenium-webdriver/firefox').ServiceBuilder;
107+
108+
let firefoxService = new FirefoxServiceBuilder(geckoDriverFile).build();
109+
// TODO(mgiambalvo): Fix typings.
110+
driver =
111+
require('selenium-webdriver/firefox')
112+
.Driver.createSession(new Capabilities(this.config_.capabilities), firefoxService);
101113
break;
102114
default:
103115
throw new BrowserError(

spec/ciFullConf.js

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ exports.config = {
3232
'build': process.env.TRAVIS_BUILD_NUMBER,
3333
'name': 'Protractor suite tests',
3434
'version': '47',
35-
'selenium-version': '2.53.1'
3635
}],
3736

3837
baseUrl: env.baseUrl + '/ng1/',

spec/ciSmokeConf.js

+3-9
Original file line numberDiff line numberDiff line change
@@ -23,41 +23,35 @@ exports.config = {
2323
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
2424
'build': process.env.TRAVIS_BUILD_NUMBER,
2525
'name': 'Protractor smoke tests',
26-
'version': '54',
27-
'selenium-version': '2.53.1',
28-
'chromedriver-version': '2.26',
26+
'version': '55',
27+
'chromedriver-version': '2.27',
2928
'platform': 'OS X 10.11'
3029
}, {
3130
'browserName': 'firefox',
3231
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
3332
'build': process.env.TRAVIS_BUILD_NUMBER,
3433
'name': 'Protractor smoke tests',
35-
'version': '47',
36-
'selenium-version': '2.53.1'
34+
'version': 'beta'
3735
}, {
3836
// TODO: Add Safari 10 once Saucelabs gets Selenium 3
3937
'browserName': 'safari',
4038
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
4139
'build': process.env.TRAVIS_BUILD_NUMBER,
4240
'name': 'Protractor smoke tests',
4341
'version': '9',
44-
'selenium-version': '2.44.0' // Use an old version because Safari has
45-
// issues loading pages after 2.44.
4642
}, {
4743
'browserName': 'MicrosoftEdge',
4844
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
4945
'build': process.env.TRAVIS_BUILD_NUMBER,
5046
'name': 'Protractor smoke tests',
5147
'version': '14.14393',
52-
'selenium-version': '2.53.1',
5348
'platform': 'Windows 10'
5449
}, {
5550
'browserName': 'Internet Explorer',
5651
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
5752
'build': process.env.TRAVIS_BUILD_NUMBER,
5853
'name': 'Protractor smoke tests',
5954
'version': '11',
60-
'selenium-version': '2.53.1',
6155
'platform': 'Windows 8.1'
6256
}],
6357

spec/directConnectConf.js

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ exports.config = {
99
'browserName': 'chrome'
1010
}, {
1111
'browserName': 'firefox',
12-
'marionette': false
1312
}],
1413

1514
baseUrl: env.baseUrl + '/ng1/',

0 commit comments

Comments
 (0)