Skip to content

Commit

Permalink
Adding test user to maps tests under documents source folder (#77245) (
Browse files Browse the repository at this point in the history
  • Loading branch information
bhavyarm committed Sep 16, 2020
1 parent af3d7c9 commit 50072de
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,18 @@ export default function ({ getPageObjects, getService }) {
const PageObjects = getPageObjects(['maps']);
const inspector = getService('inspector');
const testSubjects = getService('testSubjects');
const security = getService('security');

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

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

async function getResponse() {
await inspector.open();
await inspector.openInspectorRequestsView();
Expand Down
14 changes: 14 additions & 0 deletions x-pack/test/functional/apps/maps/documents_source/search_hits.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,26 @@ import expect from '@kbn/expect';
export default function ({ getPageObjects, getService }) {
const PageObjects = getPageObjects(['maps']);
const inspector = getService('inspector');
const security = getService('security');

describe('search hits', () => {
before(async () => {
await security.testUser.setRoles(
[
'global_maps_all',
'test_logstash_reader',
'antimeridian_points_reader',
'antimeridian_shapes_reader',
],
false
);
await PageObjects.maps.loadSavedMap('document example');
});

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/documents_source/top_hits.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,19 @@ export default function ({ getPageObjects, getService }) {
const PageObjects = getPageObjects(['maps', 'common']);
const inspector = getService('inspector');
const find = getService('find');
const security = getService('security');

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

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

it('should not fetch any search hits', async () => {
await inspector.open();
await inspector.openInspectorRequestsView();
Expand Down
31 changes: 31 additions & 0 deletions x-pack/test/functional/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,17 @@ export default async function ({ readConfigFile }) {
],
},

global_maps_read: {
kibana: [
{
feature: {
maps: ['read'],
},
spaces: ['*'],
},
],
},

geoshape_data_reader: {
elasticsearch: {
indices: [
Expand All @@ -297,6 +308,26 @@ export default async function ({ readConfigFile }) {
],
},
},
antimeridian_points_reader: {
elasticsearch: {
indices: [
{
names: ['antimeridian_points*'],
privileges: ['read', 'view_index_metadata'],
},
],
},
},
antimeridian_shapes_reader: {
elasticsearch: {
indices: [
{
names: ['antimeridian_shapes*'],
privileges: ['read', 'view_index_metadata'],
},
],
},
},

geoconnections_data_reader: {
elasticsearch: {
Expand Down

0 comments on commit 50072de

Please sign in to comment.