mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Timelion tests- migrate to kbnArchiver from esArchiver (#103969)
* Timelion tests- migrate to kbnArchiver * added the logic to handle custom space * paths and version changed
This commit is contained in:
parent
c78c350a1d
commit
ec75f71d4c
4 changed files with 116 additions and 6 deletions
|
@ -11,6 +11,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context';
|
|||
export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const security = getService('security');
|
||||
const kibanaServer = getService('kibanaServer');
|
||||
const PageObjects = getPageObjects([
|
||||
'common',
|
||||
'error',
|
||||
|
@ -24,10 +25,19 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
|
||||
describe('feature controls security', () => {
|
||||
before(async () => {
|
||||
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/timelion/feature_controls');
|
||||
await kibanaServer.importExport.load(
|
||||
'x-pack/test/functional/fixtures/kbn_archiver/timelion/feature_controls.json'
|
||||
);
|
||||
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/logstash_functional');
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await kibanaServer.importExport.unload(
|
||||
'x-pack/test/functional/fixtures/kbn_archiver/timelion/feature_controls.json'
|
||||
);
|
||||
await esArchiver.unload('x-pack/test/functional/es_archives/logstash_functional');
|
||||
});
|
||||
|
||||
describe('global timelion all privileges', () => {
|
||||
before(async () => {
|
||||
await security.role.create('global_timelion_all_role', {
|
||||
|
|
|
@ -13,6 +13,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
const spacesService = getService('spaces');
|
||||
const PageObjects = getPageObjects(['common', 'timelion', 'security', 'spaceSelector']);
|
||||
const appsMenu = getService('appsMenu');
|
||||
const kibanaServer = getService('kibanaServer');
|
||||
|
||||
describe('timelion', () => {
|
||||
before(async () => {
|
||||
|
@ -23,29 +24,44 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
before(async () => {
|
||||
// we need to load the following in every situation as deleting
|
||||
// a space deletes all of the associated saved objects
|
||||
await esArchiver.load('x-pack/test/functional/es_archives/timelion/feature_controls');
|
||||
// await esArchiver.load('x-pack/test/functional/es_archives/timelion/feature_controls');
|
||||
await kibanaServer.importExport.load(
|
||||
'x-pack/test/functional/fixtures/kbn_archiver/timelion/feature_controls.json'
|
||||
);
|
||||
|
||||
await spacesService.create({
|
||||
id: 'custom_space',
|
||||
name: 'custom_space',
|
||||
disabledFeatures: [],
|
||||
});
|
||||
|
||||
await kibanaServer.importExport.load(
|
||||
'x-pack/test/functional/fixtures/kbn_archiver/timelion/timelion_custom_space.json',
|
||||
{ space: 'custom_space' }
|
||||
);
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await spacesService.delete('custom_space');
|
||||
await esArchiver.unload('x-pack/test/functional/es_archives/timelion/feature_controls');
|
||||
await kibanaServer.importExport.unload(
|
||||
'x-pack/test/functional/fixtures/kbn_archiver/timelion/feature_controls.json'
|
||||
);
|
||||
});
|
||||
|
||||
it('shows timelion navlink', async () => {
|
||||
await PageObjects.common.navigateToApp('home', {
|
||||
basePath: '/s/custom_space',
|
||||
});
|
||||
|
||||
const navLinks = (await appsMenu.readLinks()).map((link) => link.text);
|
||||
expect(navLinks).to.contain('Timelion');
|
||||
});
|
||||
|
||||
it(`allows a timelion sheet to be created`, async () => {
|
||||
await PageObjects.common.navigateToApp('timelion');
|
||||
await PageObjects.common.navigateToApp('timelion', {
|
||||
basePath: '/s/custom_space',
|
||||
});
|
||||
|
||||
await PageObjects.timelion.saveTimelionSheet();
|
||||
});
|
||||
});
|
||||
|
@ -54,17 +70,29 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
before(async () => {
|
||||
// we need to load the following in every situation as deleting
|
||||
// a space deletes all of the associated saved objects
|
||||
await esArchiver.load('x-pack/test/functional/es_archives/timelion/feature_controls');
|
||||
// await esArchiver.load('x-pack/test/functional/es_archives/timelion/feature_controls');
|
||||
|
||||
await kibanaServer.importExport.load(
|
||||
'x-pack/test/functional/fixtures/kbn_archiver/timelion/feature_controls.json'
|
||||
);
|
||||
|
||||
await spacesService.create({
|
||||
id: 'custom_space',
|
||||
name: 'custom_space',
|
||||
disabledFeatures: ['timelion'],
|
||||
});
|
||||
|
||||
await kibanaServer.importExport.load(
|
||||
'x-pack/test/functional/fixtures/kbn_archiver/timelion/timelion_custom_space.json',
|
||||
{ space: 'custom_space' }
|
||||
);
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await spacesService.delete('custom_space');
|
||||
await esArchiver.unload('x-pack/test/functional/es_archives/timelion/feature_controls');
|
||||
await kibanaServer.importExport.unload(
|
||||
'x-pack/test/functional/fixtures/kbn_archiver/timelion/feature_controls.json'
|
||||
);
|
||||
});
|
||||
|
||||
it(`doesn't show timelion navlink`, async () => {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"attributes": {
|
||||
"description": "",
|
||||
"hits": 0,
|
||||
"timelion_chart_height": 275,
|
||||
"timelion_columns": 2,
|
||||
"timelion_interval": "auto",
|
||||
"timelion_rows": 2,
|
||||
"timelion_sheet": [
|
||||
".es(*).label('custom space sheet')"
|
||||
],
|
||||
"title": "i-exist",
|
||||
"version": 1
|
||||
},
|
||||
"coreMigrationVersion": "7.14.0",
|
||||
"id": "i-exist",
|
||||
"references": [],
|
||||
"type": "timelion-sheet",
|
||||
"version": "WzcsMl0="
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue