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

fix(firefox): Fix directConnect for Firefox 51+ #3953

Merged
merged 6 commits into from
Jan 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,18 @@ dependencies:
post:
- ./node_modules/.bin/gulp lint
- ./node_modules/.bin/webdriver-manager update
- ./node_modules/.bin/webdriver-manager start:
background: true
- wget http://selenium-release.storage.googleapis.com/3.0-beta4/selenium-server-standalone-3.0.0-beta4.jar -P ./node_modules/webdriver-manager/selenium
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: Can't use 3.0.0 or 3.0.1, as these both have a bug that breaks firefox.

- ./node_modules/.bin/webdriver-manager start --versions.standalone 3.0.0-beta4:
background: true
- cd testapp && npm update
- npm start:
background: true
# Install the latest Firefox beta
- pip install mozdownload mozinstall
- mozdownload --version latest-beta --destination firefox.tar.bz2
- mozinstall firefox.tar.bz2
- sudo cp -R firefox/* /opt/firefox/
# Extra tcp logging for BlockingProxy
- sudo tcpdump -i lo 'tcp && dst localhost' -w $CIRCLE_ARTIFACTS/localdump.pcap:
background: true

Expand Down
24 changes: 18 additions & 6 deletions lib/driverProviders/direct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,26 @@ export class Direct extends DriverProvider {
.Driver.createSession(new Capabilities(this.config_.capabilities), chromeService);
break;
case 'firefox':
if (this.config_.firefoxPath) {
this.config_.capabilities['firefox_binary'] = this.config_.firefoxPath;
let geckoDriverFile: string;
try {
let updateJson = path.resolve(SeleniumConfig.getSeleniumDir(), 'update-config.json');
let updateConfig = JSON.parse(fs.readFileSync(updateJson).toString());
geckoDriverFile = updateConfig.gecko.last;
} catch (e) {
throw new BrowserError(
logger,
'Could not find update-config.json. ' +
'Run \'webdriver-manager update\' to download binaries.');
}

// TODO(cnishina): Add in a service builder with marionette. Direct connect
// currently supports FF legacy version 47.
driver = require('selenium-webdriver/firefox')
.Driver.createSession(new Capabilities(this.config_.capabilities));
// TODO (mgiambalvo): Turn this into an import when the selenium typings are updated.
const FirefoxServiceBuilder = require('selenium-webdriver/firefox').ServiceBuilder;

let firefoxService = new FirefoxServiceBuilder(geckoDriverFile).build();
// TODO(mgiambalvo): Fix typings.
driver =
require('selenium-webdriver/firefox')
.Driver.createSession(new Capabilities(this.config_.capabilities), firefoxService);
break;
default:
throw new BrowserError(
Expand Down
1 change: 0 additions & 1 deletion spec/ciFullConf.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ exports.config = {
'build': process.env.TRAVIS_BUILD_NUMBER,
'name': 'Protractor suite tests',
'version': '47',
'selenium-version': '2.53.1'
}],

baseUrl: env.baseUrl + '/ng1/',
Expand Down
12 changes: 3 additions & 9 deletions spec/ciSmokeConf.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,41 +23,35 @@ exports.config = {
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
'build': process.env.TRAVIS_BUILD_NUMBER,
'name': 'Protractor smoke tests',
'version': '54',
'selenium-version': '2.53.1',
'chromedriver-version': '2.26',
'version': '55',
'chromedriver-version': '2.27',
'platform': 'OS X 10.11'
}, {
'browserName': 'firefox',
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
'build': process.env.TRAVIS_BUILD_NUMBER,
'name': 'Protractor smoke tests',
'version': '47',
'selenium-version': '2.53.1'
'version': 'beta'
}, {
// TODO: Add Safari 10 once Saucelabs gets Selenium 3
'browserName': 'safari',
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
'build': process.env.TRAVIS_BUILD_NUMBER,
'name': 'Protractor smoke tests',
'version': '9',
'selenium-version': '2.44.0' // Use an old version because Safari has
// issues loading pages after 2.44.
}, {
'browserName': 'MicrosoftEdge',
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
'build': process.env.TRAVIS_BUILD_NUMBER,
'name': 'Protractor smoke tests',
'version': '14.14393',
'selenium-version': '2.53.1',
'platform': 'Windows 10'
}, {
'browserName': 'Internet Explorer',
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
'build': process.env.TRAVIS_BUILD_NUMBER,
'name': 'Protractor smoke tests',
'version': '11',
'selenium-version': '2.53.1',
'platform': 'Windows 8.1'
}],

Expand Down
1 change: 0 additions & 1 deletion spec/directConnectConf.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ exports.config = {
'browserName': 'chrome'
}, {
'browserName': 'firefox',
'marionette': false
}],

baseUrl: env.baseUrl + '/ng1/',
Expand Down