Skip to content

Commit

Permalink
adding test user to maps functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bhavyarm committed Sep 9, 2020
1 parent 4356174 commit 77f05b8
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
12 changes: 12 additions & 0 deletions x-pack/test/functional/apps/maps/es_geo_grid_source.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,25 @@ export default function ({ getPageObjects, getService }) {
const PageObjects = getPageObjects(['maps']);
const inspector = getService('inspector');
const DOC_COUNT_PROP_NAME = 'doc_count';
const security = getService('security');

describe('layer geo grid aggregation source', () => {
const EXPECTED_NUMBER_FEATURES_ZOOMED_OUT = 4;
const EXPECTED_NUMBER_FEATURES_ZOOMED_IN = 6;
const DATA_CENTER_LON = -98;
const DATA_CENTER_LAT = 38;

before(async () => {
await security.testUser.setRoles(
['global_maps_all', 'test_logstash_reader', 'geoshape_data_reader'],
false
);
});

after(async () => {
await security.testUser.restoreDefaults();
});

async function getRequestTimestamp() {
await inspector.open();
await inspector.openInspectorRequestsView();
Expand Down
6 changes: 6 additions & 0 deletions x-pack/test/functional/apps/maps/joins.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,20 @@ const TOO_MANY_FEATURES_LAYER_INDEX = 4;
export default function ({ getPageObjects, getService }) {
const PageObjects = getPageObjects(['maps']);
const inspector = getService('inspector');
const security = getService('security');

describe('layer with joins', () => {
before(async () => {
await security.testUser.setRoles(
['global_maps_all', 'geoshape_data_reader', 'meta_for_geoshape_data_reader'],
false
);
await PageObjects.maps.loadSavedMap('join example');
});

after(async () => {
await inspector.close();
await security.testUser.restoreDefaults();
});

it('should re-fetch join with refresh timer', async () => {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/functional/apps/maps/mvt_scaling.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function ({ getPageObjects, getService }) {

describe('mvt geoshape layer', () => {
before(async () => {
await security.testUser.setRoles(['global_maps_all', 'geoshape_data_reader']);
await security.testUser.setRoles(['global_maps_all', 'geoshape_data_reader'], false);
await PageObjects.maps.loadSavedMap('geo_shape_mvt');
});

Expand Down
11 changes: 11 additions & 0 deletions x-pack/test/functional/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,17 @@ export default async function ({ readConfigFile }) {
},
},

meta_for_geoshape_data_reader: {
elasticsearch: {
indices: [
{
names: ['meta_for_geo_shapes*'],
privileges: ['read', 'view_index_metadata'],
},
],
},
},

geoconnections_data_reader: {
elasticsearch: {
indices: [
Expand Down

0 comments on commit 77f05b8

Please sign in to comment.