From ea0a5de33b89e1b17d35be1ddc7fbf84ab94eedd Mon Sep 17 00:00:00 2001 From: Michael Giambalvo Date: Tue, 10 Jan 2017 16:55:43 -0800 Subject: [PATCH 1/6] fix(firefox): Fix directConnect for Firefox 51+ --- lib/driverProviders/direct.ts | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/lib/driverProviders/direct.ts b/lib/driverProviders/direct.ts index eb7bf075a..ad8bf4254 100644 --- a/lib/driverProviders/direct.ts +++ b/lib/driverProviders/direct.ts @@ -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( From d9b179dd5346323b78ccb4fe799a420d1b4271dd Mon Sep 17 00:00:00 2001 From: Michael Giambalvo Date: Tue, 10 Jan 2017 16:56:14 -0800 Subject: [PATCH 2/6] Try running Travis on firefox beta. --- spec/ciFullConf.js | 3 +-- spec/ciSmokeConf.js | 3 +-- spec/directConnectConf.js | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/spec/ciFullConf.js b/spec/ciFullConf.js index 58e7b433d..5c509dcff 100644 --- a/spec/ciFullConf.js +++ b/spec/ciFullConf.js @@ -31,8 +31,7 @@ exports.config = { 'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER, 'build': process.env.TRAVIS_BUILD_NUMBER, 'name': 'Protractor suite tests', - 'version': '47', - 'selenium-version': '2.53.1' + 'version': 'beta', }], baseUrl: env.baseUrl + '/ng1/', diff --git a/spec/ciSmokeConf.js b/spec/ciSmokeConf.js index bdabdd295..f9a44be22 100644 --- a/spec/ciSmokeConf.js +++ b/spec/ciSmokeConf.js @@ -32,8 +32,7 @@ exports.config = { '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', diff --git a/spec/directConnectConf.js b/spec/directConnectConf.js index a63205475..a667f4167 100644 --- a/spec/directConnectConf.js +++ b/spec/directConnectConf.js @@ -9,7 +9,6 @@ exports.config = { 'browserName': 'chrome' }, { 'browserName': 'firefox', - 'marionette': false }], baseUrl: env.baseUrl + '/ng1/', From 1e13e9e1f2368bda52223d1949f3592a384c3314 Mon Sep 17 00:00:00 2001 From: Michael Giambalvo Date: Tue, 10 Jan 2017 17:41:10 -0800 Subject: [PATCH 3/6] Put the full test back on Firefox #47 --- spec/ciFullConf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/ciFullConf.js b/spec/ciFullConf.js index 5c509dcff..38ec8a2d6 100644 --- a/spec/ciFullConf.js +++ b/spec/ciFullConf.js @@ -31,7 +31,7 @@ exports.config = { 'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER, 'build': process.env.TRAVIS_BUILD_NUMBER, 'name': 'Protractor suite tests', - 'version': 'beta', + 'version': '47', }], baseUrl: env.baseUrl + '/ng1/', From ece6587d64335d7ee0a75bc85f4fbfbc5a74feff Mon Sep 17 00:00:00 2001 From: Michael Giambalvo Date: Wed, 11 Jan 2017 10:57:59 -0800 Subject: [PATCH 4/6] Try letting saucelabs work out the selenium version. --- spec/ciSmokeConf.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/spec/ciSmokeConf.js b/spec/ciSmokeConf.js index f9a44be22..b49ff61eb 100644 --- a/spec/ciSmokeConf.js +++ b/spec/ciSmokeConf.js @@ -23,9 +23,8 @@ 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', @@ -40,15 +39,12 @@ exports.config = { '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', @@ -56,7 +52,6 @@ exports.config = { 'build': process.env.TRAVIS_BUILD_NUMBER, 'name': 'Protractor smoke tests', 'version': '11', - 'selenium-version': '2.53.1', 'platform': 'Windows 8.1' }], From 4774745c289e6f830bddca9f9343b89281414e78 Mon Sep 17 00:00:00 2001 From: Michael Giambalvo Date: Wed, 11 Jan 2017 11:38:13 -0800 Subject: [PATCH 5/6] Try getting the firefox beta on Circle. --- circle.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/circle.yml b/circle.yml index ac8837645..96115f078 100644 --- a/circle.yml +++ b/circle.yml @@ -19,6 +19,12 @@ dependencies: - 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 From eff8a60ba517180dc6dfa462298911aaf9394ef2 Mon Sep 17 00:00:00 2001 From: Michael Giambalvo Date: Wed, 18 Jan 2017 12:14:38 -0800 Subject: [PATCH 6/6] Use selenium beta4 so firefox works. --- circle.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/circle.yml b/circle.yml index 96115f078..49977f994 100644 --- a/circle.yml +++ b/circle.yml @@ -14,8 +14,9 @@ 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 + - ./node_modules/.bin/webdriver-manager start --versions.standalone 3.0.0-beta4: + background: true - cd testapp && npm update - npm start: background: true