casper: Use zulipdev.com rather than localhost consistently.

This fixes a problem where any absolute redirects in the routes
visited by the Casper tests will cause failures due to switching the
users to a "different" server where the cookies they'd received are no
longer valid.

Now, we at least consistently use the same hostname in the Casper
tests as EXTERNAL_HOST.
This commit is contained in:
Tim Abbott 2016-10-06 15:19:19 -07:00
parent 3494fa0635
commit d5f28abac7
5 changed files with 6 additions and 9 deletions

View File

@ -90,7 +90,7 @@ exports.start_and_log_in = function (credentials, viewport) {
if (REALMS_HAVE_SUBDOMAINS) {
log_in_url = "http://zulip.zulipdev.com:9981/accounts/login";
} else {
log_in_url = "http://localhost:9981/accounts/login";
log_in_url = "http://zulipdev.com:9981/accounts/login";
}
exports.init_viewport();
casper.start(log_in_url, function () {

View File

@ -12,7 +12,7 @@ if (REALMS_HAVE_SUBDOMAINS) {
host = 'zulipdev.com:9981';
realm_host = subdomain + '.' + host;
} else {
host = realm_host = 'localhost:9981';
host = realm_host = 'zulipdev.com:9981';
}
casper.start('http://' + host + '/create_realm/');

View File

@ -178,7 +178,7 @@ var settings_url = "";
if (REALMS_HAVE_SUBDOMAINS) {
settings_url = 'http://zulip.zulipdev.com:9981/de/#settings';
} else {
settings_url = 'http://localhost:9981/de/#settings';
settings_url = 'http://zulipdev.com:9981/de/#settings';
}
casper.thenOpen(settings_url);

View File

@ -151,7 +151,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://zulipdev.com:9991/static/images/integrations/logos/jenkins.png'
});
casper.click('form.admin-emoji-form input.button');
});
@ -166,7 +166,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://zulipdev.com:9991/static/images/integrations/logos/jenkins.png"]');
casper.click('.emoji_row button.delete');
});
});

View File

@ -132,13 +132,10 @@ Oops, the frontend tests failed. Tips for debugging:
sys.exit(ret)
os.environ["EXTERNAL_HOST"] = "zulipdev.com:9981"
# First, run all tests with REALMS_HAVE_SUBDOMAINS set to False
run_tests(False, args)
# Now run a subset of the tests with REALMS_HAVE_SUBDOMAINS set to True
os.environ["EXTERNAL_HOST"] = "zulipdev.com:9981"
os.environ["REALMS_HAVE_SUBDOMAINS"] = "True"
if len(args) == 0:
run_tests(True, ["00-realm-creation.js", "01-login.js", "02-site.js"])