diff --git a/debugging/failureConf.js b/debugging/failureConf.js index a4ddf475a..dd48b6199 100644 --- a/debugging/failureConf.js +++ b/debugging/failureConf.js @@ -13,7 +13,8 @@ exports.config = { 'browserName': 'chrome' }, - baseUrl: 'http://localhost:' + (process.env.HTTP_PORT || '8000'), + baseUrl: 'http://' + (process.env.HTTP_HOST || 'localhost') + + ':' + (process.env.HTTP_PORT || '8000'), // ----- Options to be passed to minijasminenode. jasmineNodeOpts: { diff --git a/debugging/timeoutConf.js b/debugging/timeoutConf.js index 40ab1b9dd..ee8b198b3 100644 --- a/debugging/timeoutConf.js +++ b/debugging/timeoutConf.js @@ -14,7 +14,8 @@ exports.config = { 'browserName': 'chrome' }, - baseUrl: 'http://localhost:' + (process.env.HTTP_PORT || '8000'), + baseUrl: 'http://' + (process.env.HTTP_HOST || 'localhost') + + ':' + (process.env.HTTP_PORT || '8000'), // ----- Options to be passed to minijasminenode. jasmineNodeOpts: { diff --git a/docs/browser-setup.md b/docs/browser-setup.md index 9c8def00c..3b883e05d 100644 --- a/docs/browser-setup.md +++ b/docs/browser-setup.md @@ -226,7 +226,8 @@ exports.config = { app: 'safari' }, - baseUrl: 'http://localhost:' + (process.env.HTTP_PORT || '8000') + baseUrl: 'http://' + (process.env.HTTP_HOST || 'localhost') + + ':' + (process.env.HTTP_PORT || '8000') }; ``` @@ -248,7 +249,8 @@ exports.config = { deviceName: 'iPad Simulator' }, - baseUrl: 'http://localhost:' + (process.env.HTTP_PORT || '8000') + baseUrl: 'http://' + (process.env.HTTP_HOST || 'localhost') + + ':' + (process.env.HTTP_PORT || '8000') }; ``` diff --git a/referenceConf.js b/referenceConf.js index ff00250a6..3337b7767 100644 --- a/referenceConf.js +++ b/referenceConf.js @@ -86,7 +86,8 @@ exports.config = { // // A base URL for your application under test. Calls to protractor.get() // with relative paths will be prepended with this. - baseUrl: 'http://localhost:' + (process.env.HTTP_PORT || '8000'), + baseUrl: 'http://' + (process.env.HTTP_HOST || 'localhost') + + ':' + (process.env.HTTP_PORT || '8000'), // Selector for the element housing the angular app - this defaults to // body, but is necessary if ng-app is on a descendant of diff --git a/spec/altRootConf.js b/spec/altRootConf.js index a75e28cc4..f72c8e3dd 100644 --- a/spec/altRootConf.js +++ b/spec/altRootConf.js @@ -14,7 +14,8 @@ exports.config = { // Selector for the element housing the angular app. rootElement: 'div#nested-ng-app', - baseUrl: 'http://localhost:' + (process.env.HTTP_PORT || '8000'), + baseUrl: 'http://' + (process.env.HTTP_HOST || 'localhost') + + ':' + (process.env.HTTP_PORT || '8000'), jasmineNodeOpts: { onComplete: null, diff --git a/spec/basic/actions_spec.js b/spec/basic/actions_spec.js index 64134db4a..27dec35dd 100644 --- a/spec/basic/actions_spec.js +++ b/spec/basic/actions_spec.js @@ -41,32 +41,34 @@ describe('using an ActionSequence', function() { /* it('should navigate back and forward properly', function() { var port = process.env.HTTP_PORT || '8000'; + var host = process.env.HTTP_HOST || 'localhost'; browser.get('index.html#/repeater'); expect(browser.getCurrentUrl()). - toEqual('http://localhost:'+port+'/index.html#/repeater'); + toEqual('http://'+host+':'+port+'/index.html#/repeater'); browser.navigate().back(); expect(browser.getCurrentUrl()). - toEqual('http://localhost:'+port+'/index.html#/form'); + toEqual('http://'+host+':'+port+'/index.html#/form'); browser.navigate().forward(); expect(browser.getCurrentUrl()). - toEqual('http://localhost:'+port+'/index.html#/repeater'); + toEqual('http://'+host+':'+port+'/index.html#/repeater'); }); */ it('should navigate back and forward properly from link', function() { var port = process.env.HTTP_PORT || '8000'; + var host = process.env.HTTP_HOST || 'localhost'; element(by.linkText('repeater')).click(); expect(browser.getCurrentUrl()). - toEqual('http://localhost:'+port+'/index.html#/repeater'); + toEqual('http://'+host+':'+port+'/index.html#/repeater'); browser.navigate().back(); expect(browser.getCurrentUrl()). - toEqual('http://localhost:'+port+'/index.html#/form'); + toEqual('http://'+host+':'+port+'/index.html#/form'); browser.navigate().forward(); expect(browser.getCurrentUrl()). - toEqual('http://localhost:'+port+'/index.html#/repeater'); + toEqual('http://'+host+':'+port+'/index.html#/repeater'); }); }); diff --git a/spec/basic/lib_spec.js b/spec/basic/lib_spec.js index ca8396195..a6f23e3b6 100644 --- a/spec/basic/lib_spec.js +++ b/spec/basic/lib_spec.js @@ -1,5 +1,6 @@ var util = require('util'); var port = process.env.HTTP_PORT || '8000'; +var host = process.env.HTTP_HOST || 'localhost'; describe('no protractor at all', function() { it('should still do normal tests', function() { @@ -32,15 +33,15 @@ describe('protractor library', function() { function() { browser.get('index.html'); expect(browser.getCurrentUrl()). - toEqual('http://localhost:'+port+'/index.html#/form'); + toEqual('http://'+host+':'+port+'/index.html#/form'); browser.driver.findElement(protractor.By.linkText('repeater')).click(); expect(browser.driver.getCurrentUrl()). - toEqual('http://localhost:'+port+'/index.html#/repeater'); + toEqual('http://'+host+':'+port+'/index.html#/repeater'); browser.navigate().back(); expect(browser.driver.getCurrentUrl()). - toEqual('http://localhost:'+port+'/index.html#/form'); + toEqual('http://'+host+':'+port+'/index.html#/form'); }); it('should export other webdriver classes onto the global protractor', @@ -96,11 +97,11 @@ describe('protractor library', function() { it('should get the absolute URL', function() { browser.get('index.html'); expect(browser.getLocationAbsUrl()). - toEqual('http://localhost:'+port+'/index.html#/form'); + toEqual('http://'+host+':'+port+'/index.html#/form'); element(by.linkText('repeater')).click(); expect(browser.getLocationAbsUrl()). - toEqual('http://localhost:'+port+'/index.html#/repeater'); + toEqual('http://'+host+':'+port+'/index.html#/repeater'); }); it('should navigate to another url with setLocation', function() { @@ -109,7 +110,7 @@ describe('protractor library', function() { browser.setLocation('/repeater'); expect(browser.getLocationAbsUrl()). - toEqual('http://localhost:' + port + '/index.html#/repeater'); + toEqual('http://'+host+':' + port + '/index.html#/repeater'); }); }); }); diff --git a/spec/basicConf.js b/spec/basicConf.js index 1e8f2561a..c7f40fb20 100644 --- a/spec/basicConf.js +++ b/spec/basicConf.js @@ -18,7 +18,8 @@ exports.config = { 'browserName': 'chrome' }, - baseUrl: 'http://localhost:' + (process.env.HTTP_PORT || '8000'), + baseUrl: 'http://' + (process.env.HTTP_HOST || 'localhost') + + ':' + (process.env.HTTP_PORT || '8000'), params: { login: { diff --git a/spec/ciConf.js b/spec/ciConf.js index 934ab3ef4..174866b4d 100644 --- a/spec/ciConf.js +++ b/spec/ciConf.js @@ -23,9 +23,16 @@ exports.config = { 'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER, 'build': process.env.TRAVIS_BUILD_NUMBER, 'name': 'Protractor smoke tests' + }, { + 'browserName': 'internet explorer', + 'version': '11', + 'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER, + 'build': process.env.TRAVIS_BUILD_NUMBER, + 'name': 'Protractor smoke tests' }], - baseUrl: 'http://localhost:' + (process.env.HTTP_PORT || '8000'), + baseUrl: 'http://' + (process.env.HTTP_HOST || 'localhost') + + ':' + (process.env.HTTP_PORT || '8000'), params: { login: { diff --git a/spec/cucumberConf.js b/spec/cucumberConf.js index 8bae93372..354c3fab1 100644 --- a/spec/cucumberConf.js +++ b/spec/cucumberConf.js @@ -13,7 +13,8 @@ exports.config = { 'browserName': 'chrome' }, - baseUrl: 'http://localhost:' + (process.env.HTTP_PORT || '8000'), + baseUrl: 'http://' + (process.env.HTTP_HOST || 'localhost') + + ':' + (process.env.HTTP_PORT || '8000'), params: { login: { diff --git a/spec/junitOutputConf.js b/spec/junitOutputConf.js index 3bfb72d07..f8eecb6e2 100644 --- a/spec/junitOutputConf.js +++ b/spec/junitOutputConf.js @@ -30,5 +30,6 @@ exports.config = { } }, - baseUrl: 'http://localhost:' + (process.env.HTTP_PORT || '8000'), + baseUrl: 'http://' + (process.env.HTTP_HOST || 'localhost') + + ':' + (process.env.HTTP_PORT || '8000'), }; diff --git a/spec/login/login_spec.js b/spec/login/login_spec.js index c01b1c75c..0e66d5385 100644 --- a/spec/login/login_spec.js +++ b/spec/login/login_spec.js @@ -1,6 +1,8 @@ describe('pages with login', function() { it('should log in with a non-Angular page', function() { - browser.get('http://localhost:8000/index.html'); + var port = process.env.HTTP_PORT || '8000'; + var host = process.env.HTTP_HOST || 'localhost'; + browser.get('http://'+host+':'+port+'/index.html'); var angularElement = element(by.model('username')); expect(angularElement.getAttribute('value')).toEqual('Anon'); diff --git a/spec/mochaConf.js b/spec/mochaConf.js index e19fca294..0adc5b4c2 100644 --- a/spec/mochaConf.js +++ b/spec/mochaConf.js @@ -13,7 +13,8 @@ exports.config = { 'browserName': 'chrome' }, - baseUrl: 'http://localhost:' + (process.env.HTTP_PORT || '8000'), + baseUrl: 'http://' + (process.env.HTTP_HOST || 'localhost') + + ':' + (process.env.HTTP_PORT || '8000'), params: { login: { diff --git a/spec/multiConf.js b/spec/multiConf.js index 5fdfbc9f9..d449a7650 100644 --- a/spec/multiConf.js +++ b/spec/multiConf.js @@ -20,7 +20,8 @@ exports.config = { 'browserName': 'firefox' }], - baseUrl: 'http://localhost:' + (process.env.HTTP_PORT || '8000'), + baseUrl: 'http://' + (process.env.HTTP_HOST || 'localhost') + + ':' + (process.env.HTTP_PORT || '8000'), params: { login: { diff --git a/spec/onPrepareConf.js b/spec/onPrepareConf.js index ad621180d..ac0b49041 100644 --- a/spec/onPrepareConf.js +++ b/spec/onPrepareConf.js @@ -11,7 +11,8 @@ exports.config = { 'browserName': 'chrome' }, - baseUrl: 'http://localhost:' + (process.env.HTTP_PORT || '8000'), + baseUrl: 'http://' + (process.env.HTTP_HOST || 'localhost') + + ':' + (process.env.HTTP_PORT || '8000'), onPrepare: function() { browser.params.password = '12345'; diff --git a/spec/onPrepareStringConf.js b/spec/onPrepareStringConf.js index ee1d4a2e2..47d761a23 100644 --- a/spec/onPrepareStringConf.js +++ b/spec/onPrepareStringConf.js @@ -12,7 +12,8 @@ exports.config = { 'browserName': 'chrome' }, - baseUrl: 'http://localhost:' + (process.env.HTTP_PORT || '8000'), + baseUrl: 'http://' + (process.env.HTTP_HOST || 'localhost') + + ':' + (process.env.HTTP_PORT || '8000'), onPrepare: 'onPrepare/startup.js' }; diff --git a/spec/suitesConf.js b/spec/suitesConf.js index 32820713c..9202ce3d3 100644 --- a/spec/suitesConf.js +++ b/spec/suitesConf.js @@ -20,7 +20,8 @@ exports.config = { 'browserName': 'chrome' }, - baseUrl: 'http://localhost:8000', + baseUrl: 'http://' + (process.env.HTTP_HOST || 'localhost') + + ':' + (process.env.HTTP_PORT || '8000'), params: { login: { diff --git a/spec/withLoginConf.js b/spec/withLoginConf.js index 5957fc0e9..019c61d65 100644 --- a/spec/withLoginConf.js +++ b/spec/withLoginConf.js @@ -1,7 +1,8 @@ // This is the configuration file showing how a suite of tests might // handle log-in using the onPrepare field. -var port = + (process.env.HTTP_PORT || '8000'), - baseUrl = 'http://localhost:8000'; +var port = + (process.env.HTTP_PORT || '8000'); +var host = process.env.HTTP_HOST || 'localhost'; +var baseUrl = 'http://' + host + ':' + port; exports.config = { seleniumAddress: 'http://localhost:4444/wd/hub',