Skip to content

Commit 50072de

Browse files
authored
Adding test user to maps tests under documents source folder (#77245) (#77537)
1 parent af3d7c9 commit 50072de

File tree

4 files changed

+57
-0
lines changed

4 files changed

+57
-0
lines changed

x-pack/test/functional/apps/maps/documents_source/docvalue_fields.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,18 @@ export default function ({ getPageObjects, getService }) {
1010
const PageObjects = getPageObjects(['maps']);
1111
const inspector = getService('inspector');
1212
const testSubjects = getService('testSubjects');
13+
const security = getService('security');
1314

1415
describe('docvalue_fields', () => {
1516
before(async () => {
17+
await security.testUser.setRoles(['global_maps_read', 'test_logstash_reader'], false);
1618
await PageObjects.maps.loadSavedMap('document example');
1719
});
1820

21+
after(async () => {
22+
await security.testUser.restoreDefaults();
23+
});
24+
1925
async function getResponse() {
2026
await inspector.open();
2127
await inspector.openInspectorRequestsView();

x-pack/test/functional/apps/maps/documents_source/search_hits.js

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

1314
describe('search hits', () => {
1415
before(async () => {
16+
await security.testUser.setRoles(
17+
[
18+
'global_maps_all',
19+
'test_logstash_reader',
20+
'antimeridian_points_reader',
21+
'antimeridian_shapes_reader',
22+
],
23+
false
24+
);
1525
await PageObjects.maps.loadSavedMap('document example');
1626
});
1727

28+
after(async () => {
29+
await security.testUser.restoreDefaults();
30+
});
31+
1832
async function getRequestTimestamp() {
1933
await inspector.open();
2034
await inspector.openInspectorRequestsView();

x-pack/test/functional/apps/maps/documents_source/top_hits.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,19 @@ export default function ({ getPageObjects, getService }) {
1212
const PageObjects = getPageObjects(['maps', 'common']);
1313
const inspector = getService('inspector');
1414
const find = getService('find');
15+
const security = getService('security');
1516

1617
describe('geo top hits', () => {
1718
describe('split on string field', () => {
1819
before(async () => {
20+
await security.testUser.setRoles(['global_maps_all', 'test_logstash_reader'], false);
1921
await PageObjects.maps.loadSavedMap('document example top hits');
2022
});
2123

24+
after(async () => {
25+
await security.testUser.restoreDefaults();
26+
});
27+
2228
it('should not fetch any search hits', async () => {
2329
await inspector.open();
2430
await inspector.openInspectorRequestsView();

x-pack/test/functional/config.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,17 @@ export default async function ({ readConfigFile }) {
287287
],
288288
},
289289

290+
global_maps_read: {
291+
kibana: [
292+
{
293+
feature: {
294+
maps: ['read'],
295+
},
296+
spaces: ['*'],
297+
},
298+
],
299+
},
300+
290301
geoshape_data_reader: {
291302
elasticsearch: {
292303
indices: [
@@ -297,6 +308,26 @@ export default async function ({ readConfigFile }) {
297308
],
298309
},
299310
},
311+
antimeridian_points_reader: {
312+
elasticsearch: {
313+
indices: [
314+
{
315+
names: ['antimeridian_points*'],
316+
privileges: ['read', 'view_index_metadata'],
317+
},
318+
],
319+
},
320+
},
321+
antimeridian_shapes_reader: {
322+
elasticsearch: {
323+
indices: [
324+
{
325+
names: ['antimeridian_shapes*'],
326+
privileges: ['read', 'view_index_metadata'],
327+
},
328+
],
329+
},
330+
},
300331

301332
geoconnections_data_reader: {
302333
elasticsearch: {

0 commit comments

Comments
 (0)