Skip to content

Commit

Permalink
[Discover] Fix permissions for runtime fields functional test (elasti…
Browse files Browse the repository at this point in the history
…c#111925)

# Conflicts:
#	test/functional/apps/discover/_runtime_fields_editor.ts
  • Loading branch information
kertal committed Sep 14, 2021
1 parent ab43f57 commit 4de8659
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 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,13 +33,18 @@ 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 kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json');
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
await kibanaServer.uiSettings.replace(defaultSettings);
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
await PageObjects.common.navigateToApp('discover');
});

after(async () => {
await security.testUser.restoreDefaults();
});

it('allows adding custom label to existing fields', async function () {
const customLabel = 'megabytes';
await PageObjects.discover.editField('bytes');
Expand Down

0 comments on commit 4de8659

Please sign in to comment.