Test user assignment to maps tests - 2 (#75890)

and removing unused data from fullscreen maps.js
This commit is contained in:
Bhavya RM 2020-08-27 12:03:53 -04:00 committed by GitHub
parent 3541e779c6
commit d556c79481
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 39 additions and 3 deletions

View file

@ -9,17 +9,23 @@ import expect from '@kbn/expect';
export default function ({ getService, getPageObjects }) {
const testSubjects = getService('testSubjects');
const PageObjects = getPageObjects(['maps']);
const security = getService('security');
describe('Add layer panel', () => {
const LAYER_NAME = 'World Countries';
before(async () => {
await security.testUser.setRoles(['global_maps_all']);
await PageObjects.maps.openNewMap();
await PageObjects.maps.clickAddLayer();
await PageObjects.maps.selectEMSBoundariesSource();
await PageObjects.maps.selectVectorLayer(LAYER_NAME);
});
after(async () => {
await security.testUser.restoreDefaults();
});
it('should show unsaved layer in layer TOC', async () => {
const vectorLayerExists = await PageObjects.maps.doesLayerExist(LAYER_NAME);
expect(vectorLayerExists).to.be(true);

View file

@ -9,12 +9,22 @@ import expect from '@kbn/expect';
export default function ({ getPageObjects, getService }) {
const PageObjects = getPageObjects(['maps']);
const inspector = getService('inspector');
const security = getService('security');
describe('blended vector layer', () => {
before(async () => {
await security.testUser.setRoles(['test_logstash_reader', 'global_maps_all']);
await PageObjects.maps.loadSavedMap('blended document example');
});
afterEach(async () => {
await inspector.close();
});
after(async () => {
await security.testUser.restoreDefaults();
});
it('should request documents when zoomed to smaller regions showing less data', async () => {
const hits = await PageObjects.maps.getHits();
expect(hits).to.equal('33');

View file

@ -9,13 +9,16 @@ import expect from '@kbn/expect';
export default function ({ getService, getPageObjects }) {
const PageObjects = getPageObjects(['maps', 'common']);
const retry = getService('retry');
const esArchiver = getService('esArchiver');
const security = getService('security');
describe('maps full screen mode', () => {
before(async () => {
await esArchiver.loadIfNeeded('maps/data');
await security.testUser.setRoles(['global_maps_all']);
await PageObjects.maps.openNewMap();
});
after(async () => {
await security.testUser.restoreDefaults();
});
it('full screen button should exist', async () => {
const exists = await PageObjects.maps.fullScreenModeMenuItemExists();

View file

@ -9,14 +9,17 @@ import expect from '@kbn/expect';
export default function ({ getPageObjects, getService }) {
const PageObjects = getPageObjects(['maps']);
const inspector = getService('inspector');
const security = getService('security');
describe('layer visibility', () => {
before(async () => {
await security.testUser.setRoles(['test_logstash_reader', 'global_maps_all']);
await PageObjects.maps.loadSavedMap('document example hidden');
});
afterEach(async () => {
await inspector.close();
await security.testUser.restoreDefaults();
});
it('should not make any requests when layer is hidden', async () => {

View file

@ -12,6 +12,7 @@ export default function ({ getPageObjects, getService }) {
const filterBar = getService('filterBar');
const browser = getService('browser');
const inspector = getService('inspector');
const security = getService('security');
describe('map saved object management', () => {
const MAP_NAME_PREFIX = 'saved_object_management_test_';
@ -20,8 +21,16 @@ export default function ({ getPageObjects, getService }) {
describe('read', () => {
before(async () => {
await security.testUser.setRoles([
'global_maps_all',
'geoshape_data_reader',
'test_logstash_reader',
]);
await PageObjects.maps.loadSavedMap('join example');
});
after(async () => {
await security.testUser.restoreDefaults();
});
it('should update global Kibana time to value stored with map', async () => {
const timeConfig = await PageObjects.timePicker.getTimeConfig();

View file

@ -6,13 +6,18 @@
import expect from '@kbn/expect';
export default function ({ getPageObjects }) {
export default function ({ getService, getPageObjects }) {
const PageObjects = getPageObjects(['maps']);
const security = getService('security');
describe('vector styling', () => {
before(async () => {
await security.testUser.setRoles(['test_logstash_reader', 'global_maps_all']);
await PageObjects.maps.loadSavedMap('document example');
});
after(async () => {
await security.testUser.restoreDefaults();
});
describe('categorical styling', () => {
before(async () => {