From 4bd496d5ec45c6a79501c3d0af88125646f7a17e Mon Sep 17 00:00:00 2001 From: Marta Bondyra Date: Thu, 31 Oct 2024 10:06:40 +0100 Subject: [PATCH] remove check --- .../apps/visualize/group2/_gauge_chart.ts | 6 +- .../apps/visualize/group3/_pie_chart.ts | 61 +++++++++---------- .../apps/lens/open_in_lens/agg_based/pie.ts | 14 ++--- .../apps/lens/open_in_lens/agg_based/xy.ts | 36 ++++++----- 4 files changed, 56 insertions(+), 61 deletions(-) diff --git a/test/functional/apps/visualize/group2/_gauge_chart.ts b/test/functional/apps/visualize/group2/_gauge_chart.ts index 8ff6d31229081..a6942cd284e5d 100644 --- a/test/functional/apps/visualize/group2/_gauge_chart.ts +++ b/test/functional/apps/visualize/group2/_gauge_chart.ts @@ -62,7 +62,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await testSubjects.click('gaugePercentageMode'); await testSubjects.setValue('gaugePercentageModeFormatPattern', '0.0%'); await visChart.waitForVisualizationRenderingStabilized(); - await visEditor.clickGo(false); + await visEditor.clickGo(); await retry.try(async function tryingForTime() { const expectedTexts = ['57.3%', 'Average bytes']; @@ -82,7 +82,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visEditor.selectField('machine.os.raw'); log.debug('Size = 4'); await visEditor.setSize(4); - await visEditor.clickGo(false); + await visEditor.clickGo(); }); it('should show Split Gauges', async () => { @@ -118,7 +118,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visEditor.clickBucket('Metric', 'metrics'); await visEditor.selectAggregation('Min', 'metrics'); await visEditor.selectField('bytes', 'metrics'); - await visEditor.clickGo(false); + await visEditor.clickGo(); await retry.try(async function tryingForTime() { const metricValue = await visChart.getGaugeValue(); diff --git a/test/functional/apps/visualize/group3/_pie_chart.ts b/test/functional/apps/visualize/group3/_pie_chart.ts index f8196709a2b46..f7559c43a6f53 100644 --- a/test/functional/apps/visualize/group3/_pie_chart.ts +++ b/test/functional/apps/visualize/group3/_pie_chart.ts @@ -28,7 +28,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('pie chart', function () { // Used to track flag before and after reset - const isNewChartsLibraryEnabled = false; const vizName1 = 'Visualization PieChart'; before(async function () { await visualize.initTests(); @@ -50,7 +49,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { log.debug('setNumericInterval 4000'); await visEditor.setInterval('40000', { type: 'numeric' }); log.debug('clickGo'); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); }); after(async () => { @@ -108,8 +107,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visEditor.toggleOtherBucket(2); await visEditor.toggleMissingBucket(2); log.debug('clickGo'); - await visEditor.clickGo(isNewChartsLibraryEnabled); - await pieChart.expectPieChartLabels(expectedTableData, isNewChartsLibraryEnabled); + await visEditor.clickGo(true); + await pieChart.expectPieChartLabels(expectedTableData); }); it('should apply correct filter on other bucket', async () => { @@ -117,7 +116,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await pieChart.filterOnPieSlice('Other'); await visChart.waitForVisualization(); - await pieChart.expectPieChartLabels(expectedTableData, isNewChartsLibraryEnabled); + await pieChart.expectPieChartLabels(expectedTableData); await filterBar.removeFilter('machine.os.raw'); await visChart.waitForVisualization(); }); @@ -127,7 +126,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visChart.filterLegend('Other'); await visChart.waitForVisualization(); - await pieChart.expectPieChartLabels(expectedTableData, isNewChartsLibraryEnabled); + await pieChart.expectPieChartLabels(expectedTableData); await filterBar.removeFilter('machine.os.raw'); await visChart.waitForVisualization(); }); @@ -186,8 +185,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visEditor.toggleOtherBucket(3); await visEditor.toggleMissingBucket(3); log.debug('clickGo'); - await visEditor.clickGo(isNewChartsLibraryEnabled); - await pieChart.expectPieChartLabels(expectedTableData, isNewChartsLibraryEnabled); + await visEditor.clickGo(true); + await pieChart.expectPieChartLabels(expectedTableData); }); }); @@ -204,9 +203,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visEditor.selectAggregation('Terms'); await visEditor.selectField('machine.os.raw'); await visEditor.toggleDisabledAgg(2); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); - await pieChart.expectPieChartLabels(expectedTableData, isNewChartsLibraryEnabled); + await pieChart.expectPieChartLabels(expectedTableData); }); it('should correctly save disabled agg', async () => { @@ -216,12 +215,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visChart.waitForRenderingCount(); const expectedTableData = ['ios', 'osx', 'win 7', 'win 8', 'win xp']; - await pieChart.expectPieChartLabels(expectedTableData, isNewChartsLibraryEnabled); + await pieChart.expectPieChartLabels(expectedTableData); }); it('should show correct result when agg is re-enabled', async () => { await visEditor.toggleDisabledAgg(2); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); const expectedTableData = [ '0', @@ -286,7 +285,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'osx', ].sort(); - await pieChart.expectPieChartLabels(expectedTableData, isNewChartsLibraryEnabled); + await pieChart.expectPieChartLabels(expectedTableData); }); }); @@ -306,7 +305,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visEditor.addNewFilterAggregation(); log.debug('Set the 2nd filter value'); await visEditor.setFilterAggregationValue('geo.dest:"CN"', 1); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); const emptyFromTime = 'Sep 19, 2016 @ 06:31:44.000'; const emptyToTime = 'Sep 23, 2016 @ 18:31:44.000'; log.debug( @@ -339,7 +338,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visEditor.clickBucket('Split slices'); await visEditor.selectAggregation('Terms'); await visEditor.selectField('geo.dest'); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); }); it('should show correct chart', async () => { @@ -396,7 +395,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ['360,000', '47', 'BR', '2'], ].map((row) => // the count of records is not shown for every split level in the new charting library - isNewChartsLibraryEnabled ? [row[0], ...row.slice(2)] : row + [row[0], ...row.slice(2)] ); await inspector.open(); @@ -428,23 +427,23 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { '360,000', 'CN', ].sort(); - if (isNewChartsLibraryEnabled) { - await visEditor.clickOptionsTab(); - await visEditor.togglePieLegend(); - await visEditor.togglePieNestedLegend(); - await visEditor.clickDataTab(); - await visEditor.clickGo(isNewChartsLibraryEnabled); - } + + await visEditor.clickOptionsTab(); + await visEditor.togglePieLegend(); + await visEditor.togglePieNestedLegend(); + await visEditor.clickDataTab(); + await visEditor.clickGo(true); + await visChart.filterLegend('CN'); await visChart.waitForVisualization(); - await pieChart.expectPieChartLabels(expectedTableData, isNewChartsLibraryEnabled); + await pieChart.expectPieChartLabels(expectedTableData); await filterBar.removeFilter('geo.dest'); await visChart.waitForVisualization(); }); - it('should still showing pie chart when a subseries have zero data', async function () { - if (isNewChartsLibraryEnabled) { - // TODO: it seems that adding a filter agg which has no results to a pie chart breaks it and instead it shows "no data" + // TODO: it seems that adding a filter agg which has no results to a pie chart breaks it and instead it shows "no data" + it.skip('should still showing pie chart when a subseries have zero data', async function () { + if (/* isNewChartsLibraryEnabled*/ true) { return; } @@ -466,7 +465,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visEditor.selectAggregation('Filters'); log.debug('Set the 1st filter value of the aggregation id 3'); await visEditor.setFilterAggregationValue('geo.dest:"UX"', 0, 3); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); const legends = await visChart.getLegendEntries(); const expectedLegends = ['geo.dest:"US"', 'geo.dest:"UX"']; expect(legends).to.eql(expectedLegends); @@ -487,7 +486,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visEditor.clickBucket('Split slices'); await visEditor.selectAggregation('Terms'); await visEditor.selectField('geo.src'); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); }); it('shows correct split chart', async () => { @@ -519,7 +518,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ['osx', '1,322', 'BR', '30'], ].map((row) => // the count of records is not shown for every split level in the new charting library - isNewChartsLibraryEnabled ? [row[0], ...row.slice(2)] : row + [row[0], ...row.slice(2)] ); await inspector.open(); await inspector.setTablePageSize(50); @@ -536,7 +535,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ['osx', '228', 'CN', '228'], ].map((row) => // the count of records is not shown for every split level in the new charting library - isNewChartsLibraryEnabled ? [row[0], ...row.slice(2)] : row + [row[0], ...row.slice(2)] ); await visChart.filterLegend('CN'); await header.waitUntilLoadingHasFinished(); 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 d4b3407676ae7..6e1534ad6e6c9 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 @@ -21,17 +21,15 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const testSubjects = getService('testSubjects'); describe('Pie', function describeIndexTests() { - const isNewChartsLibraryEnabled = true; - before(async () => { await visualize.initTests(); + await timePicker.setDefaultAbsoluteRangeViaUiSettings(); }); beforeEach(async () => { 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 () => { @@ -60,7 +58,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visEditor.selectAggregation('Terms'); await visEditor.selectField('machine.os.raw'); await header.waitUntilLoadingHasFinished(); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); expect(await visualize.hasNavigateToLensButton()).to.eql(true); }); @@ -94,7 +92,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visEditor.clickBucket('Split slices'); await visEditor.selectAggregation('Terms'); await visEditor.selectField('machine.os.raw'); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); await header.waitUntilLoadingHasFinished(); await visualize.navigateToLensFromAnotherVisualization(); @@ -108,7 +106,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(sliceByText).to.be('machine.os.raw: Descending'); expect(sizeByText).to.be('Count'); - await pieChart.expectPieChartLabels(expectedTableData, isNewChartsLibraryEnabled); + await pieChart.expectPieChartLabels(expectedTableData); }); it('should convert types correctly', async () => { @@ -116,7 +114,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visEditor.selectAggregation('Terms'); await visEditor.selectField('machine.os.raw'); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); await header.waitUntilLoadingHasFinished(); await visualize.navigateToLensFromAnotherVisualization(); @@ -133,7 +131,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visEditor.clickOptionsTab(); const isDonutButton = await testSubjects.find('visTypePieIsDonut'); await isDonutButton.click(); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); await header.waitUntilLoadingHasFinished(); await visualize.navigateToLensFromAnotherVisualization(); 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 ced90182a64e1..a024a1b294298 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 @@ -22,8 +22,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const retry = getService('retry'); describe('XY', function describeIndexTests() { - const isNewChartsLibraryEnabled = true; - before(async () => { await visualize.initTests(); }); @@ -43,7 +41,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visEditor.clickBucket('Dot size', 'metrics'); await visEditor.selectAggregation('Max', 'metrics'); await visEditor.selectField('memory', 'metrics'); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); await header.waitUntilLoadingHasFinished(); expect(await visualize.hasNavigateToLensButton()).to.eql(false); }); @@ -52,7 +50,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visEditor.clickBucket('Split chart'); await visEditor.selectAggregation('Terms'); await visEditor.selectField('machine.os.raw'); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); await header.waitUntilLoadingHasFinished(); expect(await visualize.hasNavigateToLensButton()).to.eql(false); }); @@ -69,7 +67,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visEditor.selectYAxisPosition('ValueAxis-1', 'left'); await visEditor.clickYAxisOptions('ValueAxis-2'); await visEditor.selectYAxisPosition('ValueAxis-2', 'left'); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); await header.waitUntilLoadingHasFinished(); expect(await visualize.hasNavigateToLensButton()).to.eql(false); }); @@ -80,7 +78,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visEditor.selectField('machine.os.raw'); await visEditor.clickBucket('Split series'); await visEditor.selectAggregation('Date histogram', 'buckets', false, 1); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); await header.waitUntilLoadingHasFinished(); expect(await visualize.hasNavigateToLensButton()).to.eql(false); }); @@ -91,7 +89,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visEditor.clickBucket('Split series'); await visEditor.selectAggregation('Terms'); await visEditor.selectField('machine.os.raw'); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); await header.waitUntilLoadingHasFinished(); expect(await visualize.hasNavigateToLensButton()).to.eql(false); }); @@ -101,7 +99,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visEditor.selectAggregation('Serial diff', 'metrics'); await visEditor.clickBucket('Split series'); await visEditor.selectAggregation('Date histogram'); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); await header.waitUntilLoadingHasFinished(); const button = await testSubjects.exists('visualizeEditInLensButton'); expect(button).to.eql(false); @@ -116,7 +114,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visEditor.setSeriesType(0, 'area'); await visEditor.toggleAccordion('visEditorSeriesAccordion2'); await visEditor.setSeriesType(1, 'histogram'); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); await header.waitUntilLoadingHasFinished(); await visualize.navigateToLensFromAnotherVisualization(); await lens.waitForVisualization('xyVisChart'); @@ -143,7 +141,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visEditor.setSeriesType(0, 'histogram'); await visEditor.toggleAccordion('visEditorSeriesAccordion2'); await visEditor.setSeriesType(1, 'histogram'); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); await header.waitUntilLoadingHasFinished(); await visualize.navigateToLensFromAnotherVisualization(); await lens.waitForVisualization('xyVisChart'); @@ -165,7 +163,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visEditor.selectAggregation('Cumulative sum', 'metrics'); await visEditor.clickBucket('Split series'); await visEditor.selectAggregation('Date histogram'); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); await header.waitUntilLoadingHasFinished(); await visualize.navigateToLensFromAnotherVisualization(); await lens.waitForVisualization('xyVisChart'); @@ -182,7 +180,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('should convert sibling pipeline aggregation', async () => { await visEditor.clickMetricEditor(); await visEditor.selectAggregation('Max Bucket', 'metrics'); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); await header.waitUntilLoadingHasFinished(); await visualize.navigateToLensFromAnotherVisualization(); @@ -204,7 +202,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('should draw a reference line', async () => { await visEditor.clickOptionsTab(); await visEditor.toggleShowThresholdLine(); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); const line = await visChart.getReferenceLine('xyVisChart'); expect(line?.length).to.be(1); await header.waitUntilLoadingHasFinished(); @@ -229,7 +227,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visEditor.toggleAccordion('visEditorSeriesAccordion1'); await visEditor.setSeriesType(0, 'line'); await visEditor.selectChartMode('stacked'); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); await header.waitUntilLoadingHasFinished(); await visualize.navigateToLensFromAnotherVisualization(); @@ -249,7 +247,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visEditor.selectChartMode('normal'); await visEditor.clickYAxisOptions('ValueAxis-1'); await visEditor.selectYAxisMode('percentage'); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); await header.waitUntilLoadingHasFinished(); await visualize.navigateToLensFromAnotherVisualization(); @@ -268,7 +266,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visEditor.setSeriesType(0, 'histogram'); await visEditor.clickYAxisOptions('ValueAxis-1'); await visEditor.selectYAxisPosition('ValueAxis-1', 'top'); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); await header.waitUntilLoadingHasFinished(); await visualize.navigateToLensFromAnotherVisualization(); @@ -294,7 +292,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visEditor.selectYAxisPosition('ValueAxis-1', 'left'); await visEditor.clickYAxisOptions('ValueAxis-2'); await visEditor.selectYAxisPosition('ValueAxis-2', 'right'); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); await header.waitUntilLoadingHasFinished(); await visualize.navigateToLensFromAnotherVisualization(); @@ -322,7 +320,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visEditor.selectAggregation('Terms'); await visEditor.selectField('machine.os.raw'); await header.waitUntilLoadingHasFinished(); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); const expectedData = await visChart.getLegendEntriesXYCharts('xyVisChart'); await visualize.navigateToLensFromAnotherVisualization(); @@ -344,7 +342,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visEditor.clickBucket('X-axis'); await visEditor.selectAggregation('Terms'); await visEditor.selectField('machine.os.raw'); - await visEditor.clickGo(isNewChartsLibraryEnabled); + await visEditor.clickGo(true); await header.waitUntilLoadingHasFinished(); const expectedData = await visChart.getLegendEntriesXYCharts('xyVisChart'); await visualize.navigateToLensFromAnotherVisualization();