diff --git a/test/functional/apps/discover/group1/_filter_editor.ts b/test/functional/apps/discover/group1/_filter_editor.ts index fdc21921833f4..7e338f553d940 100644 --- a/test/functional/apps/discover/group1/_filter_editor.ts +++ b/test/functional/apps/discover/group1/_filter_editor.ts @@ -34,9 +34,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // and load a set of makelogs data await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); await kibanaServer.uiSettings.replace(defaultSettings); + await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); log.debug('discover filter editor'); await PageObjects.common.navigateToApp('discover'); - await PageObjects.timePicker.setDefaultAbsoluteRange(); }); describe('filter editor', function () { @@ -169,6 +169,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { after(async () => { await security.testUser.restoreDefaults(); + await PageObjects.common.unsetTime(); }); }); } diff --git a/test/functional/apps/visualize/group1/_data_table.ts b/test/functional/apps/visualize/group1/_data_table.ts index 19af7438fe202..90936b26808a8 100644 --- a/test/functional/apps/visualize/group1/_data_table.ts +++ b/test/functional/apps/visualize/group1/_data_table.ts @@ -29,13 +29,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { before(async function () { await PageObjects.visualize.initTests(); + await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); log.debug('navigateToApp visualize'); await PageObjects.visualize.navigateToNewAggBasedVisualization(); log.debug('clickDataTable'); await PageObjects.visualize.clickDataTable(); log.debug('clickNewSearch'); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); log.debug('Bucket = Split rows'); await PageObjects.visEditor.clickBucket('Split rows'); log.debug('Aggregation = Histogram'); @@ -47,6 +47,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.clickGo(); }); + after(async () => { + await PageObjects.common.unsetTime(); + }); + it('should allow applying changed params', async () => { await PageObjects.visEditor.setInterval('1', { type: 'numeric', append: true }); const interval = await PageObjects.visEditor.getNumericInterval(); @@ -131,7 +135,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.navigateToNewAggBasedVisualization(); await PageObjects.visualize.clickDataTable(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); await PageObjects.visEditor.clickBucket('Split rows'); await PageObjects.visEditor.selectAggregation('Range'); await PageObjects.visEditor.selectField('bytes'); @@ -174,7 +177,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.navigateToNewAggBasedVisualization(); await PageObjects.visualize.clickDataTable(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); await PageObjects.visEditor.clickBucket('Metric', 'metrics'); await PageObjects.visEditor.selectAggregation('Average Bucket', 'metrics'); await PageObjects.visEditor.selectAggregation('Terms', 'metrics', true); @@ -188,7 +190,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.navigateToNewAggBasedVisualization(); await PageObjects.visualize.clickDataTable(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); await PageObjects.visEditor.clickBucket('Split rows'); await PageObjects.visEditor.selectAggregation('Date Histogram'); await PageObjects.visEditor.selectField('@timestamp'); @@ -206,7 +207,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.navigateToNewAggBasedVisualization(); await PageObjects.visualize.clickDataTable(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); await PageObjects.visEditor.clickBucket('Split rows'); await PageObjects.visEditor.selectAggregation('Date Histogram'); await PageObjects.visEditor.selectField('UTC time'); @@ -244,7 +244,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.navigateToNewAggBasedVisualization(); await PageObjects.visualize.clickDataTable(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); await PageObjects.visEditor.clickMetricEditor(); await PageObjects.visEditor.selectAggregation('Top Hit', 'metrics'); await PageObjects.visEditor.selectField('agent.raw', 'metrics'); @@ -258,7 +257,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.navigateToNewAggBasedVisualization(); await PageObjects.visualize.clickDataTable(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); await PageObjects.visEditor.clickBucket('Split rows'); await PageObjects.visEditor.selectAggregation('Range'); await PageObjects.visEditor.selectField('bytes'); @@ -275,7 +273,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.navigateToNewAggBasedVisualization(); await PageObjects.visualize.clickDataTable(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); await PageObjects.visEditor.clickBucket('Split rows'); await PageObjects.visEditor.selectAggregation('Terms'); await PageObjects.visEditor.selectField('extension.raw'); @@ -313,7 +310,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.navigateToNewAggBasedVisualization(); await PageObjects.visualize.clickDataTable(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); await PageObjects.visEditor.clickBucket('Split rows'); await PageObjects.visEditor.selectAggregation('Terms'); await PageObjects.visEditor.selectField('extension.raw'); @@ -407,7 +403,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.navigateToNewAggBasedVisualization(); await PageObjects.visualize.clickDataTable(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); await PageObjects.visEditor.clickBucket('Split table'); // split by column to make all tables rows visible await PageObjects.visEditor.clickSplitDirection('Columns'); diff --git a/test/functional/apps/visualize/group3/_add_to_dashboard.ts b/test/functional/apps/visualize/group3/_add_to_dashboard.ts index 32d329cd181da..896826c2caa07 100644 --- a/test/functional/apps/visualize/group3/_add_to_dashboard.ts +++ b/test/functional/apps/visualize/group3/_add_to_dashboard.ts @@ -28,12 +28,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('Add to Dashboard', function describeIndexTests() { before(async () => { await PageObjects.visualize.initTests(); + await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); + }); + after(async () => { + await PageObjects.common.unsetTime(); }); it('adding a new metric to a new dashboard by value', async function () { await PageObjects.visualize.navigateToNewAggBasedVisualization(); await PageObjects.visualize.clickMetric(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); await testSubjects.click('visualizeSaveButton'); @@ -57,7 +60,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.navigateToNewAggBasedVisualization(); await PageObjects.visualize.clickMetric(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); await testSubjects.click('visualizeSaveButton'); @@ -83,7 +85,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.navigateToNewAggBasedVisualization(); await PageObjects.visualize.clickMetric(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); await testSubjects.click('visualizeSaveButton'); @@ -122,7 +123,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.navigateToNewAggBasedVisualization(); await PageObjects.visualize.clickMetric(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); await testSubjects.click('visualizeSaveButton'); @@ -169,7 +169,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.navigateToNewAggBasedVisualization(); await PageObjects.visualize.clickMetric(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); await testSubjects.click('visualizeSaveButton'); @@ -200,7 +199,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.navigateToNewAggBasedVisualization(); await PageObjects.visualize.clickMetric(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); await testSubjects.click('visualizeSaveButton'); @@ -233,7 +231,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.navigateToNewAggBasedVisualization(); await PageObjects.visualize.clickMetric(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); await testSubjects.click('visualizeSaveButton'); @@ -279,7 +276,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.navigateToNewAggBasedVisualization(); await PageObjects.visualize.clickMetric(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); await testSubjects.click('visualizeSaveButton'); diff --git a/test/functional/apps/visualize/group3/_pie_chart.ts b/test/functional/apps/visualize/group3/_pie_chart.ts index e971daa18c8cb..466c82227606f 100644 --- a/test/functional/apps/visualize/group3/_pie_chart.ts +++ b/test/functional/apps/visualize/group3/_pie_chart.ts @@ -35,10 +35,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { log.debug('navigateToApp visualize'); await PageObjects.visualize.navigateToNewAggBasedVisualization(); + await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); log.debug('clickPieChart'); await PageObjects.visualize.clickPieChart(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); log.debug('select bucket Split slices'); await PageObjects.visEditor.clickBucket('Split slices'); log.debug('Click aggregation Histogram'); @@ -53,6 +53,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.clickGo(isNewChartsLibraryEnabled); }); + after(async () => { + await PageObjects.common.unsetTime(); + }); + it('should save and load', async function () { await PageObjects.visualize.saveVisualizationExpectSuccessAndBreadcrumb(vizName1); @@ -95,7 +99,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { log.debug('clickPieChart'); await PageObjects.visualize.clickPieChart(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); log.debug('select bucket Split slices'); await PageObjects.visEditor.clickBucket('Split slices'); log.debug('Click aggregation Terms'); @@ -293,7 +296,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { log.debug('clickPieChart'); await PageObjects.visualize.clickPieChart(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); log.debug('select bucket Split slices'); await PageObjects.visEditor.clickBucket('Split slices'); log.debug('Click aggregation Filters'); @@ -322,14 +324,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { log.debug('clickPieChart'); await PageObjects.visualize.clickPieChart(); await PageObjects.visualize.clickNewSearch(); - log.debug( - 'Set absolute time range from "' + - PageObjects.timePicker.defaultStartTime + - '" to "' + - PageObjects.timePicker.defaultEndTime + - '"' - ); - await PageObjects.timePicker.setDefaultAbsoluteRange(); log.debug('select bucket Split slices'); await PageObjects.visEditor.clickBucket('Split slices'); log.debug('Click aggregation Histogram'); @@ -459,7 +453,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { log.debug('clickPieChart'); await PageObjects.visualize.clickPieChart(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); log.debug('select bucket Split slices'); await PageObjects.visEditor.clickBucket('Split slices'); log.debug('Click aggregation Filters'); @@ -486,7 +479,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.navigateToNewAggBasedVisualization(); await PageObjects.visualize.clickPieChart(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); log.debug('select bucket Split chart'); await PageObjects.visEditor.clickBucket('Split chart'); await PageObjects.visEditor.selectAggregation('Terms'); diff --git a/test/functional/apps/visualize/group4/_tsvb_chart.ts b/test/functional/apps/visualize/group4/_tsvb_chart.ts index aa66ca7ece7ab..02ebf6b32f85e 100644 --- a/test/functional/apps/visualize/group4/_tsvb_chart.ts +++ b/test/functional/apps/visualize/group4/_tsvb_chart.ts @@ -35,6 +35,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await common.setTime({ from, to }); }); + after(async () => { + await common.unsetTime(); + }); + beforeEach(async () => { await security.testUser.setRoles( ['kibana_admin', 'test_logstash_reader', 'kibana_sample_admin'], @@ -427,7 +431,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('switch panel interval test', () => { beforeEach(async () => { - await visualBuilder.setTime(); await visualBuilder.clickMetric(); await visualBuilder.checkMetricTabIsPresent(); await visualBuilder.clickPanelOptions('metric'); @@ -548,7 +551,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); beforeEach(async () => { - await visualBuilder.setTime(); await visualBuilder.selectAggType('Average'); await visualBuilder.setFieldForAggregation('bytes'); await visualBuilder.setMetricsGroupByTerms('machine.os.raw'); diff --git a/test/functional/apps/visualize/group6/_tag_cloud.ts b/test/functional/apps/visualize/group6/_tag_cloud.ts index d021e8b08d43a..e1f6109c49608 100644 --- a/test/functional/apps/visualize/group6/_tag_cloud.ts +++ b/test/functional/apps/visualize/group6/_tag_cloud.ts @@ -35,12 +35,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { before(async function () { await PageObjects.visualize.initTests(); + await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); log.debug('navigateToApp visualize'); await PageObjects.visualize.navigateToNewAggBasedVisualization(); log.debug('clickTagCloud'); await PageObjects.visualize.clickTagCloud(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); log.debug('select Tags'); await PageObjects.visEditor.clickBucket('Tags'); log.debug('Click aggregation Terms'); @@ -53,6 +53,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.clickGo(); }); + after(async () => { + await PageObjects.common.unsetTime(); + }); + it('should have inspector enabled', async function () { await inspector.expectIsEnabled(); }); @@ -161,7 +165,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { navigateToVisualize: false, }); await PageObjects.header.waitUntilLoadingHasFinished(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); await PageObjects.visChart.waitForVisualization(); }); diff --git a/test/functional/apps/visualize/replaced_vislib_chart_types/_area_chart.ts b/test/functional/apps/visualize/replaced_vislib_chart_types/_area_chart.ts index 3e765baf3ba64..50f0988575750 100644 --- a/test/functional/apps/visualize/replaced_vislib_chart_types/_area_chart.ts +++ b/test/functional/apps/visualize/replaced_vislib_chart_types/_area_chart.ts @@ -33,6 +33,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('area charts', function indexPatternCreation() { before(async () => { await PageObjects.visualize.initTests(); + await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); }); const initAreaChart = async () => { log.debug('navigateToApp visualize'); @@ -41,7 +42,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.clickAreaChart(); log.debug('clickNewSearch'); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); log.debug('Click X-axis'); await PageObjects.visEditor.clickBucket('X-axis'); log.debug('Click Date Histogram'); @@ -67,6 +67,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { after(async function () { await security.testUser.restoreDefaults(); + await PageObjects.common.unsetTime(); }); it('should save and load with special characters', async function () { diff --git a/test/functional/apps/visualize/replaced_vislib_chart_types/_line_chart_split_chart.ts b/test/functional/apps/visualize/replaced_vislib_chart_types/_line_chart_split_chart.ts index ef7e3aa916d4a..ee0653c16fc8e 100644 --- a/test/functional/apps/visualize/replaced_vislib_chart_types/_line_chart_split_chart.ts +++ b/test/functional/apps/visualize/replaced_vislib_chart_types/_line_chart_split_chart.ts @@ -32,7 +32,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { log.debug('clickLineChart'); await PageObjects.visualize.clickLineChart(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); log.debug('Bucket = Split chart'); await PageObjects.visEditor.clickBucket('Split chart'); log.debug('Aggregation = Terms'); @@ -46,9 +45,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { before(async () => { await PageObjects.visualize.initTests(); + await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); await initLineChart(); }); + after(async () => { + await PageObjects.common.unsetTime(); + }); + afterEach(async () => { await inspector.close(); }); @@ -242,7 +246,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { log.debug('clickLineChart'); await PageObjects.visualize.clickLineChart(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); }); describe('parent pipeline', () => { diff --git a/test/functional/apps/visualize/replaced_vislib_chart_types/_line_chart_split_series.ts b/test/functional/apps/visualize/replaced_vislib_chart_types/_line_chart_split_series.ts index 8583220d76a5c..b15f264e144e1 100644 --- a/test/functional/apps/visualize/replaced_vislib_chart_types/_line_chart_split_series.ts +++ b/test/functional/apps/visualize/replaced_vislib_chart_types/_line_chart_split_series.ts @@ -32,7 +32,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { log.debug('clickLineChart'); await PageObjects.visualize.clickLineChart(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); log.debug('Bucket = Split chart'); await PageObjects.visEditor.clickBucket('Split series'); log.debug('Aggregation = Terms'); @@ -44,9 +43,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { before(async () => { await PageObjects.visualize.initTests(); + await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); await initLineChart(); }); + after(async () => { + await PageObjects.common.unsetTime(); + }); + afterEach(async () => { await inspector.close(); }); @@ -240,7 +244,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { log.debug('clickLineChart'); await PageObjects.visualize.clickLineChart(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); }); describe('parent pipeline', () => { diff --git a/test/functional/apps/visualize/replaced_vislib_chart_types/_point_series_options.ts b/test/functional/apps/visualize/replaced_vislib_chart_types/_point_series_options.ts index d093959f45405..6fdaa4d5a0189 100644 --- a/test/functional/apps/visualize/replaced_vislib_chart_types/_point_series_options.ts +++ b/test/functional/apps/visualize/replaced_vislib_chart_types/_point_series_options.ts @@ -33,7 +33,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { log.debug('clickLineChart'); await PageObjects.visualize.clickLineChart(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); log.debug('Bucket = X-axis'); await PageObjects.visEditor.clickBucket('X-axis'); log.debug('Aggregation = Date Histogram'); @@ -64,9 +63,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('point series', function describeIndexTests() { before(async () => { await PageObjects.visualize.initTests(); + await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); await initChart(); }); + after(async () => { + await PageObjects.common.unsetTime(); + }); + describe('secondary value axis', function () { it('should show correct chart', async function () { const expectedChartValues = [ @@ -158,7 +162,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.navigateToNewAggBasedVisualization(); await PageObjects.visualize.clickVerticalBarChart(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); log.debug('Bucket = X-axis'); await PageObjects.visEditor.clickBucket('X-axis'); log.debug('Aggregation = Terms'); diff --git a/test/functional/apps/visualize/replaced_vislib_chart_types/_vertical_bar_chart.ts b/test/functional/apps/visualize/replaced_vislib_chart_types/_vertical_bar_chart.ts index 12a7f62a2801d..6e5d26d52f6e8 100644 --- a/test/functional/apps/visualize/replaced_vislib_chart_types/_vertical_bar_chart.ts +++ b/test/functional/apps/visualize/replaced_vislib_chart_types/_vertical_bar_chart.ts @@ -16,13 +16,24 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const inspector = getService('inspector'); const testSubjects = getService('testSubjects'); const filterBar = getService('filterBar'); - const PageObjects = getPageObjects(['visualize', 'visEditor', 'visChart', 'timePicker']); + const PageObjects = getPageObjects([ + 'visualize', + 'visEditor', + 'visChart', + 'timePicker', + 'common', + ]); const xyChartSelector = 'xyVisChart'; describe('vertical bar chart', function () { before(async () => { await PageObjects.visualize.initTests(); + await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); + }); + + after(async () => { + await PageObjects.common.unsetTime(); }); const vizName1 = 'Visualization VerticalBarChart'; @@ -33,7 +44,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { log.debug('clickVerticalBarChart'); await PageObjects.visualize.clickVerticalBarChart(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); log.debug('Bucket = X-Axis'); await PageObjects.visEditor.clickBucket('X-axis'); log.debug('Aggregation = Date Histogram'); @@ -64,7 +74,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.navigateToNewAggBasedVisualization(); await PageObjects.visualize.clickVerticalBarChart(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); await PageObjects.visEditor.clickBucket('X-axis'); await PageObjects.visEditor.selectAggregation('Date Range'); await PageObjects.visEditor.selectField('@timestamp'); @@ -88,7 +97,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.navigateToNewAggBasedVisualization(); await PageObjects.visualize.clickVerticalBarChart(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); await PageObjects.visEditor.clickBucket('X-axis'); log.debug('Aggregation = Date Range'); await PageObjects.visEditor.selectAggregation('Date Range'); diff --git a/x-pack/test/functional/apps/discover/value_suggestions.ts b/x-pack/test/functional/apps/discover/value_suggestions.ts index 41d1b071b6b0d..8d0c0ac5a969a 100644 --- a/x-pack/test/functional/apps/discover/value_suggestions.ts +++ b/x-pack/test/functional/apps/discover/value_suggestions.ts @@ -36,10 +36,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await kibanaServer.uiSettings.update({ 'doc_table:legacy': false, }); + await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); }); after(async () => { await kibanaServer.uiSettings.unset('doc_table:legacy'); + await PageObjects.common.unsetTime(); await kibanaServer.savedObjects.cleanStandardList(); });