From 553374816224ac901327c9dae5e75b8ffa70b79e Mon Sep 17 00:00:00 2001 From: Dmitry Tomashevich <39378793+Dmitriynj@users.noreply.github.com> Date: Tue, 15 Mar 2022 12:10:18 +0500 Subject: [PATCH] [Discover] Fix "encoded URL params in context page" cloud test permissions (#126470) * [Discover] fix cloud test for encoded param in context * [Discover] improve test description wording * [Discover] apply suggestion Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../apps/discover/_context_encoded_url_param.ts | 12 +++++++----- test/functional/config.js | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/test/functional/apps/discover/_context_encoded_url_param.ts b/test/functional/apps/discover/_context_encoded_url_param.ts index 83ac63afd915f..fdbee7a637f46 100644 --- a/test/functional/apps/discover/_context_encoded_url_param.ts +++ b/test/functional/apps/discover/_context_encoded_url_param.ts @@ -12,30 +12,32 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const dataGrid = getService('dataGrid'); const kibanaServer = getService('kibanaServer'); + const security = getService('security'); const PageObjects = getPageObjects(['common', 'discover', 'timePicker', 'settings', 'header']); const testSubjects = getService('testSubjects'); const es = getService('es'); - describe('context encoded id param', () => { + describe('encoded URL params in context page', () => { before(async function () { + await security.testUser.setRoles(['kibana_admin', 'context_encoded_param']); await PageObjects.common.navigateToApp('settings'); await es.transport.request({ - path: '/includes-plus-symbol-doc-id/_doc/1+1=2', + path: '/context-encoded-param/_doc/1+1=2', method: 'PUT', body: { username: 'Dmitry', '@timestamp': '2015-09-21T09:30:23', }, }); - await PageObjects.settings.createIndexPattern('includes-plus-symbol-doc-id'); + await PageObjects.settings.createIndexPattern('context-encoded-param'); await kibanaServer.uiSettings.update({ 'doc_table:legacy': false }); await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); await PageObjects.common.navigateToApp('discover'); }); - it('should navigate to context page correctly', async () => { - await PageObjects.discover.selectIndexPattern('includes-plus-symbol-doc-id'); + it('should navigate correctly', async () => { + await PageObjects.discover.selectIndexPattern('context-encoded-param'); await PageObjects.header.waitUntilLoadingHasFinished(); // navigate to the context view diff --git a/test/functional/config.js b/test/functional/config.js index 389f432641acf..bfd2da7518fb7 100644 --- a/test/functional/config.js +++ b/test/functional/config.js @@ -216,6 +216,21 @@ export default async function ({ readConfigFile }) { kibana: [], }, + context_encoded_param: { + elasticsearch: { + cluster: [], + indices: [ + { + names: ['context-encoded-param'], + privileges: ['read', 'view_index_metadata', 'manage', 'create_index', 'index'], + field_security: { grant: ['*'], except: [] }, + }, + ], + run_as: [], + }, + kibana: [], + }, + kibana_sample_read: { elasticsearch: { cluster: [],