From 21c7eca6ca50a1d2035b00dca08f780c9c53f0f8 Mon Sep 17 00:00:00 2001 From: Bhavya RM Date: Thu, 4 Feb 2021 16:11:12 -0500 Subject: [PATCH] Test user for maps tests under import geoJSON tests (#86015) (#90310) --- .../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 390c7af98c653e..46b87b1c4195c3 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 ea8366d809fb78..4496b59393eece 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 de3b59345f59f8..3a12d23d2d1ad4 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: [ {