mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +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 bot_email = '1-bot@zulip.zulipdev.com';
|
||||||
|
var button_sel = '.download_bot_zuliprc[data-email="' + bot_email + '"]';
|
||||||
|
|
||||||
casper.then(function () {
|
casper.then(function () {
|
||||||
var button_sel = '.download_bot_zuliprc[data-email="' + bot_email + '"]';
|
|
||||||
|
|
||||||
casper.waitUntilVisible(button_sel, function () {
|
casper.waitUntilVisible(button_sel, function () {
|
||||||
casper.click(button_sel);
|
casper.click(button_sel);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
casper.waitUntilVisible(button_sel + '[href^="data:application"]', function () {
|
casper.then(function () {
|
||||||
casper.test.assertMatch(
|
casper.waitUntilVisible(button_sel + '[href^="data:application"]', function () {
|
||||||
decodeURIComponent(casper.getElementsAttribute(button_sel, 'href')),
|
casper.test.assertMatch(
|
||||||
regex_zuliprc,
|
decodeURIComponent(casper.getElementsAttribute(button_sel, 'href')),
|
||||||
'Looks like a bot ~/.zuliprc file');
|
regex_zuliprc,
|
||||||
});
|
'Looks like a bot ~/.zuliprc file');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user