mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
This commit is contained in:
parent
f00d37fcc5
commit
f8651a8077
4 changed files with 30 additions and 2 deletions
|
@ -1,3 +1,3 @@
|
|||
<div class="kuiToolBarText">
|
||||
<div class="kuiToolBarText" data-test-subj="toolBarPagerText">
|
||||
{{ toolBarPagerText.startItem | number }}–{{ toolBarPagerText.endItem | number }} of {{ toolBarPagerText.totalItems | number }}
|
||||
</div>
|
|
@ -182,6 +182,19 @@ export function DashboardPageProvider({ getService, getPageObjects }) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Asserts that the toolbar pagination (count and arrows) is either displayed or not displayed.
|
||||
* @param { displayed: boolean }
|
||||
*/
|
||||
async expectToolbarPaginationDisplayed({ displayed }) {
|
||||
const subjects = ['btnPrevPage', 'btnNextPage', 'toolBarPagerText'];
|
||||
if (displayed) {
|
||||
return await Promise.all(subjects.map(async subj => await testSubjects.existOrFail(subj)));
|
||||
} else {
|
||||
return await Promise.all(subjects.map(async subj => await testSubjects.missingOrFail(subj)));
|
||||
}
|
||||
}
|
||||
|
||||
async switchToEditMode() {
|
||||
log.debug('Switching to edit mode');
|
||||
await testSubjects.click('dashboardEditMode');
|
||||
|
|
|
@ -36,6 +36,7 @@ import 'ui/agg_response';
|
|||
import 'ui/agg_types';
|
||||
import 'ui/timepicker';
|
||||
import 'ui/pager';
|
||||
import 'ui/pager_control';
|
||||
import 'leaflet';
|
||||
|
||||
import { showAppRedirectNotification } from 'ui/notify';
|
||||
|
|
|
@ -13,14 +13,18 @@ export default function ({ getService, getPageObjects }) {
|
|||
const log = getService('log');
|
||||
const find = getService('find');
|
||||
const testSubjects = getService('testSubjects');
|
||||
const dashboardAddPanel = getService('dashboardAddPanel');
|
||||
const dashboardPanelActions = getService('dashboardPanelActions');
|
||||
const PageObjects = getPageObjects([
|
||||
'security',
|
||||
'common',
|
||||
'discover',
|
||||
'dashboard',
|
||||
'header',
|
||||
'settings']);
|
||||
'settings',
|
||||
]);
|
||||
const dashboardName = 'Dashboard View Mode Test Dashboard';
|
||||
const savedSearchName = 'Saved search for dashboard';
|
||||
|
||||
describe('Dashboard View Mode', () => {
|
||||
|
||||
|
@ -35,9 +39,14 @@ export default function ({ getService, getPageObjects }) {
|
|||
await kibanaServer.uiSettings.disableToastAutohide();
|
||||
remote.setWindowSize(1600, 1000);
|
||||
|
||||
await PageObjects.common.navigateToApp('discover');
|
||||
await PageObjects.dashboard.setTimepickerInHistoricalDataRange();
|
||||
await PageObjects.discover.saveSearch(savedSearchName);
|
||||
|
||||
await PageObjects.common.navigateToApp('dashboard');
|
||||
await PageObjects.dashboard.clickNewDashboard();
|
||||
await PageObjects.dashboard.addVisualizations(PageObjects.dashboard.getTestVisualizationNames());
|
||||
await dashboardAddPanel.addSavedSearch(savedSearchName);
|
||||
await PageObjects.dashboard.saveDashboard(dashboardName);
|
||||
});
|
||||
|
||||
|
@ -175,6 +184,10 @@ export default function ({ getService, getPageObjects }) {
|
|||
expect(timePickerExists).to.be(true);
|
||||
});
|
||||
|
||||
it('can paginate on a saved search', async () => {
|
||||
await PageObjects.dashboard.expectToolbarPaginationDisplayed({ displayed: true });
|
||||
});
|
||||
|
||||
it('is loaded for a user who is assigned a non-dashboard mode role', async () => {
|
||||
await PageObjects.security.logout();
|
||||
await PageObjects.security.login('mixeduser', '123456');
|
||||
|
@ -190,6 +203,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
const managementAppExists = await find.existsByLinkText('Management');
|
||||
expect(managementAppExists).to.be(true);
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue