mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
move tryForTime to getFieldsTabCount, speed up test
This commit is contained in:
parent
b17ed30066
commit
3ab7e7231d
2 changed files with 15 additions and 11 deletions
|
@ -93,11 +93,9 @@ define(function (require) {
|
|||
});
|
||||
|
||||
bdd.it('makelogs data should have expected number of fields', function () {
|
||||
return common.tryForTime(15000, function () {
|
||||
return settingsPage.getFieldsTabCount()
|
||||
.then(function (tabCount) {
|
||||
expect(tabCount).to.be('' + expectedFieldCount);
|
||||
});
|
||||
return settingsPage.getFieldsTabCount()
|
||||
.then(function (tabCount) {
|
||||
expect(tabCount).to.be('' + expectedFieldCount);
|
||||
})
|
||||
.catch(common.handleError(this));
|
||||
});
|
||||
|
|
|
@ -121,12 +121,18 @@ define(function (require) {
|
|||
},
|
||||
|
||||
getFieldsTabCount: function getFieldsTabCount() {
|
||||
return this.remote.setFindTimeout(defaultTimeout * 2)
|
||||
// passing in zero-based index, but adding 1 for css 1-based indexes
|
||||
.findByCssSelector('li.kbn-settings-tab.ng-scope.active a.ng-binding small.ng-binding').getVisibleText()
|
||||
.then(function (theText) {
|
||||
// the value has () around it, remove them
|
||||
return theText.replace(/\((.*)\)/, '$1');
|
||||
var self = this;
|
||||
var selector = 'li.kbn-settings-tab.ng-scope.active a.ng-binding small.ng-binding';
|
||||
|
||||
return common.tryForTime(defaultTimeout, function () {
|
||||
return self.remote.findByCssSelector(selector);
|
||||
})
|
||||
.then(function () {
|
||||
return self.remote.findByCssSelector(selector).getVisibleText()
|
||||
.then(function (theText) {
|
||||
// the value has () around it, remove them
|
||||
return theText.replace(/\((.*)\)/, '$1');
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue