forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Lens] Keep global filters, time range and refresh interval on refresh (
- Loading branch information
Showing
5 changed files
with
94 additions
and
2 deletions.
There are no files selected for viewing
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
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
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,60 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import _ from 'lodash'; | ||
import expect from '@kbn/expect'; | ||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default function ({ getService, getPageObjects }: FtrProviderContext) { | ||
const PageObjects = getPageObjects(['visualize', 'header', 'timePicker']); | ||
const browser = getService('browser'); | ||
const filterBar = getService('filterBar'); | ||
const appsMenu = getService('appsMenu'); | ||
|
||
describe('lens query context', () => { | ||
it('should carry over time range and pinned filters to discover', async () => { | ||
await PageObjects.visualize.navigateToNewVisualization(); | ||
await PageObjects.visualize.clickVisType('lens'); | ||
await PageObjects.timePicker.setAbsoluteRange( | ||
'Sep 06, 2015 @ 06:31:44.000', | ||
'Sep 18, 2025 @ 06:31:44.000' | ||
); | ||
await filterBar.addFilter('ip', 'is', '97.220.3.248'); | ||
await filterBar.toggleFilterPinned('ip'); | ||
await PageObjects.header.clickDiscover(); | ||
const timeRange = await PageObjects.timePicker.getTimeConfig(); | ||
expect(timeRange.start).to.equal('Sep 6, 2015 @ 06:31:44.000'); | ||
expect(timeRange.end).to.equal('Sep 18, 2025 @ 06:31:44.000'); | ||
await filterBar.hasFilter('ip', '97.220.3.248', true, true); | ||
}); | ||
|
||
it('should remember time range and pinned filters from discover', async () => { | ||
await PageObjects.timePicker.setAbsoluteRange( | ||
'Sep 07, 2015 @ 06:31:44.000', | ||
'Sep 19, 2025 @ 06:31:44.000' | ||
); | ||
await filterBar.toggleFilterEnabled('ip'); | ||
await appsMenu.clickLink('Visualize', { category: 'kibana' }); | ||
await PageObjects.visualize.clickNewVisualization(); | ||
await PageObjects.visualize.waitForVisualizationSelectPage(); | ||
await PageObjects.visualize.clickVisType('lens'); | ||
const timeRange = await PageObjects.timePicker.getTimeConfig(); | ||
expect(timeRange.start).to.equal('Sep 7, 2015 @ 06:31:44.000'); | ||
expect(timeRange.end).to.equal('Sep 19, 2025 @ 06:31:44.000'); | ||
await filterBar.hasFilter('ip', '97.220.3.248', false, true); | ||
}); | ||
|
||
it('keep time range and pinned filters after refresh', async () => { | ||
await browser.refresh(); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
const timeRange = await PageObjects.timePicker.getTimeConfig(); | ||
expect(timeRange.start).to.equal('Sep 7, 2015 @ 06:31:44.000'); | ||
expect(timeRange.end).to.equal('Sep 19, 2025 @ 06:31:44.000'); | ||
await filterBar.hasFilter('ip', '97.220.3.248', false, true); | ||
}); | ||
}); | ||
} |