From 7079fe15cb06ddafd34929da21880be10f06712a Mon Sep 17 00:00:00 2001 From: Rashmi Kulkarni Date: Wed, 25 Mar 2020 12:16:49 -0700 Subject: [PATCH] changes to the test_api_keys role --- x-pack/test/functional/apps/api_keys/home_page.ts | 2 +- x-pack/test/functional/config.js | 9 +++++++++ x-pack/test/functional/page_objects/api_keys_page.ts | 4 +--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/x-pack/test/functional/apps/api_keys/home_page.ts b/x-pack/test/functional/apps/api_keys/home_page.ts index e4452e3a5e383..1c83a17e78ca7 100644 --- a/x-pack/test/functional/apps/api_keys/home_page.ts +++ b/x-pack/test/functional/apps/api_keys/home_page.ts @@ -31,7 +31,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { }); it('Loads the app', async () => { - await security.testUser.setRoles(['kibana_admin', 'test_api_keys']); + await security.testUser.setRoles(['test_api_keys']); log.debug('Checking for section header'); const headerText = await pageObjects.apiKeys.noAPIKeysHeading(); expect(headerText).to.be('No API keys'); diff --git a/x-pack/test/functional/config.js b/x-pack/test/functional/config.js index a807a77f90638..cff555feace18 100644 --- a/x-pack/test/functional/config.js +++ b/x-pack/test/functional/config.js @@ -234,10 +234,19 @@ export default async function({ readConfigFile }) { kibana: [], }, + //Kibana feature privilege isn't specific to advancedSetting. It can be anything. https://github.com/elastic/kibana/issues/35965 test_api_keys: { elasticsearch: { cluster: ['manage_security', 'manage_api_key'], }, + kibana: [ + { + feature: { + advancedSettings: ['read'], + }, + spaces: ['default'], + }, + ], }, }, defaultRoles: ['superuser'], diff --git a/x-pack/test/functional/page_objects/api_keys_page.ts b/x-pack/test/functional/page_objects/api_keys_page.ts index 881d2cdaa3800..b4662fbf01f17 100644 --- a/x-pack/test/functional/page_objects/api_keys_page.ts +++ b/x-pack/test/functional/page_objects/api_keys_page.ts @@ -21,9 +21,7 @@ export function ApiKeysPageProvider({ getService }: FtrProviderContext) { }, async apiKeysPermissionDeniedMessage() { - const messageElement = await testSubjects.find('apiKeysPermissionDeniedMessage'); - const message = await messageElement.getVisibleText(); - return message; + return await testSubjects.getVisibleText('apiKeysPermissionDeniedMessage'); }, }; }