mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 12:33:40 +00:00
casper: Avoid nesting wait statements to avoid flakes.
This test had flaked before. Nesting waitUntilVisible statements is generally discouraged in casper tests.
This commit is contained in:
@@ -124,19 +124,20 @@ casper.then(function create_bot() {
|
||||
});
|
||||
|
||||
var bot_email = '1-bot@zulip.zulipdev.com';
|
||||
var button_sel = '.download_bot_zuliprc[data-email="' + bot_email + '"]';
|
||||
|
||||
casper.then(function () {
|
||||
var button_sel = '.download_bot_zuliprc[data-email="' + bot_email + '"]';
|
||||
|
||||
casper.waitUntilVisible(button_sel, function () {
|
||||
casper.click(button_sel);
|
||||
});
|
||||
});
|
||||
|
||||
casper.waitUntilVisible(button_sel + '[href^="data:application"]', function () {
|
||||
casper.test.assertMatch(
|
||||
decodeURIComponent(casper.getElementsAttribute(button_sel, 'href')),
|
||||
regex_zuliprc,
|
||||
'Looks like a bot ~/.zuliprc file');
|
||||
});
|
||||
casper.then(function () {
|
||||
casper.waitUntilVisible(button_sel + '[href^="data:application"]', function () {
|
||||
casper.test.assertMatch(
|
||||
decodeURIComponent(casper.getElementsAttribute(button_sel, 'href')),
|
||||
regex_zuliprc,
|
||||
'Looks like a bot ~/.zuliprc file');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user