mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Update PageObjects for Visualize, Dashboard, and Discover to use data-test-subj selectors for menu items. (#9133)
* Update PageObjects for Visualize, Dashboard, and Discover to use data-test-subj selectors for menu items. * Run checkPlugins task as part of test:ui:runner task.
This commit is contained in:
parent
62c2e312a1
commit
f0a8887f7b
8 changed files with 55 additions and 51 deletions
|
@ -108,26 +108,32 @@ app.directive('dashboardApp', function (Notifier, courier, AppState, timefilter,
|
|||
key: 'new',
|
||||
description: 'New Dashboard',
|
||||
run: function () { kbnUrl.change('/dashboard', {}); },
|
||||
testId: 'dashboardNewButton',
|
||||
}, {
|
||||
key: 'add',
|
||||
description: 'Add a panel to the dashboard',
|
||||
template: require('plugins/kibana/dashboard/partials/pick_visualization.html')
|
||||
template: require('plugins/kibana/dashboard/partials/pick_visualization.html'),
|
||||
testId: 'dashboardAddPanelButton',
|
||||
}, {
|
||||
key: 'save',
|
||||
description: 'Save Dashboard',
|
||||
template: require('plugins/kibana/dashboard/partials/save_dashboard.html')
|
||||
template: require('plugins/kibana/dashboard/partials/save_dashboard.html'),
|
||||
testId: 'dashboardSaveButton',
|
||||
}, {
|
||||
key: 'open',
|
||||
description: 'Open Saved Dashboard',
|
||||
template: require('plugins/kibana/dashboard/partials/load_dashboard.html')
|
||||
template: require('plugins/kibana/dashboard/partials/load_dashboard.html'),
|
||||
testId: 'dashboardOpenButton',
|
||||
}, {
|
||||
key: 'share',
|
||||
description: 'Share Dashboard',
|
||||
template: require('plugins/kibana/dashboard/partials/share.html')
|
||||
template: require('plugins/kibana/dashboard/partials/share.html'),
|
||||
testId: 'dashboardShareButton',
|
||||
}, {
|
||||
key: 'options',
|
||||
description: 'Options',
|
||||
template: require('plugins/kibana/dashboard/partials/options.html')
|
||||
template: require('plugins/kibana/dashboard/partials/options.html'),
|
||||
testId: 'dashboardOptionsButton',
|
||||
}];
|
||||
|
||||
$scope.refresh = _.bindKey(courier, 'fetch');
|
||||
|
|
|
@ -115,19 +115,23 @@ function discoverController($scope, config, courier, $route, $window, Notifier,
|
|||
$scope.topNavMenu = [{
|
||||
key: 'new',
|
||||
description: 'New Search',
|
||||
run: function () { kbnUrl.change('/discover'); }
|
||||
run: function () { kbnUrl.change('/discover'); },
|
||||
testId: 'discoverNewButton',
|
||||
}, {
|
||||
key: 'save',
|
||||
description: 'Save Search',
|
||||
template: require('plugins/kibana/discover/partials/save_search.html')
|
||||
template: require('plugins/kibana/discover/partials/save_search.html'),
|
||||
testId: 'discoverSaveButton',
|
||||
}, {
|
||||
key: 'open',
|
||||
description: 'Load Saved Search',
|
||||
template: require('plugins/kibana/discover/partials/load_search.html')
|
||||
description: 'Open Saved Search',
|
||||
template: require('plugins/kibana/discover/partials/load_search.html'),
|
||||
testId: 'discoverOpenButton',
|
||||
}, {
|
||||
key: 'share',
|
||||
description: 'Share Search',
|
||||
template: require('plugins/kibana/discover/partials/share_search.html')
|
||||
template: require('plugins/kibana/discover/partials/share_search.html'),
|
||||
testId: 'discoverShareButton',
|
||||
}];
|
||||
$scope.timefilter = timefilter;
|
||||
|
||||
|
|
|
@ -104,23 +104,28 @@ function VisEditor($scope, $route, timefilter, AppState, $location, kbnUrl, $tim
|
|||
$scope.topNavMenu = [{
|
||||
key: 'new',
|
||||
description: 'New Visualization',
|
||||
run: function () { kbnUrl.change('/visualize', {}); }
|
||||
run: function () { kbnUrl.change('/visualize', {}); },
|
||||
testId: 'visualizeNewButton',
|
||||
}, {
|
||||
key: 'save',
|
||||
description: 'Save Visualization',
|
||||
template: require('plugins/kibana/visualize/editor/panels/save.html'),
|
||||
description: 'Save Visualization'
|
||||
testId: 'visualizeSaveButton',
|
||||
}, {
|
||||
key: 'open',
|
||||
template: require('plugins/kibana/visualize/editor/panels/load.html'),
|
||||
description: 'Open Saved Visualization',
|
||||
template: require('plugins/kibana/visualize/editor/panels/load.html'),
|
||||
testId: 'visualizeOpenButton',
|
||||
}, {
|
||||
key: 'share',
|
||||
description: 'Share Visualization',
|
||||
template: require('plugins/kibana/visualize/editor/panels/share.html'),
|
||||
description: 'Share Visualization'
|
||||
testId: 'visualizeShareButton',
|
||||
}, {
|
||||
key: 'refresh',
|
||||
description: 'Refresh',
|
||||
run: function () { $scope.fetch(); }
|
||||
run: function () { $scope.fetch(); },
|
||||
testId: 'visualizeRefreshButton',
|
||||
}];
|
||||
|
||||
if (savedVis.id) {
|
||||
|
|
|
@ -28,7 +28,6 @@ require('ui/saved_objects/saved_object_registry').register(require('plugins/time
|
|||
|
||||
// TODO: Expose an api for dismissing notifications
|
||||
var unsafeNotifications = require('ui/notify')._notifs;
|
||||
//var ConfigTemplate = require('ui/config_template');
|
||||
|
||||
require('ui/routes').enable();
|
||||
|
||||
|
@ -67,27 +66,33 @@ app.controller('timelion', function (
|
|||
$scope.topNavMenu = [{
|
||||
key: 'new',
|
||||
description: 'New Sheet',
|
||||
run: function () { kbnUrl.change('/'); }
|
||||
run: function () { kbnUrl.change('/'); },
|
||||
testId: 'timelionNewButton',
|
||||
}, {
|
||||
key: 'add',
|
||||
description: 'Add a chart',
|
||||
run: function () { $scope.newCell(); }
|
||||
run: function () { $scope.newCell(); },
|
||||
testId: 'timelionAddChartButton',
|
||||
}, {
|
||||
key: 'save',
|
||||
description: 'Save Sheet',
|
||||
template: require('plugins/timelion/partials/save_sheet.html')
|
||||
template: require('plugins/timelion/partials/save_sheet.html'),
|
||||
testId: 'timelionSaveButton',
|
||||
}, {
|
||||
key: 'open',
|
||||
description: 'Load Sheet',
|
||||
template: require('plugins/timelion/partials/load_sheet.html')
|
||||
description: 'Open Sheet',
|
||||
template: require('plugins/timelion/partials/load_sheet.html'),
|
||||
testId: 'timelionOpenButton',
|
||||
}, {
|
||||
key: 'options',
|
||||
description: 'Options',
|
||||
template: require('plugins/timelion/partials/sheet_options.html')
|
||||
template: require('plugins/timelion/partials/sheet_options.html'),
|
||||
testId: 'timelionOptionsButton',
|
||||
}, {
|
||||
key: 'docs',
|
||||
description: 'Documentation',
|
||||
template: '<timelion-docs></timelion-docs>'
|
||||
template: '<timelion-docs></timelion-docs>',
|
||||
testId: 'timelionDocsButton',
|
||||
}];
|
||||
|
||||
|
||||
|
|
|
@ -76,6 +76,7 @@ module.exports = function (grunt) {
|
|||
]);
|
||||
|
||||
grunt.registerTask('test:ui:server', [
|
||||
'checkPlugins',
|
||||
'esvm:ui',
|
||||
'run:testUIDevServer:keepalive'
|
||||
]);
|
||||
|
|
|
@ -13,14 +13,12 @@ export default class DashboardPage {
|
|||
}
|
||||
|
||||
clickNewDashboard() {
|
||||
return this.findTimeout
|
||||
.findByCssSelector('[aria-label="New Dashboard"]')
|
||||
return PageObjects.common.findTestSubject('dashboardNewButton')
|
||||
.click();
|
||||
}
|
||||
|
||||
clickAddVisualization() {
|
||||
return this.findTimeout
|
||||
.findByCssSelector('[aria-label="Add a panel to the dashboard"]')
|
||||
return PageObjects.common.findTestSubject('dashboardAddPanelButton')
|
||||
.click();
|
||||
}
|
||||
|
||||
|
@ -70,8 +68,7 @@ export default class DashboardPage {
|
|||
}
|
||||
|
||||
saveDashboard(dashName) {
|
||||
return this.findTimeout
|
||||
.findByCssSelector('[aria-label="Save Dashboard"]')
|
||||
return PageObjects.common.findTestSubject('dashboardSaveButton')
|
||||
.click()
|
||||
.then(() => {
|
||||
return PageObjects.header.isGlobalLoadingIndicatorHidden();
|
||||
|
@ -125,8 +122,7 @@ export default class DashboardPage {
|
|||
// entry, or at least to a single page of results
|
||||
loadSavedDashboard(dashName) {
|
||||
var self = this;
|
||||
return this.findTimeout
|
||||
.findByCssSelector('[aria-label="Open Saved Dashboard"]')
|
||||
return PageObjects.common.findTestSubject('dashboardOpenButton')
|
||||
.click()
|
||||
.then(function filterDashboard() {
|
||||
PageObjects.common.debug('Load Saved Dashboard button clicked');
|
||||
|
|
|
@ -57,20 +57,17 @@ export default class DiscoverPage {
|
|||
}
|
||||
|
||||
clickNewSearchButton() {
|
||||
return this.findTimeout
|
||||
.findByCssSelector('[aria-label="New Search"]')
|
||||
return PageObjects.common.findTestSubject('discoverNewButton')
|
||||
.click();
|
||||
}
|
||||
|
||||
clickSaveSearchButton() {
|
||||
return this.findTimeout
|
||||
.findByCssSelector('[aria-label="Save Search"]')
|
||||
return PageObjects.common.findTestSubject('discoverSaveButton')
|
||||
.click();
|
||||
}
|
||||
|
||||
clickLoadSavedSearchButton() {
|
||||
return this.findTimeout
|
||||
.findDisplayedByCssSelector('[aria-label="Load Saved Search"]')
|
||||
return PageObjects.common.findTestSubject('discoverOpenButton')
|
||||
.click();
|
||||
}
|
||||
|
||||
|
@ -192,8 +189,7 @@ export default class DiscoverPage {
|
|||
}
|
||||
|
||||
clickShare() {
|
||||
return this.findTimeout
|
||||
.findByCssSelector('[aria-label="Share Search"]')
|
||||
return PageObjects.common.findTestSubject('discoverShareButton')
|
||||
.click();
|
||||
}
|
||||
|
||||
|
|
|
@ -292,19 +292,13 @@ export default class VisualizePage {
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
clickNewVisualization() {
|
||||
return this.remote
|
||||
.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('[aria-label="New Visualization"]')
|
||||
return PageObjects.common.findTestSubject('visualizeNewButton')
|
||||
.click();
|
||||
}
|
||||
|
||||
|
||||
saveVisualization(vizName) {
|
||||
return this.remote
|
||||
.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('[aria-label="Save Visualization"]')
|
||||
return PageObjects.common.findTestSubject('visualizeSaveButton')
|
||||
.click()
|
||||
.then(() => {
|
||||
return PageObjects.common.sleep(1000);
|
||||
|
@ -339,9 +333,7 @@ export default class VisualizePage {
|
|||
}
|
||||
|
||||
clickLoadSavedVisButton() {
|
||||
return this.remote
|
||||
.setFindTimeout(defaultFindTimeout)
|
||||
.findDisplayedByCssSelector('[aria-label="Open Saved Visualization"]')
|
||||
return PageObjects.common.findTestSubject('visualizeOpenButton')
|
||||
.click();
|
||||
}
|
||||
|
||||
|
@ -433,7 +425,6 @@ export default class VisualizePage {
|
|||
** Returns an array of height values
|
||||
*/
|
||||
getAreaChartData(aggregateName) {
|
||||
|
||||
var self = this.remote;
|
||||
var chartData = [];
|
||||
var tempArray = [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue