Skip to content

Commit

Permalink
[Discover] Fix permissions for runtime fields functional test (#111925)
Browse files Browse the repository at this point in the history
  • Loading branch information
kertal authored Sep 13, 2021
1 parent e1be1a6 commit f3dc980
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/functional/apps/discover/_runtime_fields_editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const kibanaServer = getService('kibanaServer');
const esArchiver = getService('esArchiver');
const fieldEditor = getService('fieldEditor');
const security = getService('security');
const PageObjects = getPageObjects(['common', 'discover', 'header', 'timePicker']);
const defaultSettings = {
defaultIndex: 'logstash-*',
Expand All @@ -32,6 +33,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

describe('discover integration with runtime fields editor', function describeIndexTests() {
before(async function () {
await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader']);
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
await kibanaServer.uiSettings.replace(defaultSettings);
Expand All @@ -40,6 +42,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});

after(async () => {
await security.testUser.restoreDefaults();
await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover');
await kibanaServer.savedObjects.clean({ types: ['saved-search'] });
});
Expand Down

0 comments on commit f3dc980

Please sign in to comment.