Skip to content

Commit

Permalink
Test user for maps tests under import geoJSON tests (#86015)
Browse files Browse the repository at this point in the history
test user assignment for test files under import geoJSON files

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
bhavyarm and kibanamachine authored Feb 4, 2021
1 parent 1741cef commit e676617
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,24 @@
import expect from '@kbn/expect';
import path from 'path';

export default function ({ getPageObjects }) {
export default function ({ getPageObjects, getService }) {
const PageObjects = getPageObjects(['maps', 'common']);

const IMPORT_FILE_PREVIEW_NAME = 'Import File';
const FILE_LOAD_DIR = 'test_upload_files';
const DEFAULT_LOAD_FILE_NAME = 'point.json';
const security = getService('security');

describe('GeoJSON import layer panel', () => {
before(async () => {
await security.testUser.setRoles(['global_maps_all', 'geoall_data_writer']);
await PageObjects.maps.openNewMap();
});

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

beforeEach(async () => {
await PageObjects.maps.clickAddLayer();
await PageObjects.maps.selectGeoJsonUploadSource();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default function ({ getService, getPageObjects }) {
const PageObjects = getPageObjects(['maps', 'common']);
const testSubjects = getService('testSubjects');
const log = getService('log');
const security = getService('security');

const IMPORT_FILE_PREVIEW_NAME = 'Import File';
const FILE_LOAD_DIR = 'test_upload_files';
Expand All @@ -37,9 +38,17 @@ export default function ({ getService, getPageObjects }) {

describe('On GeoJSON index name & pattern operation complete', () => {
before(async () => {
await security.testUser.setRoles(
['global_maps_all', 'geoall_data_writer', 'global_index_pattern_management_all'],
false
);
await PageObjects.maps.openNewMap();
});

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

beforeEach(async () => {
await PageObjects.maps.clickAddLayer();
await PageObjects.maps.selectGeoJsonUploadSource();
Expand Down
22 changes: 22 additions & 0 deletions x-pack/test/functional/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,28 @@ export default async function ({ readConfigFile }) {
},
},

geoall_data_writer: {
elasticsearch: {
indices: [
{
names: ['*'],
privileges: ['create', 'read', 'view_index_metadata', 'monitor', 'create_index'],
},
],
},
},

global_index_pattern_management_all: {
kibana: [
{
feature: {
indexPatterns: ['all'],
},
spaces: ['*'],
},
],
},

global_devtools_read: {
kibana: [
{
Expand Down

0 comments on commit e676617

Please sign in to comment.