wrap getFieldsTabCount in tryForTime

give it a chance to fail up to 10 times before failing completely
This commit is contained in:
Joe Fleming 2015-11-24 11:38:28 -07:00
parent 4fdbc265c8
commit 43a5e2b838

View file

@ -126,11 +126,13 @@ define(function (require) {
var self = this;
var selector = 'li.kbn-settings-tab.active a small';
return self.remote.setFindTimeout(defaultTimeout)
.findByCssSelector(selector).getVisibleText()
.then(function (theText) {
// the value has () around it, remove them
return theText.replace(/\((.*)\)/, '$1');
return common.tryForTime(defaultTimeout, function () {
return self.remote.setFindTimeout(defaultTimeout / 10)
.findByCssSelector(selector).getVisibleText()
.then(function (theText) {
// the value has () around it, remove them
return theText.replace(/\((.*)\)/, '$1');
});
});
},