From 39b163d0c66dea6f4fab9b8735bf6a018aa1ab6c Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Thu, 20 Aug 2020 17:16:41 +0200 Subject: [PATCH] Fixing functional test user roles (#75547) --- test/functional/apps/dashboard/embeddable_rendering.js | 3 +++ test/functional/apps/dashboard/legacy_urls.ts | 3 +++ test/functional/config.js | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/test/functional/apps/dashboard/embeddable_rendering.js b/test/functional/apps/dashboard/embeddable_rendering.js index c00f01d060f4a..73c36c7562e8b 100644 --- a/test/functional/apps/dashboard/embeddable_rendering.js +++ b/test/functional/apps/dashboard/embeddable_rendering.js @@ -33,6 +33,7 @@ export default function ({ getService, getPageObjects }) { const esArchiver = getService('esArchiver'); const kibanaServer = getService('kibanaServer'); const pieChart = getService('pieChart'); + const security = getService('security'); const dashboardExpect = getService('dashboardExpect'); const dashboardAddPanel = getService('dashboardAddPanel'); const PageObjects = getPageObjects([ @@ -100,6 +101,7 @@ export default function ({ getService, getPageObjects }) { describe('dashboard embeddable rendering', function describeIndexTests() { before(async () => { + await security.testUser.setRoles(['kibana_admin', 'animals', 'test_logstash_reader']); await esArchiver.load('dashboard/current/kibana'); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', @@ -118,6 +120,7 @@ export default function ({ getService, getPageObjects }) { const currentUrl = await browser.getCurrentUrl(); const newUrl = currentUrl.replace(/\?.*$/, ''); await browser.get(newUrl, false); + await security.testUser.restoreDefaults(); }); it('adding visualizations', async () => { diff --git a/test/functional/apps/dashboard/legacy_urls.ts b/test/functional/apps/dashboard/legacy_urls.ts index e606649c1df9f..6bb8d808e8daa 100644 --- a/test/functional/apps/dashboard/legacy_urls.ts +++ b/test/functional/apps/dashboard/legacy_urls.ts @@ -35,6 +35,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const dashboardAddPanel = getService('dashboardAddPanel'); const listingTable = getService('listingTable'); const esArchiver = getService('esArchiver'); + const security = getService('security'); let kibanaLegacyBaseUrl: string; let kibanaVisualizeBaseUrl: string; @@ -42,6 +43,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('legacy urls', function describeIndexTests() { before(async function () { + await security.testUser.setRoles(['kibana_admin', 'animals']); await esArchiver.load('dashboard/current/kibana'); await PageObjects.common.navigateToApp('dashboard'); await PageObjects.dashboard.clickNewDashboard(); @@ -61,6 +63,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { after(async function () { await PageObjects.dashboard.gotoDashboardLandingPage(); await listingTable.deleteItem('legacyTest', testDashboardId); + await security.testUser.restoreDefaults(); }); describe('kibana link redirect', () => { diff --git a/test/functional/config.js b/test/functional/config.js index 95e0c689089ef..15097d9346471 100644 --- a/test/functional/config.js +++ b/test/functional/config.js @@ -264,7 +264,7 @@ export default async function ({ readConfigFile }) { cluster: [], indices: [ { - names: ['animals-*'], + names: ['animals-*', 'dogbreeds'], privileges: ['read', 'view_index_metadata'], field_security: { grant: ['*'], except: [] }, },