mirror of https://github.com/zulip/zulip.git
Replace localhost with 127.0.0.1 in casper tests.
This commit is contained in:
parent
e515484c41
commit
97e0306795
|
@ -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);
|
||||
});
|
||||
|
|
|
@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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.");
|
||||
|
|
|
@ -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');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue