Skip to content

Commit 94a18fd

Browse files
authored
Adding test user to maps functional tests - PR 1 (#70649)
adding test user to pr 1 of maps functional tests.
1 parent 7debf4d commit 94a18fd

File tree

4 files changed

+66
-2
lines changed

4 files changed

+66
-2
lines changed

x-pack/test/functional/apps/maps/discover.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,24 @@ import expect from '@kbn/expect';
99
export default function ({ getService, getPageObjects }) {
1010
const queryBar = getService('queryBar');
1111
const PageObjects = getPageObjects(['common', 'discover', 'header', 'maps', 'timePicker']);
12+
const security = getService('security');
1213

1314
describe('discover visualize button', () => {
1415
beforeEach(async () => {
16+
await security.testUser.setRoles([
17+
'test_logstash_reader',
18+
'global_maps_all',
19+
'geoshape_data_reader',
20+
'global_discover_read',
21+
'global_visualize_read',
22+
]);
1523
await PageObjects.common.navigateToApp('discover');
1624
});
1725

26+
after(async () => {
27+
await security.testUser.restoreDefaults();
28+
});
29+
1830
it('should link geo_shape fields to Maps application', async () => {
1931
await PageObjects.discover.selectIndexPattern('geo_shapes*');
2032
await PageObjects.discover.clickFieldListItemVisualize('geometry');

x-pack/test/functional/apps/maps/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function ({ loadTestFile, getService }) {
1717
await esArchiver.load('maps/data');
1818
await esArchiver.load('maps/kibana');
1919
await kibanaServer.uiSettings.replace({
20-
defaultIndex: 'logstash-*',
20+
defaultIndex: 'c698b940-e149-11e8-a35a-370a8516603a',
2121
});
2222
await browser.setWindowSize(1600, 1000);
2323
});

x-pack/test/functional/apps/maps/visualize_create_menu.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,25 @@
66

77
import expect from '@kbn/expect';
88

9-
export default function ({ getPageObjects }) {
9+
export default function ({ getService, getPageObjects }) {
1010
const PageObjects = getPageObjects(['visualize', 'header', 'maps']);
1111

12+
const security = getService('security');
13+
1214
describe('visualize create menu', () => {
1315
before(async () => {
16+
await security.testUser.setRoles(
17+
['test_logstash_reader', 'global_maps_all', 'geoshape_data_reader', 'global_visualize_all'],
18+
false
19+
);
20+
1421
await PageObjects.visualize.navigateToNewVisualization();
1522
});
1623

24+
after(async () => {
25+
await security.testUser.restoreDefaults();
26+
});
27+
1728
it('should show maps application in create menu', async () => {
1829
const hasMapsApp = await PageObjects.visualize.hasMapsApp();
1930
expect(hasMapsApp).to.equal(true);

x-pack/test/functional/config.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,47 @@ export default async function ({ readConfigFile }) {
230230
},
231231
],
232232
},
233+
global_visualize_read: {
234+
kibana: [
235+
{
236+
feature: {
237+
visualize: ['read'],
238+
},
239+
spaces: ['*'],
240+
},
241+
],
242+
},
243+
global_visualize_all: {
244+
kibana: [
245+
{
246+
feature: {
247+
visualize: ['all'],
248+
},
249+
spaces: ['*'],
250+
},
251+
],
252+
},
253+
global_maps_all: {
254+
kibana: [
255+
{
256+
feature: {
257+
maps: ['all'],
258+
},
259+
spaces: ['*'],
260+
},
261+
],
262+
},
263+
264+
geoshape_data_reader: {
265+
elasticsearch: {
266+
indices: [
267+
{
268+
names: ['geo_shapes*'],
269+
privileges: ['read', 'view_index_metadata'],
270+
},
271+
],
272+
},
273+
},
233274

234275
global_devtools_read: {
235276
kibana: [

0 commit comments

Comments
 (0)