casper: Fix flakiness with uploading realm icon.

This commit is contained in:
Steve Howell
2017-03-05 11:36:21 -08:00
parent 67219cf660
commit 8c61bb69cc

View File

@@ -205,7 +205,8 @@ casper.then(function () {
// Test uploading realm icon image // Test uploading realm icon image
casper.then(function () { casper.then(function () {
casper.click("li[data-section='organization-settings']"); casper.click("li[data-section='organization-settings']");
casper.test.assertExists('img#realm-settings-icon[src^="https://secure.gravatar.com/avatar/"]'); var selector = 'img#realm-settings-icon[src^="https://secure.gravatar.com/avatar/"]';
casper.waitUntilVisible(selector, function () {
casper.test.assertEqual(casper.visible('#realm_icon_delete_button'), false); casper.test.assertEqual(casper.visible('#realm_icon_delete_button'), false);
casper.fill('form.admin-realm-form', { casper.fill('form.admin-realm-form', {
realm_icon_file_input: 'static/images/logo/zulip-icon-128x128.png', realm_icon_file_input: 'static/images/logo/zulip-icon-128x128.png',
@@ -215,6 +216,7 @@ casper.then(function () {
casper.test.assertEqual(casper.visible('#realm_icon_delete_button'), true); casper.test.assertEqual(casper.visible('#realm_icon_delete_button'), true);
}); });
}); });
});
// Test deleting realm icon image // Test deleting realm icon image
casper.then(function () { casper.then(function () {