diff --git a/frontend_tests/casper_lib/common.js b/frontend_tests/casper_lib/common.js index 39d4d862da..6af762363c 100644 --- a/frontend_tests/casper_lib/common.js +++ b/frontend_tests/casper_lib/common.js @@ -83,7 +83,7 @@ exports.then_log_in = function (credentials) { }; exports.start_and_log_in = function (credentials, viewport) { - casper.start('http://localhost:9981/accounts/login', function () { + casper.start('http://127.0.0.1:9981/accounts/login', function () { exports.initialize_casper(viewport); log_in(credentials); }); diff --git a/frontend_tests/casper_tests/00-realm-creation.js b/frontend_tests/casper_tests/00-realm-creation.js index 691785f14e..3058ee107e 100644 --- a/frontend_tests/casper_tests/00-realm-creation.js +++ b/frontend_tests/casper_tests/00-realm-creation.js @@ -4,7 +4,7 @@ var email = 'alice@test.example.com'; var domain = 'test.example.com'; var organization_name = 'Awesome Organization'; -casper.start('http://localhost:9981/create_realm/'); +casper.start('http://127.0.0.1:9981/create_realm/'); casper.then(function () { // Submit the email for realm creation @@ -21,12 +21,12 @@ casper.then(function () { }); // Special endpoint enabled only during tests for extracting confirmation key -casper.thenOpen('http://localhost:9981/confirmation_key/'); +casper.thenOpen('http://127.0.0.1:9981/confirmation_key/'); // Open the confirmation URL casper.then(function () { var confirmation_key = JSON.parse(this.getPageContent()).confirmation_key; - var confirmation_url = 'http://localhost:9981/accounts/do_confirm/' + confirmation_key; + var confirmation_url = 'http://127.0.0.1:9981/accounts/do_confirm/' + confirmation_key; this.thenOpen(confirmation_url); }); @@ -56,7 +56,7 @@ casper.then(function () { }); this.waitWhileSelector('form[action^="/accounts/register/"]', function () { - casper.test.assertUrlMatch('http://localhost:9981/invite/', 'Invite more users page loaded'); + casper.test.assertUrlMatch('http://127.0.0.1:9981/invite/', 'Invite more users page loaded'); }); }); @@ -75,7 +75,7 @@ casper.then(function () { }); this.waitWhileSelector('#submit_invitation', function () { - this.test.assertUrlMatch('http://localhost:9981/', 'Realm created and logged in'); + this.test.assertUrlMatch('http://127.0.0.1:9981/', 'Realm created and logged in'); }); }); diff --git a/frontend_tests/casper_tests/01-login.js b/frontend_tests/casper_tests/01-login.js index c085c5a310..b0a3489469 100644 --- a/frontend_tests/casper_tests/01-login.js +++ b/frontend_tests/casper_tests/01-login.js @@ -1,7 +1,7 @@ var common = require('../casper_lib/common.js').common; // Start of test script. -casper.start('http://localhost:9981/', common.initialize_casper); +casper.start('http://127.0.0.1:9981/', common.initialize_casper); casper.then(function () { casper.test.assertHttpStatus(302); diff --git a/frontend_tests/casper_tests/06-settings.js b/frontend_tests/casper_tests/06-settings.js index aea1520d89..cac6dfe2fc 100644 --- a/frontend_tests/casper_tests/06-settings.js +++ b/frontend_tests/casper_tests/06-settings.js @@ -162,7 +162,7 @@ casper.waitForSelector("#default_language", function () { casper.test.info("Opening German page through i18n url."); }); -casper.thenOpen('http://localhost:9981/de/#settings'); +casper.thenOpen('http://127.0.0.1:9981/de/#settings'); casper.waitForSelector("#settings-change-box", function check_url_preference() { casper.test.info("Checking the i18n url language precedence."); diff --git a/frontend_tests/casper_tests/10-admin.js b/frontend_tests/casper_tests/10-admin.js index 67157c07fa..e632853a7b 100644 --- a/frontend_tests/casper_tests/10-admin.js +++ b/frontend_tests/casper_tests/10-admin.js @@ -144,7 +144,7 @@ casper.then(function () { casper.waitForSelector('.admin-emoji-form', function () { casper.fill('form.admin-emoji-form', { 'name': 'MouseFace', - 'url': 'http://localhost:9991/static/images/integrations/logos/jenkins.png' + 'url': 'http://127.0.0.1:9991/static/images/integrations/logos/jenkins.png' }); casper.click('form.admin-emoji-form input.btn'); }); @@ -159,7 +159,7 @@ casper.then(function () { casper.then(function () { casper.waitForSelector('.emoji_row', function () { casper.test.assertSelectorHasText('.emoji_row .emoji_name', 'MouseFace'); - casper.test.assertExists('.emoji_row img[src="http://localhost:9991/static/images/integrations/logos/jenkins.png"]'); + casper.test.assertExists('.emoji_row img[src="http://127.0.0.1:9991/static/images/integrations/logos/jenkins.png"]'); casper.click('.emoji_row button.delete'); }); }); diff --git a/frontend_tests/run-casper b/frontend_tests/run-casper index fc51fda311..0a2605a83c 100755 --- a/frontend_tests/run-casper +++ b/frontend_tests/run-casper @@ -25,7 +25,7 @@ except ImportError as e: # on how to use remote debugging # -os.environ["TORNADO_SERVER"] = "http://localhost:9983" +os.environ["TORNADO_SERVER"] = "http://127.0.0.1:9983" usage = """%prog [options] test-js-with-casper # Run all test files @@ -60,7 +60,7 @@ def server_is_up(server): assert_server_running(server) try: # We could get a 501 error if the reverse proxy is up but the Django app isn't. - return requests.get('http://localhost:9981/accounts/home').status_code == 200 + return requests.get('http://127.0.0.1:9981/accounts/home').status_code == 200 except: return False