diff --git a/x-pack/test/functional/apps/maps/discover.js b/x-pack/test/functional/apps/maps/discover.js index 5f488d917c182..8dbd98ed3af2f 100644 --- a/x-pack/test/functional/apps/maps/discover.js +++ b/x-pack/test/functional/apps/maps/discover.js @@ -9,12 +9,24 @@ import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const queryBar = getService('queryBar'); const PageObjects = getPageObjects(['common', 'discover', 'header', 'maps', 'timePicker']); + const security = getService('security'); describe('discover visualize button', () => { beforeEach(async () => { + await security.testUser.setRoles([ + 'test_logstash_reader', + 'global_maps_all', + 'geoshape_data_reader', + 'global_discover_read', + 'global_visualize_read', + ]); await PageObjects.common.navigateToApp('discover'); }); + after(async () => { + await security.testUser.restoreDefaults(); + }); + it('should link geo_shape fields to Maps application', async () => { await PageObjects.discover.selectIndexPattern('geo_shapes*'); await PageObjects.discover.clickFieldListItemVisualize('geometry'); diff --git a/x-pack/test/functional/apps/maps/index.js b/x-pack/test/functional/apps/maps/index.js index 94c7587decf15..15928170972d9 100644 --- a/x-pack/test/functional/apps/maps/index.js +++ b/x-pack/test/functional/apps/maps/index.js @@ -17,7 +17,7 @@ export default function ({ loadTestFile, getService }) { await esArchiver.load('maps/data'); await esArchiver.load('maps/kibana'); await kibanaServer.uiSettings.replace({ - defaultIndex: 'logstash-*', + defaultIndex: 'c698b940-e149-11e8-a35a-370a8516603a', }); await browser.setWindowSize(1600, 1000); }); diff --git a/x-pack/test/functional/apps/maps/visualize_create_menu.js b/x-pack/test/functional/apps/maps/visualize_create_menu.js index 5a53d3d8b571d..ef39771d6be07 100644 --- a/x-pack/test/functional/apps/maps/visualize_create_menu.js +++ b/x-pack/test/functional/apps/maps/visualize_create_menu.js @@ -6,14 +6,25 @@ import expect from '@kbn/expect'; -export default function ({ getPageObjects }) { +export default function ({ getService, getPageObjects }) { const PageObjects = getPageObjects(['visualize', 'header', 'maps']); + const security = getService('security'); + describe('visualize create menu', () => { before(async () => { + await security.testUser.setRoles( + ['test_logstash_reader', 'global_maps_all', 'geoshape_data_reader', 'global_visualize_all'], + false + ); + await PageObjects.visualize.navigateToNewVisualization(); }); + after(async () => { + await security.testUser.restoreDefaults(); + }); + it('should show maps application in create menu', async () => { const hasMapsApp = await PageObjects.visualize.hasMapsApp(); expect(hasMapsApp).to.equal(true); diff --git a/x-pack/test/functional/config.js b/x-pack/test/functional/config.js index 3eef95b42cb7d..ad65f82d6dfe1 100644 --- a/x-pack/test/functional/config.js +++ b/x-pack/test/functional/config.js @@ -230,6 +230,47 @@ export default async function ({ readConfigFile }) { }, ], }, + global_visualize_read: { + kibana: [ + { + feature: { + visualize: ['read'], + }, + spaces: ['*'], + }, + ], + }, + global_visualize_all: { + kibana: [ + { + feature: { + visualize: ['all'], + }, + spaces: ['*'], + }, + ], + }, + global_maps_all: { + kibana: [ + { + feature: { + maps: ['all'], + }, + spaces: ['*'], + }, + ], + }, + + geoshape_data_reader: { + elasticsearch: { + indices: [ + { + names: ['geo_shapes*'], + privileges: ['read', 'view_index_metadata'], + }, + ], + }, + }, global_devtools_read: { kibana: [