speed up the waitForToastMessageGone helper

This commit is contained in:
Joe Fleming 2015-11-24 11:08:19 -06:00
parent cfd8deac32
commit d8d8886747

View file

@ -111,14 +111,15 @@ define(function (require) {
waitForToastMessageGone: function waitForToastMessageGone() {
var self = this;
return common.tryForTime(defaultTimeout * 2, function () {
return self.remote.setFindTimeout(1000)
.findAllByCssSelector('kbn-truncated.toast-message.ng-isolate-scope')
return common.tryForTime(defaultTimeout, function () {
return self.remote.setFindTimeout(500)
.findAllByCssSelector('kbn-truncated.toast-message')
.then(function toastMessage(messages) {
if (messages.length > 0) {
common.debug('toast message found, waiting...');
throw new Error('waiting for toast message to clear');
} else {
common.debug('now messages = 0 "' + messages + '"');
common.debug('toast message clear');
return messages;
}
});