From 02c2b079f4406a5aab43d8ba63546e72abb189f1 Mon Sep 17 00:00:00 2001 From: bhavyarm Date: Wed, 9 Dec 2020 17:29:07 -0500 Subject: [PATCH 1/6] test user assignment for files under import geoJSON tests --- .../maps/import_geojson/add_layer_import_panel.js | 8 +++++++- .../apps/maps/import_geojson/file_indexing_panel.js | 6 ++++++ x-pack/test/functional/config.js | 11 +++++++++++ 3 files changed, 24 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 fa6aed063e9a1..1e4a718ca9b95 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 @@ -7,18 +7,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 8cab6386fa491..934d3c0198e4d 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 @@ -12,6 +12,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'; @@ -36,9 +37,14 @@ 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']); 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 814f943a68b05..7bb1a0d3b0361 100644 --- a/x-pack/test/functional/config.js +++ b/x-pack/test/functional/config.js @@ -374,6 +374,17 @@ export default async function ({ readConfigFile }) { }, }, + geoall_data_writer: { + elasticsearch: { + indices: [ + { + names: ['*'], + privileges: ['create', 'read', 'view_index_metadata'], + }, + ], + }, + }, + global_devtools_read: { kibana: [ { From 105c4ba105f59784b05e94904c527c96b7a25095 Mon Sep 17 00:00:00 2001 From: bhavyarm Date: Mon, 14 Dec 2020 13:17:43 -0500 Subject: [PATCH 2/6] figuring out roles for uploading files --- .../apps/maps/import_geojson/file_indexing_panel.js | 2 +- x-pack/test/functional/config.js | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) 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 934d3c0198e4d..f795d17f876ea 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 @@ -37,7 +37,7 @@ 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']); + //await security.testUser.setRoles(['global_maps_all', 'geoall_data_writer', 'global_Index_Pattern_Management_all']); await PageObjects.maps.openNewMap(); }); diff --git a/x-pack/test/functional/config.js b/x-pack/test/functional/config.js index 7bb1a0d3b0361..3d567223d5637 100644 --- a/x-pack/test/functional/config.js +++ b/x-pack/test/functional/config.js @@ -385,6 +385,17 @@ export default async function ({ readConfigFile }) { }, }, + global_Index_Pattern_Management_all: { + kibana: [ + { + feature: { + indexPatterns: ['all'], + }, + spaces: ['*'], + }, + ], + }, + global_devtools_read: { kibana: [ { From 73c565286c4c7a5bc7f9ee8caff2016cccbac11c Mon Sep 17 00:00:00 2001 From: bhavyarm Date: Mon, 14 Dec 2020 14:32:02 -0500 Subject: [PATCH 3/6] undo commenting out user role --- .../apps/maps/import_geojson/file_indexing_panel.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 f795d17f876ea..102d2c4620aa1 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 @@ -37,7 +37,11 @@ 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']); + await security.testUser.setRoles([ + 'global_maps_all', + 'geoall_data_writer', + 'global_Index_Pattern_Management_all', + ]); await PageObjects.maps.openNewMap(); }); From cf7b8eb5ba38c284d4ddd65161fe4779714862f3 Mon Sep 17 00:00:00 2001 From: bhavyarm Date: Mon, 14 Dec 2020 15:05:20 -0500 Subject: [PATCH 4/6] casing the role name --- .../functional/apps/maps/import_geojson/file_indexing_panel.js | 2 +- x-pack/test/functional/config.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 102d2c4620aa1..9a24f74f7fc7f 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 @@ -40,7 +40,7 @@ export default function ({ getService, getPageObjects }) { await security.testUser.setRoles([ 'global_maps_all', 'geoall_data_writer', - 'global_Index_Pattern_Management_all', + 'global_index_pattern_management_all', ]); await PageObjects.maps.openNewMap(); }); diff --git a/x-pack/test/functional/config.js b/x-pack/test/functional/config.js index 3d567223d5637..527a8f53dfb80 100644 --- a/x-pack/test/functional/config.js +++ b/x-pack/test/functional/config.js @@ -385,7 +385,7 @@ export default async function ({ readConfigFile }) { }, }, - global_Index_Pattern_Management_all: { + global_index_pattern_management_all: { kibana: [ { feature: { From 5a379e27ce28e15c8c1c7cdae9c6f100eb4e19cc Mon Sep 17 00:00:00 2001 From: bhavyarm Date: Mon, 14 Dec 2020 16:32:12 -0500 Subject: [PATCH 5/6] role debugging --- .../functional/apps/maps/import_geojson/file_indexing_panel.js | 1 + 1 file changed, 1 insertion(+) 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 9a24f74f7fc7f..b3c51a13c213f 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 @@ -41,6 +41,7 @@ export default function ({ getService, getPageObjects }) { 'global_maps_all', 'geoall_data_writer', 'global_index_pattern_management_all', + 'global_dashboard_all', ]); await PageObjects.maps.openNewMap(); }); From 0ca0c31bc1a094abd22a6b37e68555e63dc1bdf3 Mon Sep 17 00:00:00 2001 From: bhavyarm Date: Tue, 15 Dec 2020 15:02:05 -0500 Subject: [PATCH 6/6] adding test user to maps tests under import JSON folder --- .../apps/maps/import_geojson/file_indexing_panel.js | 10 ++++------ x-pack/test/functional/config.js | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) 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 b3c51a13c213f..d3601e8b978d7 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 @@ -37,12 +37,10 @@ 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', - 'global_dashboard_all', - ]); + await security.testUser.setRoles( + ['global_maps_all', 'geoall_data_writer', 'global_index_pattern_management_all'], + false + ); await PageObjects.maps.openNewMap(); }); diff --git a/x-pack/test/functional/config.js b/x-pack/test/functional/config.js index 527a8f53dfb80..9ad264deef9c4 100644 --- a/x-pack/test/functional/config.js +++ b/x-pack/test/functional/config.js @@ -379,7 +379,7 @@ export default async function ({ readConfigFile }) { indices: [ { names: ['*'], - privileges: ['create', 'read', 'view_index_metadata'], + privileges: ['create', 'read', 'view_index_metadata', 'monitor', 'create_index'], }, ], },