diff --git a/test/functional/apps/console/_console.ts b/test/functional/apps/console/_console.ts index 0878442156ab7..57aab9b80bb66 100644 --- a/test/functional/apps/console/_console.ts +++ b/test/functional/apps/console/_console.ts @@ -28,6 +28,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const browser = getService('browser'); const PageObjects = getPageObjects(['common', 'console', 'header']); const toasts = getService('toasts'); + const security = getService('security'); + const testSubjects = getService('testSubjects'); describe('console app', function describeIndexTests() { this.tags('includeFirefox'); @@ -151,7 +153,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.console.clickPlay(); }; + before(async () => { + await security.testUser.setRoles(['kibana_admin', 'test_index']); + }); + + after(async () => { + await security.testUser.restoreDefaults(); + }); + beforeEach(async () => { + // Welcome fly out exists sometimes + const flyOutExists = await testSubjects.exists('euiFlyoutCloseButton'); + if (flyOutExists) { + await testSubjects.click('euiFlyoutCloseButton'); + } await PageObjects.console.clearTextArea(); }); @@ -160,8 +175,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await retry.try(async () => { const response = await PageObjects.console.getResponse(); log.debug(response); - expect(response).to.contain('# PUT test-index 200 OK'); - expect(response).to.contain('# DELETE test-index 200 OK'); + expect(response).to.contain('# PUT test-index 200'); + expect(response).to.contain('# DELETE test-index 200'); }); }); diff --git a/test/functional/apps/console/_vector_tile.ts b/test/functional/apps/console/_vector_tile.ts index 3959877fdf685..77b186227ed28 100644 --- a/test/functional/apps/console/_vector_tile.ts +++ b/test/functional/apps/console/_vector_tile.ts @@ -12,9 +12,11 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const PageObjects = getPageObjects(['common', 'console', 'header', 'home']); const retry = getService('retry'); + const security = getService('security'); describe('console vector tiles response validation', function describeIndexTests() { before(async () => { + await security.testUser.setRoles(['kibana_admin', 'kibana_sample_admin']); await PageObjects.common.navigateToUrl('home', '/tutorial_directory/sampleData', { useActualUrl: true, }); @@ -41,6 +43,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.home.removeSampleDataSet('logs'); + await security.testUser.restoreDefaults(); }); }); } diff --git a/test/functional/config.base.js b/test/functional/config.base.js index dd576cbbd4f49..d543f13755cce 100644 --- a/test/functional/config.base.js +++ b/test/functional/config.base.js @@ -249,6 +249,21 @@ export default async function ({ readConfigFile }) { kibana: [], }, + test_index: { + elasticsearch: { + cluster: [], + indices: [ + { + names: ['test-index'], + privileges: ['read', 'view_index_metadata', 'manage', 'create_index', 'index'], + field_security: { grant: ['*'], except: [] }, + }, + ], + run_as: [], + }, + kibana: [], + }, + index_a: { elasticsearch: { cluster: [],