mirror of https://github.com/zulip/zulip.git
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:
parent
3494fa0635
commit
d5f28abac7
|
@ -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 () {
|
||||
|
|
|
@ -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/');
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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"])
|
||||
|
|
Loading…
Reference in New Issue