-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
x-pack/test/functional/apps/maps/embeddable/filter_by_map_extent.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
export default function ({ getPageObjects, getService }) { | ||
const PageObjects = getPageObjects(['common', 'dashboard', 'header', 'lens', 'maps']); | ||
|
||
const testSubjects = getService('testSubjects'); | ||
const dashboardPanelActions = getService('dashboardPanelActions'); | ||
const security = getService('security'); | ||
|
||
describe('filter by map extent', () => { | ||
before(async () => { | ||
await security.testUser.setRoles( | ||
['test_logstash_reader', 'global_maps_all', 'global_dashboard_all'], | ||
false | ||
); | ||
await PageObjects.common.navigateToApp('dashboard'); | ||
await PageObjects.dashboard.gotoDashboardEditMode('filter by map extent dashboard'); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
await PageObjects.dashboard.waitForRenderComplete(); | ||
}); | ||
|
||
after(async () => { | ||
await security.testUser.restoreDefaults(); | ||
}); | ||
|
||
it('should not filter dashboard by map extent before "filter by map extent" is enabled', async () => { | ||
await PageObjects.lens.assertMetric('Count of records', '6'); | ||
}); | ||
|
||
it('should filter dashboard by map extent when "filter by map extent" is enabled', async () => { | ||
const mapPanelHeader = await dashboardPanelActions.getPanelHeading('document example'); | ||
await dashboardPanelActions.openContextMenuMorePanel(mapPanelHeader); | ||
await await testSubjects.click('embeddablePanelAction-FILTER_BY_MAP_EXTENT'); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
|
||
await PageObjects.lens.assertMetric('Count of records', '1'); | ||
}); | ||
|
||
it('should filter dashboard by new map extent when map is moved', async () => { | ||
await PageObjects.maps.setView(32.95539, -93.93054, 5); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
await PageObjects.lens.assertMetric('Count of records', '2'); | ||
}); | ||
|
||
it('should remove map extent filter dashboard when "filter by map extent" is disabled', async () => { | ||
const mapPanelHeader = await dashboardPanelActions.getPanelHeading('document example'); | ||
await dashboardPanelActions.openContextMenuMorePanel(mapPanelHeader); | ||
await await testSubjects.click('embeddablePanelAction-FILTER_BY_MAP_EXTENT'); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
await PageObjects.lens.assertMetric('Count of records', '6'); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters