mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
clean up HeaderPage helper
This commit is contained in:
parent
1cf47d4e1d
commit
34b822cb6c
1 changed files with 21 additions and 30 deletions
|
@ -11,7 +11,6 @@ define(function (require) {
|
|||
function HeaderPage(remote) {
|
||||
this.remote = remote;
|
||||
common = new Common(this.remote);
|
||||
|
||||
}
|
||||
|
||||
var defaultTimeout = 5000;
|
||||
|
@ -19,43 +18,35 @@ define(function (require) {
|
|||
HeaderPage.prototype = {
|
||||
constructor: HeaderPage,
|
||||
|
||||
clickDiscover: function clickDiscover() {
|
||||
common.log('Click Discover tab');
|
||||
return this.remote.setFindTimeout(defaultTimeout)
|
||||
.findByCssSelector('a[href*=\'discover\']')
|
||||
clickSelector: function (selector) {
|
||||
var self = this.remote;
|
||||
return common.tryForTime(5000, function () {
|
||||
return self.setFindTimeout(defaultTimeout)
|
||||
.findByCssSelector(selector)
|
||||
.then(function (tab) {
|
||||
return tab.click();
|
||||
});
|
||||
},
|
||||
|
||||
clickVisualize: function clickVisualize() {
|
||||
var self = this.remote;
|
||||
common.log('Click Visualize tab');
|
||||
return common.tryForTime(5000, function () {
|
||||
return self.setFindTimeout(defaultTimeout)
|
||||
.findByCssSelector('a[href*=\'visualize\']')
|
||||
.then(function (tab) {
|
||||
return tab.click();
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
clickDashboard: function clickDashboard() {
|
||||
common.log('Click Dashboard tab');
|
||||
return this.remote.setFindTimeout(defaultTimeout)
|
||||
.findByCssSelector('a[href*=\'dashboard\']')
|
||||
.then(function (tab) {
|
||||
return tab.click();
|
||||
});
|
||||
clickDiscover: function () {
|
||||
common.debug('click Discover tab');
|
||||
this.clickSelector('a[href*=\'discover\']');
|
||||
},
|
||||
|
||||
clickSettings: function clickSettings() {
|
||||
common.log('Click Settings tab');
|
||||
return this.remote.setFindTimeout(defaultTimeout)
|
||||
.findByCssSelector('a[href*=\'settings\']')
|
||||
.then(function (tab) {
|
||||
return tab.click();
|
||||
});
|
||||
clickVisualize: function () {
|
||||
common.debug('click Discover tab');
|
||||
this.clickSelector('a[href*=\'visualize\']');
|
||||
},
|
||||
|
||||
clickDashboard: function () {
|
||||
common.debug('click Dashboard tab');
|
||||
this.clickSelector('a[href*=\'visualize\']');
|
||||
},
|
||||
|
||||
clickSettings: function () {
|
||||
common.debug('click Settings tab');
|
||||
this.clickSelector('a[href*=\'settings\']');
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue