From 4348c067ba9f4c2bcb20a0e351fbb96b0dc40de1 Mon Sep 17 00:00:00 2001 From: Bhavya RM Date: Thu, 4 Feb 2021 11:04:30 -0500 Subject: [PATCH] Test user for maps tests under import geoJSON tests (#86015) test user assignment for test files under import geoJSON files Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../import_geojson/add_layer_import_panel.js | 8 ++++++- .../import_geojson/file_indexing_panel.js | 9 ++++++++ x-pack/test/functional/config.js | 22 +++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/x-pack/test/functional/apps/maps/import_geojson/add_layer_import_panel.js b/x-pack/test/functional/apps/maps/import_geojson/add_layer_import_panel.js index 390c7af98c653..46b87b1c4195c 100644 --- a/x-pack/test/functional/apps/maps/import_geojson/add_layer_import_panel.js +++ b/x-pack/test/functional/apps/maps/import_geojson/add_layer_import_panel.js @@ -8,18 +8,24 @@ import expect from '@kbn/expect'; import path from 'path'; -export default function ({ getPageObjects }) { +export default function ({ getPageObjects, getService }) { const PageObjects = getPageObjects(['maps', 'common']); const IMPORT_FILE_PREVIEW_NAME = 'Import File'; const FILE_LOAD_DIR = 'test_upload_files'; const DEFAULT_LOAD_FILE_NAME = 'point.json'; + const security = getService('security'); describe('GeoJSON import layer panel', () => { before(async () => { + await security.testUser.setRoles(['global_maps_all', 'geoall_data_writer']); await PageObjects.maps.openNewMap(); }); + after(async () => { + await security.testUser.restoreDefaults(); + }); + beforeEach(async () => { await PageObjects.maps.clickAddLayer(); await PageObjects.maps.selectGeoJsonUploadSource(); diff --git a/x-pack/test/functional/apps/maps/import_geojson/file_indexing_panel.js b/x-pack/test/functional/apps/maps/import_geojson/file_indexing_panel.js index ea8366d809fb7..4496b59393eec 100644 --- a/x-pack/test/functional/apps/maps/import_geojson/file_indexing_panel.js +++ b/x-pack/test/functional/apps/maps/import_geojson/file_indexing_panel.js @@ -13,6 +13,7 @@ export default function ({ getService, getPageObjects }) { const PageObjects = getPageObjects(['maps', 'common']); const testSubjects = getService('testSubjects'); const log = getService('log'); + const security = getService('security'); const IMPORT_FILE_PREVIEW_NAME = 'Import File'; const FILE_LOAD_DIR = 'test_upload_files'; @@ -37,9 +38,17 @@ export default function ({ getService, getPageObjects }) { describe('On GeoJSON index name & pattern operation complete', () => { before(async () => { + await security.testUser.setRoles( + ['global_maps_all', 'geoall_data_writer', 'global_index_pattern_management_all'], + false + ); await PageObjects.maps.openNewMap(); }); + after(async () => { + await security.testUser.restoreDefaults(); + }); + beforeEach(async () => { await PageObjects.maps.clickAddLayer(); await PageObjects.maps.selectGeoJsonUploadSource(); diff --git a/x-pack/test/functional/config.js b/x-pack/test/functional/config.js index de3b59345f59f..3a12d23d2d1ad 100644 --- a/x-pack/test/functional/config.js +++ b/x-pack/test/functional/config.js @@ -376,6 +376,28 @@ export default async function ({ readConfigFile }) { }, }, + geoall_data_writer: { + elasticsearch: { + indices: [ + { + names: ['*'], + privileges: ['create', 'read', 'view_index_metadata', 'monitor', 'create_index'], + }, + ], + }, + }, + + global_index_pattern_management_all: { + kibana: [ + { + feature: { + indexPatterns: ['all'], + }, + spaces: ['*'], + }, + ], + }, + global_devtools_read: { kibana: [ {