mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Additional page support classes
This commit is contained in:
parent
df0fe171b3
commit
d67cd2abc4
3 changed files with 144 additions and 2 deletions
|
@ -11,7 +11,9 @@ define(function (require) {
|
|||
browserName: 'firefox'
|
||||
}],
|
||||
tunnelOptions: serverConfig.webdriver,
|
||||
functionalSuites: ['test/functional/status.js'],
|
||||
functionalSuites: [
|
||||
'test/functional/status.js'
|
||||
],
|
||||
excludeInstrumentation: /(fixtures|node_modules)\//
|
||||
}, serverConfig);
|
||||
});
|
||||
});
|
53
test/support/pages/HeaderPage.js
Normal file
53
test/support/pages/HeaderPage.js
Normal file
|
@ -0,0 +1,53 @@
|
|||
// in test/support/pages/HeaderPage.js
|
||||
define(function (require) {
|
||||
// the page object is created as a constructor
|
||||
// so we can provide the remote Command object
|
||||
// at runtime
|
||||
function HeaderPage(remote) {
|
||||
this.remote = remote;
|
||||
}
|
||||
|
||||
HeaderPage.prototype = {
|
||||
constructor: HeaderPage,
|
||||
|
||||
clickDiscover: function () {
|
||||
return this.remote
|
||||
.setFindTimeout(5000)
|
||||
.findByXpath('/html/body/div[2]/nav/div[2]/ul[1]/li[3]/a')
|
||||
// .findByXpath('//a[@ng-href=\'#/discover.*\']')
|
||||
.click();
|
||||
},
|
||||
clickVisualize: function () {
|
||||
return this.remote
|
||||
.setFindTimeout(5000)
|
||||
.findByXpath('//a[@href=\'#/visualize*\']')
|
||||
.click();
|
||||
},
|
||||
clickDashboard: function () {
|
||||
return this.remote
|
||||
.setFindTimeout(5000)
|
||||
.findByXpath('//a[@href=\'#/dashboard.*\']')
|
||||
.click();
|
||||
},
|
||||
clickSettings: function () {
|
||||
return this.remote
|
||||
.setFindTimeout(15000)
|
||||
//.findByXpath('/html/body/div[2]/nav/div[2]/ul[1]/li[6]/a')
|
||||
.findByXpath('//a[@ng-href=\'#/settings\']')
|
||||
.click();
|
||||
}
|
||||
|
||||
// ,
|
||||
|
||||
|
||||
// getCreateButton: function () {
|
||||
// return this.remote
|
||||
// .findByCssSelector('.btn');
|
||||
// }
|
||||
|
||||
|
||||
// …additional page interaction tasks…
|
||||
};
|
||||
|
||||
return HeaderPage;
|
||||
});
|
87
test/support/pages/SettingsPage.js
Normal file
87
test/support/pages/SettingsPage.js
Normal file
|
@ -0,0 +1,87 @@
|
|||
// in test/support/pages/SettingsPage.js
|
||||
define(function (require) {
|
||||
// the page object is created as a constructor
|
||||
// so we can provide the remote Command object
|
||||
// at runtime
|
||||
function SettingsPage(remote) {
|
||||
this.remote = remote;
|
||||
}
|
||||
|
||||
SettingsPage.prototype = {
|
||||
constructor: SettingsPage,
|
||||
|
||||
getTimeBasedEventsCheckbox: function () {
|
||||
return this.remote
|
||||
.setFindTimeout(5000)
|
||||
.findByXpath('//input[@ng-model=\'index.isTimeBased\']');
|
||||
},
|
||||
|
||||
getNameIsPatternCheckbox: function () {
|
||||
return this.remote
|
||||
.setFindTimeout(2000)
|
||||
.findByXpath('//input[@ng-model=\'index.nameIsPattern\']');
|
||||
},
|
||||
|
||||
getIndexPatternField: function () {
|
||||
return this.remote
|
||||
.setFindTimeout(5000)
|
||||
.findByName('name');
|
||||
},
|
||||
|
||||
getTimeFieldNameField: function () {
|
||||
return this.remote
|
||||
.setFindTimeout(5000)
|
||||
.findByXpath(
|
||||
'//body[@id=\'kibana-body\']/div[2]/div/kbn-settings-app/div/div/kbn-settings-indices/div[2]/div/div[2]/form/div[3]/select'
|
||||
);
|
||||
},
|
||||
|
||||
selectTimeFieldOption: function (selection) {
|
||||
var self = this;
|
||||
return this
|
||||
.getTimeFieldNameField().click()
|
||||
.then(function () {
|
||||
return self
|
||||
.getTimeFieldNameField().click();
|
||||
})
|
||||
.then(function () {
|
||||
return self
|
||||
.getTimeFieldOption(selection);
|
||||
});
|
||||
},
|
||||
|
||||
getTimeFieldOption: function (selection) {
|
||||
console.log('selection = ' + selection);
|
||||
return this.remote
|
||||
.setFindTimeout(10000)
|
||||
.findByXpath(
|
||||
'/html/body/div[2]/div/kbn-settings-app/div/div/kbn-settings-indices/div[2]/div/div[2]/form/div[3]/select/option[@label=\'' +
|
||||
selection + '\']'
|
||||
).click();
|
||||
},
|
||||
|
||||
clickCreateButton: function () {
|
||||
return this.remote
|
||||
.setFindTimeout(5000)
|
||||
.findByCssSelector('.btn').click();
|
||||
},
|
||||
|
||||
getDefaultIndexButton: function () {
|
||||
return this.remote
|
||||
.setFindTimeout(5000)
|
||||
.findByXpath(
|
||||
'/html/body/div[2]/div/kbn-settings-app/div/div/kbn-settings-indices/div[2]/div/div/kbn-settings-index-header/div/div/button[1]'
|
||||
);
|
||||
},
|
||||
|
||||
clickDefaultIndexButton: function () {
|
||||
return this.remote
|
||||
.setFindTimeout(5000)
|
||||
.findByXpath(
|
||||
'/html/body/div[2]/div/kbn-settings-app/div/div/kbn-settings-indices/div[2]/div/div/kbn-settings-index-header/div/div/button[1]'
|
||||
).click();
|
||||
}
|
||||
};
|
||||
|
||||
return SettingsPage;
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue