[Discover] Add right permission for unmapped field test in cloud env (#102853)
This commit is contained in:
parent
8298b78a62
commit
507ab0e8d0
2 changed files with 25 additions and 5 deletions
|
@ -12,26 +12,31 @@ import { FtrProviderContext } from '../../ftr_provider_context';
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const log = getService('log');
|
const security = getService('security');
|
||||||
const retry = getService('retry');
|
const retry = getService('retry');
|
||||||
const PageObjects = getPageObjects(['common', 'timePicker', 'discover']);
|
const PageObjects = getPageObjects(['common', 'timePicker', 'discover']);
|
||||||
|
|
||||||
describe('index pattern with unmapped fields', () => {
|
describe('index pattern with unmapped fields', () => {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/unmapped_fields');
|
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/unmapped_fields');
|
||||||
|
await security.testUser.setRoles(['kibana_admin', 'test-index-unmapped-fields']);
|
||||||
|
const fromTime = 'Jan 20, 2021 @ 00:00:00.000';
|
||||||
|
const toTime = 'Jan 25, 2021 @ 00:00:00.000';
|
||||||
|
|
||||||
await kibanaServer.uiSettings.replace({
|
await kibanaServer.uiSettings.replace({
|
||||||
defaultIndex: 'test-index-unmapped-fields',
|
defaultIndex: 'test-index-unmapped-fields',
|
||||||
'discover:searchFieldsFromSource': false,
|
'discover:searchFieldsFromSource': false,
|
||||||
|
'timepicker:timeDefaults': `{ "from": "${fromTime}", "to": "${toTime}"}`,
|
||||||
});
|
});
|
||||||
log.debug('discover');
|
|
||||||
const fromTime = 'Jan 20, 2021 @ 00:00:00.000';
|
|
||||||
const toTime = 'Jan 25, 2021 @ 00:00:00.000';
|
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await PageObjects.common.navigateToApp('discover');
|
||||||
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
await esArchiver.unload('test/functional/fixtures/es_archiver/unmapped_fields');
|
await esArchiver.unload('test/functional/fixtures/es_archiver/unmapped_fields');
|
||||||
|
await kibanaServer.uiSettings.unset('defaultIndex');
|
||||||
|
await kibanaServer.uiSettings.unset('discover:searchFieldsFromSource');
|
||||||
|
await kibanaServer.uiSettings.unset('timepicker:timeDefaults');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('unmapped fields exist on a new saved search', async () => {
|
it('unmapped fields exist on a new saved search', async () => {
|
||||||
|
|
|
@ -292,6 +292,21 @@ export default async function ({ readConfigFile }) {
|
||||||
kibana: [],
|
kibana: [],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'test-index-unmapped-fields': {
|
||||||
|
elasticsearch: {
|
||||||
|
cluster: [],
|
||||||
|
indices: [
|
||||||
|
{
|
||||||
|
names: ['test-index-unmapped-fields'],
|
||||||
|
privileges: ['read', 'view_index_metadata'],
|
||||||
|
field_security: { grant: ['*'], except: [] },
|
||||||
|
},
|
||||||
|
],
|
||||||
|
run_as: [],
|
||||||
|
},
|
||||||
|
kibana: [],
|
||||||
|
},
|
||||||
|
|
||||||
animals: {
|
animals: {
|
||||||
elasticsearch: {
|
elasticsearch: {
|
||||||
cluster: [],
|
cluster: [],
|
||||||
|
|
Loading…
Reference in a new issue