diff --git a/x-pack/test/functional/apps/lens/group2/index.ts b/x-pack/test/functional/apps/lens/group2/index.ts index f8e123839e2b8..790e42162dc74 100644 --- a/x-pack/test/functional/apps/lens/group2/index.ts +++ b/x-pack/test/functional/apps/lens/group2/index.ts @@ -13,6 +13,7 @@ export default ({ getService, loadTestFile, getPageObjects }: FtrProviderContext const log = getService('log'); const esArchiver = getService('esArchiver'); const kibanaServer = getService('kibanaServer'); + const { timePicker } = getPageObjects(['timePicker']); describe('lens app - group 2', () => { const esArchive = 'x-pack/test/functional/es_archives/logstash_functional'; @@ -41,6 +42,7 @@ export default ({ getService, loadTestFile, getPageObjects }: FtrProviderContext }); await kibanaServer.importExport.load(fixtureDirs.lensBasic); await kibanaServer.importExport.load(fixtureDirs.lensDefault); + await timePicker.setDefaultAbsoluteRangeViaUiSettings(); }); after(async () => { @@ -48,6 +50,7 @@ export default ({ getService, loadTestFile, getPageObjects }: FtrProviderContext 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/table_dashboard.ts b/x-pack/test/functional/apps/lens/group2/table_dashboard.ts index 097bd1539ff81..a877211030972 100644 --- a/x-pack/test/functional/apps/lens/group2/table_dashboard.ts +++ b/x-pack/test/functional/apps/lens/group2/table_dashboard.ts @@ -39,6 +39,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualize.gotoVisualizationLandingPage(); await listingTable.searchForItemWithName('lnsXYvis'); await lens.clickVisualizeListItemTitle('lnsXYvis'); + await lens.goToTimeRange(); await lens.switchToVisualization('lnsDatatable'); await lens.save('New Table', true, false, false, 'new'); diff --git a/x-pack/test/functional/apps/lens/group5/formula.ts b/x-pack/test/functional/apps/lens/group5/formula.ts index c12551bed35f6..920a538eda260 100644 --- a/x-pack/test/functional/apps/lens/group5/formula.ts +++ b/x-pack/test/functional/apps/lens/group5/formula.ts @@ -23,6 +23,7 @@ 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', @@ -42,7 +43,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({ @@ -63,7 +64,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({ @@ -95,7 +96,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); @@ -144,7 +145,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({ @@ -163,7 +164,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({ @@ -183,7 +184,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({ @@ -218,7 +219,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({ @@ -267,7 +268,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({ @@ -287,7 +288,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/group6/rollup.ts b/x-pack/test/functional/apps/lens/group6/rollup.ts index 0e37a4672d1a6..e33f3a18fb37a 100644 --- a/x-pack/test/functional/apps/lens/group6/rollup.ts +++ b/x-pack/test/functional/apps/lens/group6/rollup.ts @@ -32,6 +32,7 @@ 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', operation: 'date_histogram', @@ -58,7 +59,7 @@ 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 @@ -77,6 +78,7 @@ 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/open_in_lens/agg_based/index.ts b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/index.ts index e0e5eca1a0ffc..3f9c2eb1802eb 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 c211f5bf49019..b4d8eaa913e0d 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,11 +9,12 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ getPageObjects, getService }: FtrProviderContext) { - const { visEditor, visualize, lens, visChart } = getPageObjects([ + const { visEditor, visualize, lens, visChart, timePicker } = getPageObjects([ 'visEditor', 'visualize', 'visChart', 'lens', + 'timePicker', ]); const testSubjects = getService('testSubjects'); @@ -30,6 +31,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visualize.navigateToNewAggBasedVisualization(); await visualize.clickMetric(); 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/xy.ts b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/xy.ts index 5b9df27008d8b..2596eebce6ed1 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 @@ -13,7 +13,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { 'visualize', 'lens', 'visEditor', - 'header', 'visChart', ]);