diff --git a/test/functional/apps/dashboard_elements/input_control_vis/input_control_options.ts b/test/functional/apps/dashboard_elements/input_control_vis/input_control_options.ts index cccf19de4070..675f386eea34 100644 --- a/test/functional/apps/dashboard_elements/input_control_vis/input_control_options.ts +++ b/test/functional/apps/dashboard_elements/input_control_vis/input_control_options.ts @@ -28,6 +28,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('input control options', () => { before(async () => { await visualize.initTests(); + await timePicker.resetDefaultAbsoluteRangeViaUiSettings(); await common.navigateToApp('visualize'); await visualize.loadSavedVisualization('input control options', { navigateToVisualize: false, diff --git a/test/functional/page_objects/visualize_page.ts b/test/functional/page_objects/visualize_page.ts index d565c5168641..315ecba11c6d 100644 --- a/test/functional/page_objects/visualize_page.ts +++ b/test/functional/page_objects/visualize_page.ts @@ -41,6 +41,7 @@ export class VisualizePageObject extends FtrService { private readonly elasticChart = this.ctx.getService('elasticChart'); private readonly common = this.ctx.getPageObject('common'); private readonly header = this.ctx.getPageObject('header'); + private readonly timePicker = this.ctx.getPageObject('timePicker'); private readonly visChart = this.ctx.getPageObject('visChart'); private readonly toasts = this.ctx.getService('toasts'); @@ -63,6 +64,7 @@ export class VisualizePageObject extends FtrService { [FORMATS_UI_SETTINGS.FORMAT_BYTES_DEFAULT_PATTERN]: '0,0.[000]b', 'visualization:visualize:legacyHeatmapChartsLibrary': isLegacyChart, 'histogram:maxBars': 100, + 'timepicker:timeDefaults': `{ "from": "${this.timePicker.defaultStartTimeUTC}", "to": "${this.timePicker.defaultEndTimeUTC}"}`, }); } diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/editor_frame.test.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/editor_frame.test.tsx index 7d41e326372e..ad53002a1b0c 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/editor_frame.test.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/editor_frame.test.tsx @@ -5,20 +5,12 @@ * 2.0. */ -import React, { useEffect } from 'react'; -import { ReactWrapper } from 'enzyme'; +import React from 'react'; import { screen, within } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { EditorFrame, EditorFrameProps } from './editor_frame'; -import { - DatasourceMap, - DatasourcePublicAPI, - DatasourceSuggestion, - Visualization, - VisualizationMap, -} from '../../types'; -import { act } from '@testing-library/react'; +import { DatasourceMap, DatasourcePublicAPI, Visualization, VisualizationMap } from '../../types'; import { coreMock } from '@kbn/core/public/mocks'; import { createMockVisualization, @@ -29,30 +21,16 @@ import { renderWithReduxStore, } from '../../mocks'; import { inspectorPluginMock } from '@kbn/inspector-plugin/public/mocks'; -import { Droppable, useDragDropContext } from '@kbn/dom-drag-drop'; import { uiActionsPluginMock } from '@kbn/ui-actions-plugin/public/mocks'; import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; import { expressionsPluginMock } from '@kbn/expressions-plugin/public/mocks'; -import { mockDataPlugin, mountWithProvider } from '../../mocks'; +import { mockDataPlugin } from '../../mocks'; import { LensAppState, setState } from '../../state_management'; import { getLensInspectorService } from '../../lens_inspector_service'; import { createIndexPatternServiceMock } from '../../mocks/data_views_service_mock'; import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; import { EventAnnotationServiceType } from '@kbn/event-annotation-plugin/public'; -function generateSuggestion(state = {}): DatasourceSuggestion { - return { - state, - table: { - columns: [], - isMultiRow: true, - layerId: 'first', - changeType: 'unchanged', - }, - keptLayerIds: ['first'], - }; -} - function wrapDataViewsContract() { const dataViewsContract = dataViewPluginMocks.createStartContract(); return { @@ -437,180 +415,5 @@ describe('editor_frame', () => { }) ); }); - describe('legacy tests', () => { - let instance: ReactWrapper; - - afterEach(() => { - instance.unmount(); - }); - - it('should use the currently selected visualization if possible on field drop', async () => { - mockDatasource.getLayers.mockReturnValue(['first', 'second', 'third']); - const suggestionVisState = {}; - const props = { - ...getDefaultProps(), - visualizationMap: { - testVis: { - ...mockVisualization, - getSuggestions: () => [ - { - score: 0.2, - state: {}, - title: 'Suggestion1', - previewIcon: 'empty', - }, - { - score: 0.6, - state: suggestionVisState, - title: 'Suggestion2', - previewIcon: 'empty', - }, - ], - }, - testVis2: { - ...mockVisualization2, - getSuggestions: () => [ - { - score: 0.8, - state: {}, - title: 'Suggestion3', - previewIcon: 'empty', - }, - ], - }, - }, - datasourceMap: { - testDatasource: { - ...mockDatasource, - getDatasourceSuggestionsForField: () => [generateSuggestion()], - getDatasourceSuggestionsFromCurrentState: () => [generateSuggestion()], - getDatasourceSuggestionsForVisualizeField: () => [generateSuggestion()], - DataPanelComponent: jest.fn().mockImplementation(() =>
), - }, - }, - } as EditorFrameProps; - instance = ( - await mountWithProvider(, { - preloadedState: { - datasourceStates: { - testDatasource: { - isLoading: false, - state: { - internalState1: '', - }, - }, - }, - }, - }) - ).instance; - - instance.update(); - - act(() => { - instance.find('[data-test-subj="mockVisA"]').find(Droppable).prop('onDrop')!( - { - indexPatternId: '1', - field: {}, - id: '1', - humanData: { label: 'draggedField' }, - }, - 'field_add' - ); - }); - - expect(mockVisualization.getConfiguration).toHaveBeenCalledWith( - expect.objectContaining({ - state: suggestionVisState, - }) - ); - }); - - it('should use the highest priority suggestion available', async () => { - mockDatasource.getLayers.mockReturnValue(['first', 'second', 'third']); - const suggestionVisState = {}; - const mockVisualization3 = { - ...createMockVisualization('testVis3', ['third']), - getSuggestions: () => [ - { - score: 0.9, - state: suggestionVisState, - title: 'Suggestion3', - previewIcon: 'empty', - }, - { - score: 0.7, - state: {}, - title: 'Suggestion4', - previewIcon: 'empty', - }, - ], - }; - - const props = { - ...getDefaultProps(), - visualizationMap: { - testVis: { - ...mockVisualization, - // do not return suggestions for the currently active vis, otherwise it will be chosen - getSuggestions: () => [], - }, - testVis2: { - ...mockVisualization2, - getSuggestions: () => [], - }, - testVis3: { - ...mockVisualization3, - }, - }, - datasourceMap: { - testDatasource: { - ...mockDatasource, - getDatasourceSuggestionsForField: () => [generateSuggestion()], - getDatasourceSuggestionsFromCurrentState: () => [generateSuggestion()], - getDatasourceSuggestionsForVisualizeField: () => [generateSuggestion()], - DataPanelComponent: jest.fn().mockImplementation(() => { - const [, dndDispatch] = useDragDropContext(); - useEffect(() => { - dndDispatch({ - type: 'startDragging', - payload: { - dragging: { - id: 'draggedField', - humanData: { label: '1' }, - }, - }, - }); - }, [dndDispatch]); - return
; - }), - }, - }, - } as EditorFrameProps; - - instance = (await mountWithProvider()).instance; - - instance.update(); - - act(() => { - instance.find(Droppable).filter('[dataTestSubj="lnsWorkspace"]').prop('onDrop')!( - { - indexPatternId: '1', - field: {}, - id: '1', - humanData: { - label: 'label', - }, - }, - 'field_add' - ); - }); - - expect(mockVisualization3.getConfiguration).toHaveBeenCalledWith( - expect.objectContaining({ - state: suggestionVisState, - }) - ); - }); - }); }); }); diff --git a/x-pack/test/functional/apps/lens/group1/smokescreen.ts b/x-pack/test/functional/apps/lens/group1/smokescreen.ts index dbe48cdd395d..68d9f1ee9345 100644 --- a/x-pack/test/functional/apps/lens/group1/smokescreen.ts +++ b/x-pack/test/functional/apps/lens/group1/smokescreen.ts @@ -23,7 +23,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should allow creation of lens xy chart', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', @@ -60,7 +59,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('Afancilenstest'); await lens.clickVisualizeListItemTitle('Afancilenstest'); - await lens.goToTimeRange(); + await lens.waitForVisualization('xyVisChart'); expect(await lens.getTitle()).to.eql('Afancilenstest'); @@ -75,7 +74,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('lnsXYvis'); await lens.clickVisualizeListItemTitle('lnsXYvis'); - await lens.goToTimeRange(); + // Change the IP field to filters await lens.configureDimension({ dimension: 'lnsXY_splitDimensionPanel > lns-dimensionTrigger', @@ -94,7 +93,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('Artistpreviouslyknownaslens'); await lens.clickVisualizeListItemTitle('Artistpreviouslyknownaslens'); - await lens.goToTimeRange(); + await lens.assertLegacyMetric('Maximum of bytes', '19,986'); await lens.switchToVisualization('lnsDatatable'); expect(await lens.getDatatableHeaderText()).to.eql('Maximum of bytes'); @@ -106,7 +105,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should transition from a multi-layer stacked bar to a multi-layer line chart and correctly remove all layers', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', @@ -150,7 +148,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should transition selected layer in a multi layer bar using layer chart switch', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', @@ -197,7 +194,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('lnsXYvis'); await lens.clickVisualizeListItemTitle('lnsXYvis'); - await lens.goToTimeRange(); + await lens.removeDimension('lnsXY_splitDimensionPanel'); await lens.switchToVisualization('line'); await lens.configureDimension({ @@ -255,7 +252,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); await elasticChart.setNewChartUiDebugFlag(true); - await lens.goToTimeRange(); + await lens.switchToVisualization('bar'); await lens.configureDimension({ @@ -323,7 +320,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should transition from a multi-layer stacked bar to treemap chart using suggestions', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', @@ -367,7 +363,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('lnsXYvis'); await lens.clickVisualizeListItemTitle('lnsXYvis'); - await lens.goToTimeRange(); + expect(await lens.hasChartSwitchWarning('pie')).to.eql(true); await lens.switchToVisualization('pie'); @@ -394,7 +390,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('lnsXYvis'); await lens.clickVisualizeListItemTitle('lnsXYvis'); - await lens.goToTimeRange(); + await lens.switchToVisualization('line'); expect(await lens.getTitle()).to.eql('lnsXYvis'); expect(await lens.getDimensionTriggerText('lnsXY_xDimensionPanel')).to.eql('@timestamp'); @@ -410,7 +406,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('lnsPieVis'); await lens.clickVisualizeListItemTitle('lnsPieVis'); - await lens.goToTimeRange(); + expect(await lens.hasChartSwitchWarning('treemap')).to.eql(false); await lens.switchToVisualization('treemap'); expect(await lens.getDimensionTriggersTexts('lnsPie_groupByDimensionPanel')).to.eql([ @@ -425,7 +421,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should create a pie chart and switch to datatable', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); + await lens.switchToVisualization('pie'); await lens.configureDimension({ dimension: 'lnsPie_sliceByDimensionPanel > lns-empty-dimension', @@ -452,7 +448,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should create a heatmap chart and transition to barchart', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); + await lens.switchToVisualization('heatmap', 'heat'); await lens.configureDimension({ @@ -482,7 +478,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should create a valid XY chart with references', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', @@ -517,7 +512,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should allow formatting on references', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); + await lens.switchToVisualization('lnsDatatable'); await lens.configureDimension({ @@ -563,7 +558,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should handle edge cases in reference-based operations', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', @@ -596,7 +590,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should keep the field selection while transitioning to every reference-based operation', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', @@ -633,7 +626,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should not leave an incomplete column in the visualization config with field-based operation', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_yDimensionPanel > lns-empty-dimension', @@ -646,7 +638,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should revert to previous configuration and not leave an incomplete column in the visualization config with reference-based operations', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', @@ -682,7 +673,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should transition from unique count to last value', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_yDimensionPanel > lns-empty-dimension', @@ -715,7 +705,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should allow filtering by legend on an xy chart', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', @@ -745,7 +734,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should allow filtering by legend on a pie chart', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); + await lens.switchToVisualization('pie'); await lens.configureDimension({ diff --git a/x-pack/test/functional/apps/lens/group2/field_formatters.ts b/x-pack/test/functional/apps/lens/group2/field_formatters.ts index 33c2c02e7b37..e5fe83c72cc4 100644 --- a/x-pack/test/functional/apps/lens/group2/field_formatters.ts +++ b/x-pack/test/functional/apps/lens/group2/field_formatters.ts @@ -20,7 +20,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { before(async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.switchToVisualization('lnsDatatable'); }); @@ -115,7 +114,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { before(async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.switchToVisualization('lnsDatatable'); }); @@ -189,7 +187,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { before(async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.switchToVisualization('lnsDatatable'); }); diff --git a/x-pack/test/functional/apps/lens/group2/fields_list.ts b/x-pack/test/functional/apps/lens/group2/fields_list.ts index b08538829b13..73e6a6035ca5 100644 --- a/x-pack/test/functional/apps/lens/group2/fields_list.ts +++ b/x-pack/test/functional/apps/lens/group2/fields_list.ts @@ -262,6 +262,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { path: '/field-update-test', method: 'DELETE', }); + await timePicker.setDefaultAbsoluteRangeViaUiSettings(); }); it('should show new fields Available fields', async () => { diff --git a/x-pack/test/functional/apps/lens/group2/index.ts b/x-pack/test/functional/apps/lens/group2/index.ts index 8d74dd4930b8..790e42162dc7 100644 --- a/x-pack/test/functional/apps/lens/group2/index.ts +++ b/x-pack/test/functional/apps/lens/group2/index.ts @@ -36,22 +36,21 @@ export default ({ getService, loadTestFile, getPageObjects }: FtrProviderContext fixtureDirs = localFixtures; indexPatternString = localIndexPatternString; await esNode.load(esArchive); - // changing the timepicker default here saves us from having to set it in Discover (~8s) - await timePicker.setDefaultAbsoluteRangeViaUiSettings(); await kibanaServer.uiSettings.update({ defaultIndex: indexPatternString, 'dateFormat:tz': 'UTC', }); await kibanaServer.importExport.load(fixtureDirs.lensBasic); await kibanaServer.importExport.load(fixtureDirs.lensDefault); + await timePicker.setDefaultAbsoluteRangeViaUiSettings(); }); after(async () => { await esNode.unload(esArchive); - await timePicker.resetDefaultAbsoluteRangeViaUiSettings(); await kibanaServer.importExport.unload(fixtureDirs.lensBasic); await kibanaServer.importExport.unload(fixtureDirs.lensDefault); await kibanaServer.savedObjects.cleanStandardList(); + await timePicker.resetDefaultAbsoluteRangeViaUiSettings(); }); // total run time ~ 16m 20s diff --git a/x-pack/test/functional/apps/lens/group2/layer_actions.ts b/x-pack/test/functional/apps/lens/group2/layer_actions.ts index cc301c2dd57e..4417a5ecbade 100644 --- a/x-pack/test/functional/apps/lens/group2/layer_actions.ts +++ b/x-pack/test/functional/apps/lens/group2/layer_actions.ts @@ -18,7 +18,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should allow creation of lens xy chart', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); // check that no sampling info is shown in the dataView picker expect(await testSubjects.exists('lnsChangeIndexPatternSamplingInfo')).to.be(false); @@ -188,7 +187,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should show visualization modifiers for layer settings when embedded in a dashboard', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); // click on open layer settings await lens.openLayerContextMenu(); await testSubjects.click('lnsLayerSettings'); diff --git a/x-pack/test/functional/apps/lens/group2/partition.ts b/x-pack/test/functional/apps/lens/group2/partition.ts index f828c65eab28..a6a65fdac2aa 100644 --- a/x-pack/test/functional/apps/lens/group2/partition.ts +++ b/x-pack/test/functional/apps/lens/group2/partition.ts @@ -16,7 +16,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { before(async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); }); it('should be able to nest up to 3 levels for Pie charts', async () => { diff --git a/x-pack/test/functional/apps/lens/group2/persistent_context.ts b/x-pack/test/functional/apps/lens/group2/persistent_context.ts index 0d34b0f68564..6a6f56578882 100644 --- a/x-pack/test/functional/apps/lens/group2/persistent_context.ts +++ b/x-pack/test/functional/apps/lens/group2/persistent_context.ts @@ -42,7 +42,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { before(async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await navigationalSearch.focus(); await navigationalSearch.searchFor('type:lens lnsTableVis'); await navigationalSearch.clickOnOption(0); @@ -74,7 +73,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('lnsTableVis'); await lens.clickVisualizeListItemTitle('lnsTableVis'); - await lens.goToTimeRange(); await navigationalSearch.focus(); await navigationalSearch.searchFor('type:application lens'); await navigationalSearch.clickOnOption(0); @@ -109,7 +107,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('lnsTableVis'); await lens.clickVisualizeListItemTitle('lnsTableVis'); - await lens.goToTimeRange(); // go to empty vis await lens.goToListingPageViaBreadcrumbs(); await visualize.clickNewVisualization(); diff --git a/x-pack/test/functional/apps/lens/group2/table.ts b/x-pack/test/functional/apps/lens/group2/table.ts index 7de5645b16b0..c359039bae34 100644 --- a/x-pack/test/functional/apps/lens/group2/table.ts +++ b/x-pack/test/functional/apps/lens/group2/table.ts @@ -20,7 +20,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('lnsXYvis'); await lens.clickVisualizeListItemTitle('lnsXYvis'); - await lens.goToTimeRange(); await lens.switchToVisualization('lnsDatatable'); // Sort by number await lens.changeTableSortingBy(2, 'ascending'); diff --git a/x-pack/test/functional/apps/lens/group3/add_to_dashboard.ts b/x-pack/test/functional/apps/lens/group3/add_to_dashboard.ts index 9b5d46dd0617..433fc2dbc943 100644 --- a/x-pack/test/functional/apps/lens/group3/add_to_dashboard.ts +++ b/x-pack/test/functional/apps/lens/group3/add_to_dashboard.ts @@ -27,8 +27,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const createNewLens = async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); - await lens.configureDimension({ dimension: 'lnsXY_yDimensionPanel > lns-empty-dimension', operation: 'average', @@ -48,8 +46,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboardAddPanel.filterEmbeddableNames('lnsXYvis'); await find.clickByButtonText('lnsXYvis'); await dashboardAddPanel.closeAddPanel(); - await lens.goToTimeRange(); - await dashboard.saveDashboard(dashboardName); await dashboard.gotoDashboardLandingPage(); await listingTable.searchAndExpectItemsCount('dashboard', dashboardName, 1); @@ -59,7 +55,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('Artistpreviouslyknownaslens'); await lens.clickVisualizeListItemTitle('Artistpreviouslyknownaslens'); - await lens.goToTimeRange(); await lens.waitForVisualization('legacyMtrVis'); await lens.assertLegacyMetric('Maximum of bytes', '19,986'); }; @@ -226,7 +221,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should add a Lens heatmap to the dashboard', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', @@ -281,8 +275,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should not display', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); - await lens.configureDimension({ dimension: 'lnsXY_yDimensionPanel > lns-empty-dimension', operation: 'average', @@ -330,7 +322,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should not display', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_yDimensionPanel > lns-empty-dimension', diff --git a/x-pack/test/functional/apps/lens/group3/dashboard_inline_editing.ts b/x-pack/test/functional/apps/lens/group3/dashboard_inline_editing.ts index 312bddba10ea..3790c22c377b 100644 --- a/x-pack/test/functional/apps/lens/group3/dashboard_inline_editing.ts +++ b/x-pack/test/functional/apps/lens/group3/dashboard_inline_editing.ts @@ -23,7 +23,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const createNewLens = async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_yDimensionPanel > lns-empty-dimension', @@ -39,7 +38,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('lnsXYvis'); await lens.clickVisualizeListItemTitle('lnsXYvis'); - await lens.goToTimeRange(); await lens.waitForVisualization('xyVisChart'); }; diff --git a/x-pack/test/functional/apps/lens/group3/epoch_millis.ts b/x-pack/test/functional/apps/lens/group3/epoch_millis.ts index 30f3ffddfcff..23a1254c1aa2 100644 --- a/x-pack/test/functional/apps/lens/group3/epoch_millis.ts +++ b/x-pack/test/functional/apps/lens/group3/epoch_millis.ts @@ -31,7 +31,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); await lens.switchDataPanelIndexPattern('epoch-millis*'); - await lens.goToTimeRange(); await lens.switchToVisualization('lnsDatatable'); const fieldList = await lens.findAllFields(); expect(fieldList).to.contain('@timestamp'); diff --git a/x-pack/test/functional/apps/lens/group3/runtime_fields.ts b/x-pack/test/functional/apps/lens/group3/runtime_fields.ts index e04a00a64c81..26c2134a68e1 100644 --- a/x-pack/test/functional/apps/lens/group3/runtime_fields.ts +++ b/x-pack/test/functional/apps/lens/group3/runtime_fields.ts @@ -19,7 +19,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should be able to add runtime field and use it', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.switchToVisualization('lnsDatatable'); await retry.try(async () => { await dataViews.clickAddFieldFromSearchBar(); diff --git a/x-pack/test/functional/apps/lens/group3/terms.ts b/x-pack/test/functional/apps/lens/group3/terms.ts index 86c43a7549e0..5c7f2c866938 100644 --- a/x-pack/test/functional/apps/lens/group3/terms.ts +++ b/x-pack/test/functional/apps/lens/group3/terms.ts @@ -26,7 +26,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); await elasticChart.setNewChartUiDebugFlag(true); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_yDimensionPanel > lns-empty-dimension', @@ -164,7 +163,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); await elasticChart.setNewChartUiDebugFlag(true); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_yDimensionPanel > lns-empty-dimension', @@ -282,7 +280,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); await elasticChart.setNewChartUiDebugFlag(true); - await lens.goToTimeRange(); await lens.switchDataPanelIndexPattern(esIndexPrefix); await lens.configureDimension({ diff --git a/x-pack/test/functional/apps/lens/group4/chart_data.ts b/x-pack/test/functional/apps/lens/group4/chart_data.ts index 512f820e7ed7..3b3a51c28947 100644 --- a/x-pack/test/functional/apps/lens/group4/chart_data.ts +++ b/x-pack/test/functional/apps/lens/group4/chart_data.ts @@ -19,7 +19,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); await elasticChart.setNewChartUiDebugFlag(true); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', diff --git a/x-pack/test/functional/apps/lens/group4/color_mapping.ts b/x-pack/test/functional/apps/lens/group4/color_mapping.ts index 932c628a09af..008ffa1cb53e 100644 --- a/x-pack/test/functional/apps/lens/group4/color_mapping.ts +++ b/x-pack/test/functional/apps/lens/group4/color_mapping.ts @@ -22,7 +22,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { before(async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await elasticChart.setNewChartUiDebugFlag(true); await lens.configureDimension({ diff --git a/x-pack/test/functional/apps/lens/group4/colors.ts b/x-pack/test/functional/apps/lens/group4/colors.ts index 96e1866250da..5c5bbea4ba2c 100644 --- a/x-pack/test/functional/apps/lens/group4/colors.ts +++ b/x-pack/test/functional/apps/lens/group4/colors.ts @@ -14,7 +14,6 @@ export default function ({ getPageObjects }: FtrProviderContext) { it('should allow to pick legacy color palette in xy chart', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', @@ -41,7 +40,6 @@ export default function ({ getPageObjects }: FtrProviderContext) { it('should allow to pick color mapping palette in xy chart', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', diff --git a/x-pack/test/functional/apps/lens/group4/dashboard.ts b/x-pack/test/functional/apps/lens/group4/dashboard.ts index 563023a6d2ee..670ee2cb22da 100644 --- a/x-pack/test/functional/apps/lens/group4/dashboard.ts +++ b/x-pack/test/functional/apps/lens/group4/dashboard.ts @@ -61,7 +61,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboardAddPanel.filterEmbeddableNames('Artistpreviouslyknownaslens'); await find.clickByButtonText('Artistpreviouslyknownaslens'); await dashboardAddPanel.closeAddPanel(); - await lens.goToTimeRange(); await lens.assertLegacyMetric('Maximum of bytes', '19,986'); }); @@ -72,7 +71,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboardAddPanel.filterEmbeddableNames('lnsXYvis'); await find.clickByButtonText('lnsXYvis'); await dashboardAddPanel.closeAddPanel(); - await lens.goToTimeRange(); await retry.try(async () => { await clickInChart(30, 5); // hardcoded position of bar, depends heavy on data and charts implementation await testSubjects.existOrFail('applyFiltersPopoverButton', { timeout: 2500 }); @@ -98,7 +96,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboardAddPanel.filterEmbeddableNames('lnsXYvis'); await find.clickByButtonText('lnsXYvis'); await dashboardAddPanel.closeAddPanel(); - await lens.goToTimeRange(); await retry.try(async () => { // show the tooltip actions await rightClickInChart(30, 5); // hardcoded position of bar, depends heavy on data and charts implementation @@ -122,7 +119,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboardAddPanel.filterEmbeddableNames('lnsXYvis'); await find.clickByButtonText('lnsXYvis'); await dashboardAddPanel.closeAddPanel(); - await lens.goToTimeRange(); await dashboard.saveDashboard('lnsDrilldown'); await panelActions.expectMissingPanelAction( @@ -139,7 +135,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await find.clickByButtonText('lnsPieVis'); await dashboardAddPanel.closeAddPanel(); - await lens.goToTimeRange(); await clickInChart(5, 5); // hardcoded position of the slice, depends heavy on data and charts implementation await lens.assertExactText( @@ -189,7 +184,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboard.clickNewDashboard(); await dashboardAddPanel.clickCreateNewLink(); await header.waitUntilLoadingHasFinished(); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', operation: 'date_histogram', @@ -251,7 +245,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboardAddPanel.clickCreateNewLink(); await header.waitUntilLoadingHasFinished(); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', @@ -282,7 +275,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboardAddPanel.filterEmbeddableNames('lnsXYvis'); await find.clickByButtonText('lnsXYvis'); await dashboardAddPanel.closeAddPanel(); - await lens.goToTimeRange(); // type an invalid search query, hit refresh await queryBar.setQuery('this is > not valid'); await queryBar.submitQuery(); diff --git a/x-pack/test/functional/apps/lens/group4/logsdb.ts b/x-pack/test/functional/apps/lens/group4/logsdb.ts index a58b5c6bf806..8071ad58ac09 100644 --- a/x-pack/test/functional/apps/lens/group4/logsdb.ts +++ b/x-pack/test/functional/apps/lens/group4/logsdb.ts @@ -17,11 +17,12 @@ import { } from './tsdb_logsdb_helpers'; export default function ({ getService, getPageObjects }: FtrProviderContext) { - const { common, lens, discover, header } = getPageObjects([ + const { common, lens, discover, header, timePicker } = getPageObjects([ 'common', 'lens', 'discover', 'header', + 'timePicker', ]); const testSubjects = getService('testSubjects'); const find = getService('find'); @@ -65,6 +66,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { after(async () => { await kibanaServer.savedObjects.cleanStandardList(); await kibanaServer.uiSettings.replace({}); + await timePicker.setDefaultAbsoluteRangeViaUiSettings(); await es.indices.delete({ index: [logsdbIndex] }); }); @@ -72,7 +74,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { before(async () => { await common.navigateToApp('lens'); await lens.switchDataPanelIndexPattern(logsdbDataView); - await lens.goToTimeRange(); }); afterEach(async () => { diff --git a/x-pack/test/functional/apps/lens/group4/share.ts b/x-pack/test/functional/apps/lens/group4/share.ts index 4d01b3cf65c9..94634b093dcc 100644 --- a/x-pack/test/functional/apps/lens/group4/share.ts +++ b/x-pack/test/functional/apps/lens/group4/share.ts @@ -30,7 +30,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should disable the share button if no request is made', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); expect(await lens.isShareable()).to.eql(false); }); diff --git a/x-pack/test/functional/apps/lens/group4/show_underlying_data.ts b/x-pack/test/functional/apps/lens/group4/show_underlying_data.ts index 5caf47a41847..18bd3bb830bb 100644 --- a/x-pack/test/functional/apps/lens/group4/show_underlying_data.ts +++ b/x-pack/test/functional/apps/lens/group4/show_underlying_data.ts @@ -28,7 +28,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('lnsXYvis'); await lens.clickVisualizeListItemTitle('lnsXYvis'); - await lens.goToTimeRange(); await lens.waitForVisualization('xyVisChart'); diff --git a/x-pack/test/functional/apps/lens/group4/show_underlying_data_dashboard.ts b/x-pack/test/functional/apps/lens/group4/show_underlying_data_dashboard.ts index de563366af3f..40169ef15ccf 100644 --- a/x-pack/test/functional/apps/lens/group4/show_underlying_data_dashboard.ts +++ b/x-pack/test/functional/apps/lens/group4/show_underlying_data_dashboard.ts @@ -34,7 +34,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('lnsXYvis'); await lens.clickVisualizeListItemTitle('lnsXYvis'); - await lens.goToTimeRange(); await lens.save('Embedded Visualization', true, false, false, 'new'); await dashboard.saveDashboard(`Open in Discover Testing ${uuidv4()}`, { diff --git a/x-pack/test/functional/apps/lens/group4/time_shift.ts b/x-pack/test/functional/apps/lens/group4/time_shift.ts index 9cbe84f033ff..de341945b3f4 100644 --- a/x-pack/test/functional/apps/lens/group4/time_shift.ts +++ b/x-pack/test/functional/apps/lens/group4/time_shift.ts @@ -8,14 +8,13 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; -export default function ({ getService, getPageObjects }: FtrProviderContext) { +export default function ({ getPageObjects }: FtrProviderContext) { const { visualize, lens } = getPageObjects(['visualize', 'lens']); describe('time shift', () => { it('should able to configure a shifted metric', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.switchToVisualization('lnsDatatable'); await lens.configureDimension({ dimension: 'lnsDatatable_rows > lns-empty-dimension', diff --git a/x-pack/test/functional/apps/lens/group5/drag_and_drop.ts b/x-pack/test/functional/apps/lens/group5/drag_and_drop.ts index 144c9f0b8995..1950edc28a9e 100644 --- a/x-pack/test/functional/apps/lens/group5/drag_and_drop.ts +++ b/x-pack/test/functional/apps/lens/group5/drag_and_drop.ts @@ -16,14 +16,23 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('lens drag and drop tests', () => { describe('basic drag and drop', () => { - it('should construct the basic split xy chart', async () => { + it('should construct a bar chart when dropping a field to create top values chart', async () => { + await visualize.navigateToNewVisualization(); + await visualize.clickVisType('lens'); + await header.waitUntilLoadingHasFinished(); + await lens.dragFieldToWorkspace('machine.os.raw', xyChartContainer); + expect(await lens.getDimensionTriggerText('lnsXY_xDimensionPanel')).to.eql( + 'Top 5 values of machine.os.raw' + ); + expect(await lens.getChartTypeFromChartSwitcher()).to.eql('Bar'); + }); + it('should construct a bar chart when dropping a time field to create a date histogram chart', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await header.waitUntilLoadingHasFinished(); await lens.dragFieldToWorkspace('@timestamp', xyChartContainer); - expect(await lens.getDimensionTriggerText('lnsXY_xDimensionPanel')).to.eql('@timestamp'); + expect(await lens.getChartTypeFromChartSwitcher()).to.eql('Bar'); }); it('should allow dropping fields to existing and empty dimension triggers', async () => { @@ -224,7 +233,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should drop a field to workspace', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await header.waitUntilLoadingHasFinished(); await lens.dragFieldWithKeyboard('@timestamp'); expect(await lens.getDimensionTriggerText('lnsXY_xDimensionPanel')).to.eql('@timestamp'); @@ -300,7 +308,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should always nest time dimension in categorical dimension', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await header.waitUntilLoadingHasFinished(); await lens.dragFieldToWorkspace('@timestamp', xyChartContainer); await lens.waitForVisualization(xyChartContainer); @@ -330,7 +337,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('lnsXYvis'); await lens.clickVisualizeListItemTitle('lnsXYvis'); - await lens.goToTimeRange(); await lens.createLayer('data'); @@ -410,7 +416,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('lnsXYvis'); await lens.clickVisualizeListItemTitle('lnsXYvis'); - await lens.goToTimeRange(); await lens.createLayer('data'); await lens.dragFieldToDimensionTrigger( diff --git a/x-pack/test/functional/apps/lens/group5/formula.ts b/x-pack/test/functional/apps/lens/group5/formula.ts index 95404faf5a99..c12551bed35f 100644 --- a/x-pack/test/functional/apps/lens/group5/formula.ts +++ b/x-pack/test/functional/apps/lens/group5/formula.ts @@ -23,7 +23,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('lnsXYvis'); await lens.clickVisualizeListItemTitle('lnsXYvis'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_yDimensionPanel > lns-dimensionTrigger', @@ -43,7 +42,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should update and delete a formula', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); + await lens.switchToVisualization('lnsDatatable'); await lens.configureDimension({ @@ -64,7 +63,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should insert single quotes and escape when needed to create valid KQL', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); + await lens.switchToVisualization('lnsDatatable'); await lens.configureDimension({ @@ -96,7 +95,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should insert single quotes and escape when needed to create valid field name', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); + await lens.switchToVisualization('lnsDatatable'); await dataViews.clickAddFieldFromSearchBar(); await fieldEditor.setName(`ab' "'`, true, true); @@ -127,7 +126,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should persist a broken formula on close', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); + await lens.switchToVisualization('lnsDatatable'); // Close immediately @@ -145,7 +144,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should keep the formula when entering expanded mode', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); + await lens.switchToVisualization('lnsDatatable'); await lens.configureDimension({ @@ -164,7 +163,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should allow an empty formula combined with a valid formula', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); + await lens.switchToVisualization('lnsDatatable'); await lens.configureDimension({ @@ -184,7 +183,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should duplicate a moving average formula and be a valid table with conditional coloring', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); + await lens.switchToVisualization('lnsDatatable'); await lens.configureDimension({ @@ -219,7 +218,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should keep the formula if the user does not fully transition to a quick function', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); + await lens.switchToVisualization('lnsDatatable'); await lens.configureDimension({ @@ -240,7 +239,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should keep the formula if the user does not fully transition to a static value', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_yDimensionPanel > lns-empty-dimension', @@ -269,7 +267,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should allow numeric only formulas', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); + await lens.switchToVisualization('lnsDatatable'); await lens.configureDimension({ @@ -289,7 +287,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should apply a global filter to the current formula', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); + await lens.switchToVisualization('lnsDatatable'); await lens.configureDimension({ diff --git a/x-pack/test/functional/apps/lens/group5/gauge.ts b/x-pack/test/functional/apps/lens/group5/gauge.ts index eea38d486833..6aab255337e7 100644 --- a/x-pack/test/functional/apps/lens/group5/gauge.ts +++ b/x-pack/test/functional/apps/lens/group5/gauge.ts @@ -10,13 +10,12 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { - const { visualize, lens, timePicker } = getPageObjects(['visualize', 'lens', 'timePicker']); + const { visualize, lens } = getPageObjects(['visualize', 'lens']); const elasticChart = getService('elasticChart'); const testSubjects = getService('testSubjects'); describe('lens gauge', () => { before(async () => { - await timePicker.setDefaultAbsoluteRangeViaUiSettings(); await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); await elasticChart.setNewChartUiDebugFlag(true); diff --git a/x-pack/test/functional/apps/lens/group5/geo_field.ts b/x-pack/test/functional/apps/lens/group5/geo_field.ts index a5851263fae8..a184aad12c46 100644 --- a/x-pack/test/functional/apps/lens/group5/geo_field.ts +++ b/x-pack/test/functional/apps/lens/group5/geo_field.ts @@ -9,12 +9,13 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getPageObjects }: FtrProviderContext) { - const { visualize, lens, header, maps, common } = getPageObjects([ + const { visualize, lens, header, maps, common, timePicker } = getPageObjects([ 'visualize', 'lens', 'header', 'maps', 'common', + 'timePicker', ]); const from = 'Sep 22, 2015 @ 00:00:00.000'; const to = 'Sep 22, 2015 @ 04:00:00.000'; @@ -25,7 +26,7 @@ export default function ({ getPageObjects }: FtrProviderContext) { }); after(async () => { - await common.unsetTime(); + await timePicker.setDefaultAbsoluteRangeViaUiSettings(); }); it('should visualize geo fields in maps', async () => { diff --git a/x-pack/test/functional/apps/lens/group5/heatmap.ts b/x-pack/test/functional/apps/lens/group5/heatmap.ts index 7597b0448433..7abcba0cb078 100644 --- a/x-pack/test/functional/apps/lens/group5/heatmap.ts +++ b/x-pack/test/functional/apps/lens/group5/heatmap.ts @@ -19,7 +19,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); await elasticChart.setNewChartUiDebugFlag(true); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', diff --git a/x-pack/test/functional/apps/lens/group5/tagcloud.ts b/x-pack/test/functional/apps/lens/group5/tagcloud.ts index dd718a476a48..bab136bcc1c5 100644 --- a/x-pack/test/functional/apps/lens/group5/tagcloud.ts +++ b/x-pack/test/functional/apps/lens/group5/tagcloud.ts @@ -23,7 +23,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); await elasticChart.setNewChartUiDebugFlag(true); - await lens.goToTimeRange(); + await lens.switchToVisualization('lnsTagcloud', 'Tag cloud'); await lens.configureDimension({ diff --git a/x-pack/test/functional/apps/lens/group6/annotations.ts b/x-pack/test/functional/apps/lens/group6/annotations.ts index 7556440eeb3b..6738a0c7fd45 100644 --- a/x-pack/test/functional/apps/lens/group6/annotations.ts +++ b/x-pack/test/functional/apps/lens/group6/annotations.ts @@ -9,28 +9,14 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { - const { visualize, lens, common, tagManagement } = getPageObjects([ - 'visualize', - 'lens', - 'common', - 'tagManagement', - ]); + const { visualize, lens, tagManagement } = getPageObjects(['visualize', 'lens', 'tagManagement']); const find = getService('find'); const retry = getService('retry'); const toastsService = getService('toasts'); const testSubjects = getService('testSubjects'); const listingTable = getService('listingTable'); - const from = 'Sep 19, 2015 @ 06:31:44.000'; - const to = 'Sep 23, 2015 @ 18:31:44.000'; describe('lens annotations tests', () => { - before(async () => { - await common.setTime({ from, to }); - }); - after(async () => { - await common.unsetTime(); - }); - it('should show a disabled annotation layer button if there is no date histogram in data layer', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); @@ -46,7 +32,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should add manual annotation layer with static date and allow edition', async () => { await lens.removeLayer(); - await lens.goToTimeRange(); await lens.dragFieldToWorkspace('@timestamp', 'xyVisChart'); await lens.createLayer('annotations'); @@ -117,8 +102,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should save annotation group to library', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - - await lens.goToTimeRange(); await lens.dragFieldToWorkspace('@timestamp', 'xyVisChart'); await lens.createLayer('annotations'); @@ -166,8 +149,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should add annotation group from library', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - - await lens.goToTimeRange(); await lens.dragFieldToWorkspace('@timestamp', 'xyVisChart'); await lens.createLayer('annotations', ANNOTATION_GROUP_TITLE); diff --git a/x-pack/test/functional/apps/lens/group6/disable_auto_apply.ts b/x-pack/test/functional/apps/lens/group6/disable_auto_apply.ts index 8cccfd759450..56d182e00713 100644 --- a/x-pack/test/functional/apps/lens/group6/disable_auto_apply.ts +++ b/x-pack/test/functional/apps/lens/group6/disable_auto_apply.ts @@ -47,8 +47,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should preserve apply-changes button with full-screen datasource', async () => { - await lens.goToTimeRange(); - await lens.disableAutoApply(); await lens.closeSettingsMenu(); diff --git a/x-pack/test/functional/apps/lens/group6/inspector.ts b/x-pack/test/functional/apps/lens/group6/inspector.ts index 56d8fd3cdd7b..a21abe85fe73 100644 --- a/x-pack/test/functional/apps/lens/group6/inspector.ts +++ b/x-pack/test/functional/apps/lens/group6/inspector.ts @@ -18,7 +18,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); await elasticChart.setNewChartUiDebugFlag(true); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', diff --git a/x-pack/test/functional/apps/lens/group6/legacy_metric.ts b/x-pack/test/functional/apps/lens/group6/legacy_metric.ts index 9b404e7f8e53..5385422a7bfe 100644 --- a/x-pack/test/functional/apps/lens/group6/legacy_metric.ts +++ b/x-pack/test/functional/apps/lens/group6/legacy_metric.ts @@ -20,7 +20,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('Artistpreviouslyknownaslens'); await lens.clickVisualizeListItemTitle('Artistpreviouslyknownaslens'); - await lens.goToTimeRange(); await lens.assertLegacyMetric('Maximum of bytes', '19,986'); }); diff --git a/x-pack/test/functional/apps/lens/group6/lens_reporting.ts b/x-pack/test/functional/apps/lens/group6/lens_reporting.ts index 4b2a182df741..26f68e73d10e 100644 --- a/x-pack/test/functional/apps/lens/group6/lens_reporting.ts +++ b/x-pack/test/functional/apps/lens/group6/lens_reporting.ts @@ -43,7 +43,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { after(async () => { await kibanaServer.savedObjects.cleanStandardList(); - await timePicker.resetDefaultAbsoluteRangeViaUiSettings(); + await timePicker.setDefaultAbsoluteRangeViaUiSettings(); await es.deleteByQuery({ index: '.reporting-*', refresh: true, @@ -78,7 +78,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', diff --git a/x-pack/test/functional/apps/lens/group6/lens_tagging.ts b/x-pack/test/functional/apps/lens/group6/lens_tagging.ts index 56f97c8751d7..b6b441249f21 100644 --- a/x-pack/test/functional/apps/lens/group6/lens_tagging.ts +++ b/x-pack/test/functional/apps/lens/group6/lens_tagging.ts @@ -16,13 +16,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const find = getService('find'); const dashboardAddPanel = getService('dashboardAddPanel'); const dashboardPanelActions = getService('dashboardPanelActions'); - const { tagManagement, header, dashboard, visualize, lens, timePicker } = getPageObjects([ + const { tagManagement, header, dashboard, visualize, lens } = getPageObjects([ 'tagManagement', 'header', 'dashboard', 'visualize', 'lens', - 'timePicker', ]); const lensTag = 'extreme-lens-tag'; @@ -31,20 +30,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('lens tagging', () => { before(async () => { await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/logstash_functional'); - await timePicker.setDefaultAbsoluteRangeViaUiSettings(); await dashboard.navigateToApp(); await dashboard.preserveCrossAppState(); await dashboard.clickNewDashboard(); }); - after(async () => { - await timePicker.setDefaultAbsoluteRangeViaUiSettings(); - }); - it('adds a new tag to a Lens visualization', async () => { // create lens await dashboardAddPanel.clickCreateNewLink(); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', operation: 'date_histogram', diff --git a/x-pack/test/functional/apps/lens/group6/metric.ts b/x-pack/test/functional/apps/lens/group6/metric.ts index fcf8cd6f7e55..03ca571c48d0 100644 --- a/x-pack/test/functional/apps/lens/group6/metric.ts +++ b/x-pack/test/functional/apps/lens/group6/metric.ts @@ -76,7 +76,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should render a metric', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.switchToVisualization('lnsMetric', 'Metric'); @@ -349,7 +348,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('does carry custom formatting when transitioning from other visualization', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.switchToVisualization('lnsLegacyMetric'); // await lens.clickLegacyMetric(); diff --git a/x-pack/test/functional/apps/lens/group6/reference_lines.ts b/x-pack/test/functional/apps/lens/group6/reference_lines.ts index 245162b5e474..b1d4a3e77ee3 100644 --- a/x-pack/test/functional/apps/lens/group6/reference_lines.ts +++ b/x-pack/test/functional/apps/lens/group6/reference_lines.ts @@ -29,8 +29,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should add a reference layer with a static value in it', async () => { - await lens.goToTimeRange(); - await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', operation: 'date_histogram', diff --git a/x-pack/test/functional/apps/lens/group6/rollup.ts b/x-pack/test/functional/apps/lens/group6/rollup.ts index c1d3c343350d..7eab6d86b651 100644 --- a/x-pack/test/functional/apps/lens/group6/rollup.ts +++ b/x-pack/test/functional/apps/lens/group6/rollup.ts @@ -9,7 +9,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { - const { visualize, lens, timePicker } = getPageObjects(['visualize', 'lens', 'timePicker']); + const { visualize, lens } = getPageObjects(['visualize', 'lens']); const find = getService('find'); const listingTable = getService('listingTable'); const esArchiver = getService('esArchiver'); @@ -22,20 +22,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await kibanaServer.importExport.load( 'x-pack/test/functional/fixtures/kbn_archiver/rollup/config.json' ); - await timePicker.setDefaultAbsoluteRangeViaUiSettings(); }); after(async () => { await esArchiver.unload('x-pack/test/functional/es_archives/lens/rollup/data'); await kibanaServer.savedObjects.cleanStandardList(); - await timePicker.resetDefaultAbsoluteRangeViaUiSettings(); }); it('should allow creation of lens xy chart', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); - await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', operation: 'date_histogram', @@ -62,8 +58,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('Afancilenstest'); await lens.clickVisualizeListItemTitle('Afancilenstest'); - await lens.goToTimeRange(); - expect(await lens.getTitle()).to.eql('Afancilenstest'); // .echLegendItem__title is the only viable way of getting the xy chart's @@ -82,7 +76,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should allow to switch from regular index to rollup index retaining config', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.switchDataPanelIndexPattern('lens_regular_data'); await lens.switchToVisualization('lnsLegacyMetric'); await lens.configureDimension({ diff --git a/x-pack/test/functional/apps/lens/group6/workspace_size.ts b/x-pack/test/functional/apps/lens/group6/workspace_size.ts index 0ba44a5249c6..9ae8f21cebf6 100644 --- a/x-pack/test/functional/apps/lens/group6/workspace_size.ts +++ b/x-pack/test/functional/apps/lens/group6/workspace_size.ts @@ -44,7 +44,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); // Detect here if the Chrome bug is present, and adjust the aspect ratio accordingly if not if (!within(width, DEFAULT_WINDOW_SIZE[0]) || !within(height, DEFAULT_WINDOW_SIZE[1])) { const { width: containerWidth, height: containerHeight } = diff --git a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/gauge.ts b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/gauge.ts index 2d302bd7b746..b765bb4665bf 100644 --- a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/gauge.ts +++ b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/gauge.ts @@ -10,10 +10,9 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ getPageObjects, getService }: FtrProviderContext) { - const { visualize, lens, timePicker, visEditor, visChart } = getPageObjects([ + const { visualize, lens, visEditor, visChart } = getPageObjects([ 'visualize', 'lens', - 'timePicker', 'visEditor', 'visChart', ]); @@ -30,7 +29,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visualize.navigateToNewAggBasedVisualization(); await visualize.clickGauge(); await visualize.clickNewSearch(); - await timePicker.setDefaultAbsoluteRange(); await elasticChart.setNewChartUiDebugFlag(true); }); diff --git a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/goal.ts b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/goal.ts index 89d08c0abeb1..2815a5774af0 100644 --- a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/goal.ts +++ b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/goal.ts @@ -9,11 +9,10 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ getPageObjects, getService }: FtrProviderContext) { - const { visualize, lens, visChart, timePicker, visEditor } = getPageObjects([ + const { visualize, lens, visChart, visEditor } = getPageObjects([ 'visualize', 'lens', 'visChart', - 'timePicker', 'visEditor', ]); @@ -28,7 +27,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visualize.navigateToNewAggBasedVisualization(); await visualize.clickGoal(); await visualize.clickNewSearch(); - await timePicker.setDefaultAbsoluteRange(); }); it('should show the "Edit Visualization in Lens" menu item', async () => { diff --git a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/heatmap.ts b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/heatmap.ts index 0f30e2194273..6ebc6ce20e90 100644 --- a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/heatmap.ts +++ b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/heatmap.ts @@ -9,11 +9,10 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ getPageObjects }: FtrProviderContext) { - const { visualize, lens, visChart, timePicker, visEditor } = getPageObjects([ + const { visualize, lens, visChart, visEditor } = getPageObjects([ 'visualize', 'lens', 'visChart', - 'timePicker', 'visEditor', ]); @@ -26,7 +25,6 @@ export default function ({ getPageObjects }: FtrProviderContext) { await visualize.navigateToNewAggBasedVisualization(); await visualize.clickHeatmapChart(); await visualize.clickNewSearch(); - await timePicker.setDefaultAbsoluteRange(); }); it('should show the "Edit Visualization in Lens" menu item if no X-axis was specified', async () => { diff --git a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/index.ts b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/index.ts index e0e5eca1a0ff..3f9c2eb1802e 100644 --- a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/index.ts +++ b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/index.ts @@ -53,11 +53,11 @@ export default function ({ loadTestFile, getService, getPageObjects }: FtrProvid await esNode.load(esArchive); // changing the timepicker default here saves us from having to set it in Discover (~8s) - await timePicker.setDefaultAbsoluteRangeViaUiSettings(); await kibanaServer.uiSettings.update({ defaultIndex: indexPatternString, 'dateFormat:tz': 'UTC', }); + await timePicker.setDefaultAbsoluteRangeViaUiSettings(); await kibanaServer.importExport.load(fixtureDirs.lensBasic); await kibanaServer.importExport.load(fixtureDirs.lensDefault); }); diff --git a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/metric.ts b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/metric.ts index 0ff670848d47..c0149f3b6f39 100644 --- a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/metric.ts +++ b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/metric.ts @@ -9,7 +9,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ getPageObjects, getService }: FtrProviderContext) { - const { visEditor, visualize, lens, timePicker, visChart } = getPageObjects([ + const { visEditor, visualize, lens, visChart, timePicker } = getPageObjects([ 'visEditor', 'visualize', 'visChart', diff --git a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/navigation.ts b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/navigation.ts index 1eb41d6dc86c..d76a2ec0154b 100644 --- a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/navigation.ts +++ b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/navigation.ts @@ -9,7 +9,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ getPageObjects, getService }: FtrProviderContext) { - const { visualize, lens, timePicker } = getPageObjects(['visualize', 'lens', 'timePicker']); + const { visualize, lens } = getPageObjects(['visualize', 'lens']); const testSubjects = getService('testSubjects'); const retry = getService('retry'); @@ -20,7 +20,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visualize.navigateToNewAggBasedVisualization(); await visualize.clickLineChart(); await visualize.clickNewSearch(); - await timePicker.setDefaultAbsoluteRange(); }); it('should let the user return back to Visualize if no changes were made', async () => { diff --git a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/pie.ts b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/pie.ts index 785c1706ffbe..42a015acdd31 100644 --- a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/pie.ts +++ b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/pie.ts @@ -9,11 +9,10 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ getPageObjects, getService }: FtrProviderContext) { - const { visualize, visEditor, lens, timePicker, header } = getPageObjects([ + const { visualize, visEditor, lens, header } = getPageObjects([ 'visualize', 'lens', 'visEditor', - 'timePicker', 'header', ]); @@ -29,7 +28,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visualize.navigateToNewAggBasedVisualization(); await visualize.clickPieChart(); await visualize.clickNewSearch(); - await timePicker.setDefaultAbsoluteRange(); }); it('should hide the "Edit Visualization in Lens" menu item if no split slices were defined', async () => { diff --git a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/table.ts b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/table.ts index 380f58f2ea8b..0b50c226cab5 100644 --- a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/table.ts +++ b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/table.ts @@ -9,11 +9,10 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ getPageObjects, getService }: FtrProviderContext) { - const { visualize, visEditor, lens, timePicker, header } = getPageObjects([ + const { visualize, visEditor, lens, header } = getPageObjects([ 'visualize', 'lens', 'visEditor', - 'timePicker', 'header', ]); @@ -29,7 +28,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visualize.navigateToNewAggBasedVisualization(); await visualize.clickDataTable(); await visualize.clickNewSearch(); - await timePicker.setDefaultAbsoluteRange(); }); it('should not allow converting of unsupported aggregations', async () => { diff --git a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/xy.ts b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/xy.ts index d417129b58f9..4f5aa005b902 100644 --- a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/xy.ts +++ b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/xy.ts @@ -9,11 +9,10 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ getPageObjects, getService }: FtrProviderContext) { - const { visualize, visEditor, lens, timePicker, header, visChart } = getPageObjects([ + const { visualize, visEditor, lens, header, visChart } = getPageObjects([ 'visualize', 'lens', 'visEditor', - 'timePicker', 'header', 'visChart', ]); @@ -30,7 +29,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visualize.navigateToNewAggBasedVisualization(); await visualize.clickLineChart(); await visualize.clickNewSearch(); - await timePicker.setDefaultAbsoluteRange(); }); it('should show the "Edit Visualization in Lens" menu item', async () => { diff --git a/x-pack/test/functional/page_objects/lens_page.ts b/x-pack/test/functional/page_objects/lens_page.ts index 310f52f7e651..f4db890b2695 100644 --- a/x-pack/test/functional/page_objects/lens_page.ts +++ b/x-pack/test/functional/page_objects/lens_page.ts @@ -915,6 +915,10 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont } }); }, + async getChartTypeFromChartSwitcher() { + const chartSwitcher = await testSubjects.find('lnsChartSwitchPopover'); + return await chartSwitcher.getVisibleText(); + }, async openChartSwitchPopover(layerIndex = 0) { if (await testSubjects.exists('lnsChartSwitchList', { timeout: 50 })) { diff --git a/x-pack/test/localization/tests/lens/formula.ts b/x-pack/test/localization/tests/lens/formula.ts index dcb63b2bdb48..6239460f89d6 100644 --- a/x-pack/test/localization/tests/lens/formula.ts +++ b/x-pack/test/localization/tests/lens/formula.ts @@ -17,7 +17,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); await elasticChart.setNewChartUiDebugFlag(true); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_yDimensionPanel > lns-empty-dimension', diff --git a/x-pack/test/localization/tests/lens/smokescreen.ts b/x-pack/test/localization/tests/lens/smokescreen.ts index 5e679febb5d6..d3b33a72a720 100644 --- a/x-pack/test/localization/tests/lens/smokescreen.ts +++ b/x-pack/test/localization/tests/lens/smokescreen.ts @@ -170,7 +170,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should allow creation of lens xy chart', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', @@ -207,7 +206,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('Afancilenstest'); await lens.clickVisualizeListItemTitle('Afancilenstest'); - await lens.goToTimeRange(); await lens.waitForVisualization('xyVisChart'); expect(await lens.getTitle()).to.eql('Afancilenstest'); @@ -222,7 +220,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('lnsXYvis'); await lens.clickVisualizeListItemTitle('lnsXYvis'); - await lens.goToTimeRange(); // Change the IP field to filters await lens.configureDimension({ dimension: 'lnsXY_splitDimensionPanel > lns-dimensionTrigger', @@ -241,7 +238,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('Artistpreviouslyknownaslens'); await lens.clickVisualizeListItemTitle('Artistpreviouslyknownaslens'); - await lens.goToTimeRange(); await lens.assertLegacyMetric(termTranslator('max', 'bytes'), '19,986'); await lens.switchToVisualization('lnsDatatable', termTranslator('datatable')); expect(await lens.getDatatableHeaderText()).to.eql(termTranslator('max', 'bytes')); @@ -253,7 +249,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should transition from a multi-layer stacked bar to a multi-layer line chart and correctly remove all layers', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', @@ -297,7 +292,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should transition selected layer in a multi layer bar using layer chart switch', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', @@ -345,7 +339,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('lnsXYvis'); await lens.clickVisualizeListItemTitle('lnsXYvis'); - await lens.goToTimeRange(); await lens.removeDimension('lnsXY_splitDimensionPanel'); await lens.switchToVisualization('line', termTranslator('line')); await lens.configureDimension({ @@ -403,7 +396,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); await elasticChart.setNewChartUiDebugFlag(true); - await lens.goToTimeRange(); await lens.switchToVisualization('bar', termTranslator('bar')); await lens.configureDimension({ @@ -479,7 +471,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('lnsXYvis'); await lens.clickVisualizeListItemTitle('lnsXYvis'); - await lens.goToTimeRange(); expect(await lens.hasChartSwitchWarning('pie', termTranslator('pie'))).to.eql(true); await lens.switchToVisualization('pie', termTranslator('pie')); @@ -506,7 +497,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('lnsXYvis'); await lens.clickVisualizeListItemTitle('lnsXYvis'); - await lens.goToTimeRange(); await lens.switchToVisualization('line', termTranslator('line')); expect(await lens.getTitle()).to.eql('lnsXYvis'); expect(await lens.getDimensionTriggerText('lnsXY_xDimensionPanel')).to.eql('@timestamp'); @@ -522,7 +512,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('lnsPieVis'); await lens.clickVisualizeListItemTitle('lnsPieVis'); - await lens.goToTimeRange(); expect(await lens.hasChartSwitchWarning('treemap', termTranslator('treemap'))).to.eql(false); await lens.switchToVisualization('treemap', termTranslator('treemap')); expect(await lens.getDimensionTriggersTexts('lnsPie_groupByDimensionPanel')).to.eql([ @@ -537,7 +526,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should create a pie chart and switch to datatable', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.switchToVisualization('pie', termTranslator('pie')); await lens.configureDimension({ dimension: 'lnsPie_sliceByDimensionPanel > lns-empty-dimension', @@ -567,7 +555,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should create a heatmap chart and transition to barchart', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.switchToVisualization('heatmap', termTranslator('heatmap')); await lens.configureDimension({ @@ -596,7 +583,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should create a valid XY chart with references', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', @@ -631,7 +617,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should allow formatting on references', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.switchToVisualization('lnsDatatable', termTranslator('datatable')); await lens.configureDimension({ @@ -677,7 +662,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should handle edge cases in reference-based operations', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', @@ -713,7 +697,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should keep the field selection while transitioning to every reference-based operation', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', @@ -748,7 +731,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should not leave an incomplete column in the visualization config with field-based operation', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_yDimensionPanel > lns-empty-dimension', @@ -761,7 +743,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should revert to previous configuration and not leave an incomplete column in the visualization config with reference-based operations', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', @@ -797,7 +778,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should transition from unique count to last value', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_yDimensionPanel > lns-empty-dimension', @@ -828,7 +808,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should allow filtering by legend on an xy chart', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.configureDimension({ dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', @@ -858,7 +837,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should allow filtering by legend on a pie chart', async () => { await visualize.navigateToNewVisualization(); await visualize.clickVisType('lens'); - await lens.goToTimeRange(); await lens.switchToVisualization('pie', termTranslator('pie')); await lens.configureDimension({