[Archive Migration] x-pack..dashboard_view_mode (#108503)

This commit is contained in:
Tre 2021-08-19 19:48:26 +01:00 committed by GitHub
parent cfd5dad174
commit 7f68ff269c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 323 additions and 373 deletions

View file

@ -15,7 +15,6 @@ export default function ({ getService, getPageObjects }) {
const pieChart = getService('pieChart');
const security = getService('security');
const testSubjects = getService('testSubjects');
const dashboardAddPanel = getService('dashboardAddPanel');
const dashboardPanelActions = getService('dashboardPanelActions');
const appsMenu = getService('appsMenu');
const filterBar = getService('filterBar');
@ -30,7 +29,6 @@ export default function ({ getService, getPageObjects }) {
'share',
]);
const dashboardName = 'Dashboard View Mode Test Dashboard';
const savedSearchName = 'Saved search for dashboard';
describe('Dashboard View Mode', function () {
this.tags(['skipFirefox']);
@ -38,83 +36,40 @@ export default function ({ getService, getPageObjects }) {
before('initialize tests', async () => {
log.debug('Dashboard View Mode:initTests');
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/logstash_functional');
await esArchiver.load('x-pack/test/functional/es_archives/dashboard_view_mode');
await kibanaServer.importExport.load(
'x-pack/test/functional/fixtures/kbn_archiver/dashboard_view_mode'
);
await kibanaServer.uiSettings.replace({ defaultIndex: 'logstash-*' });
await browser.setWindowSize(1600, 1000);
await PageObjects.common.navigateToApp('discover');
await PageObjects.timePicker.setHistoricalDataRange();
await PageObjects.discover.saveSearch(savedSearchName);
await PageObjects.common.navigateToApp('dashboard');
await PageObjects.dashboard.clickNewDashboard();
await dashboardAddPanel.addSavedSearch(savedSearchName);
await PageObjects.dashboard.addVisualizations(
PageObjects.dashboard.getTestVisualizationNames()
});
after(async () => {
await kibanaServer.importExport.unload(
'x-pack/test/functional/fixtures/kbn_archiver/dashboard_view_mode'
);
await PageObjects.dashboard.saveDashboard(dashboardName);
const types = [
'search',
'dashboard',
'visualization',
'search-session',
'core-usage-stats',
'event_loop_delays_daily',
'search-telemetry',
'core-usage-stats',
];
await kibanaServer.savedObjects.clean({ types });
});
describe('Dashboard viewer', () => {
before('Create logstash data role', async () => {
await PageObjects.settings.navigateTo();
await testSubjects.click('roles');
await PageObjects.security.clickCreateNewRole();
await testSubjects.setValue('roleFormNameInput', 'logstash-data');
await PageObjects.security.addIndexToRole('logstash-*');
await PageObjects.security.addPrivilegeToRole('read');
await PageObjects.security.clickSaveEditRole();
});
before('Create dashboard only mode user', async () => {
await PageObjects.settings.navigateTo();
await PageObjects.security.createUser({
username: 'dashuser',
password: '123456',
confirm_password: '123456',
email: 'example@example.com',
full_name: 'dashuser',
roles: ['kibana_dashboard_only_user', 'logstash-data'],
});
});
before('Create user with mixes roles', async () => {
await PageObjects.security.createUser({
username: 'mixeduser',
password: '123456',
confirm_password: '123456',
email: 'example@example.com',
full_name: 'mixeduser',
roles: ['kibana_dashboard_only_user', 'kibana_admin', 'logstash-data'],
});
});
before('Create user with dashboard and superuser role', async () => {
await PageObjects.security.createUser({
username: 'mysuperuser',
password: '123456',
confirm_password: '123456',
email: 'example@example.com',
full_name: 'mixeduser',
roles: ['kibana_dashboard_only_user', 'superuser'],
});
});
after(async () => {
await security.testUser.restoreDefaults();
});
it('shows only the dashboard app link', async () => {
await security.testUser.setRoles(
['test_logstash_reader', 'kibana_dashboard_only_user'],
false
);
await security.testUser.setRoles(['test_logstash_reader', 'kibana_dashboard_only_user']);
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.security.forceLogout();
await PageObjects.security.login('test_user', 'changeme');
const appLinks = await appsMenu.readLinks();
expect(appLinks).to.have.length(1);
expect(appLinks[0]).to.have.property('text', 'Dashboard');

View file

@ -1,308 +0,0 @@
{
"type": "index",
"value": {
"aliases": {
".kibana": {}
},
"index": ".kibana_1",
"mappings": {
"properties": {
"config": {
"dynamic": "true",
"properties": {
"buildNum": {
"type": "keyword"
}
}
},
"dashboard": {
"dynamic": "strict",
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"optionsJSON": {
"type": "text"
},
"panelsJSON": {
"type": "text"
},
"refreshInterval": {
"properties": {
"display": {
"type": "keyword"
},
"pause": {
"type": "boolean"
},
"section": {
"type": "integer"
},
"value": {
"type": "integer"
}
}
},
"timeFrom": {
"type": "keyword"
},
"timeRestore": {
"type": "boolean"
},
"timeTo": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"graph-workspace": {
"dynamic": "strict",
"properties": {
"description": {
"type": "text"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"numLinks": {
"type": "integer"
},
"numVertices": {
"type": "integer"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
},
"wsState": {
"type": "text"
}
}
},
"index-pattern": {
"dynamic": "strict",
"properties": {
"fieldFormatMap": {
"type": "text"
},
"fields": {
"type": "text"
},
"intervalName": {
"type": "keyword"
},
"notExpandable": {
"type": "boolean"
},
"sourceFilters": {
"type": "text"
},
"timeFieldName": {
"type": "keyword"
},
"title": {
"type": "text"
}
}
},
"search": {
"dynamic": "strict",
"properties": {
"columns": {
"type": "keyword"
},
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"sort": {
"type": "keyword"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"server": {
"dynamic": "strict",
"properties": {
"uuid": {
"type": "keyword"
}
}
},
"space": {
"properties": {
"_reserved": {
"type": "boolean"
},
"color": {
"type": "keyword"
},
"description": {
"type": "text"
},
"disabledFeatures": {
"type": "keyword"
},
"initials": {
"type": "keyword"
},
"name": {
"fields": {
"keyword": {
"ignore_above": 2048,
"type": "keyword"
}
},
"type": "text"
}
}
},
"spaceId": {
"type": "keyword"
},
"timelion-sheet": {
"dynamic": "strict",
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"timelion_chart_height": {
"type": "integer"
},
"timelion_columns": {
"type": "integer"
},
"timelion_interval": {
"type": "keyword"
},
"timelion_other_interval": {
"type": "keyword"
},
"timelion_rows": {
"type": "integer"
},
"timelion_sheet": {
"type": "text"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"type": {
"type": "keyword"
},
"url": {
"dynamic": "strict",
"properties": {
"accessCount": {
"type": "long"
},
"accessDate": {
"type": "date"
},
"createDate": {
"type": "date"
},
"url": {
"fields": {
"keyword": {
"ignore_above": 2048,
"type": "keyword"
}
},
"type": "text"
}
}
},
"visualization": {
"dynamic": "strict",
"properties": {
"description": {
"type": "text"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"savedSearchId": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
},
"visState": {
"type": "text"
}
}
}
}
},
"settings": {
"index": {
"number_of_replicas": "1",
"number_of_shards": "1"
}
}
}
}

File diff suppressed because one or more lines are too long