Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] [Visualize] remove never executing functional tests code (#198512) #199737

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/functional/apps/getting_started/_shakespeare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

// Remove refresh click when vislib is removed
// https://github.com/elastic/kibana/issues/56143
await PageObjects.visualize.clickRefresh(true);
await PageObjects.visualize.clickRefresh();

const expectedChartValues = [111396];
await retry.try(async () => {
Expand Down
6 changes: 3 additions & 3 deletions test/functional/apps/visualize/group2/_gauge_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(true);

await retry.try(async function tryingForTime() {
const expectedTexts = ['57.3%', 'Average bytes'];
Expand All @@ -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(true);
});

it('should show Split Gauges', async () => {
Expand Down Expand Up @@ -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(true);

await retry.try(async function tryingForTime() {
const metricValue = await visChart.getGaugeValue();
Expand Down
8 changes: 4 additions & 4 deletions test/functional/apps/visualize/group2/_heatmap_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
isNewChartsLibraryEnabled = await visChart.isNewChartsLibraryEnabled(
'visualization:visualize:legacyHeatmapChartsLibrary'
);
await visualize.initTests(isNewChartsLibraryEnabled);
await visualize.initTests(!isNewChartsLibraryEnabled);
log.debug('navigateToApp visualize');
await visualize.navigateToNewAggBasedVisualization();
log.debug('clickHeatmapChart');
Expand All @@ -43,7 +43,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
log.debug('Field = @timestamp');
await visEditor.selectField('@timestamp');
// leaving Interval set to Auto
await visEditor.clickGo(isNewChartsLibraryEnabled);
await visEditor.clickGo(!isNewChartsLibraryEnabled);
});

it('should save and load', async function () {
Expand Down Expand Up @@ -102,7 +102,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('should show 6 color ranges if changed on options', async function () {
await visEditor.clickOptionsTab();
await visEditor.changeHeatmapColorNumbers(6);
await visEditor.clickGo(isNewChartsLibraryEnabled);
await visEditor.clickGo(!isNewChartsLibraryEnabled);
await visChart.waitForVisualizationRenderingStabilized();

const legends = await visChart.getLegendEntries();
Expand Down Expand Up @@ -143,7 +143,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
log.debug('customize 2 last ranges');
await visEditor.setCustomRangeByIndex(6, '650', '720');
await visEditor.setCustomRangeByIndex(7, '800', '905');
await visEditor.clickGo(isNewChartsLibraryEnabled);
await visEditor.clickGo(!isNewChartsLibraryEnabled);

await visChart.waitForVisualizationRenderingStabilized();
const legends = await visChart.getLegendEntries();
Expand Down
69 changes: 31 additions & 38 deletions test/functional/apps/visualize/group3/_pie_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

describe('pie chart', function () {
// Used to track flag before and after reset
let isNewChartsLibraryEnabled = false;
const vizName1 = 'Visualization PieChart';
before(async function () {
isNewChartsLibraryEnabled = await visChart.isNewChartsLibraryEnabled();
await visualize.initTests(isNewChartsLibraryEnabled);
await visualize.initTests();

log.debug('navigateToApp visualize');
await visualize.navigateToNewAggBasedVisualization();
Expand All @@ -51,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();
});

after(async () => {
Expand All @@ -70,7 +68,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});

it('should show 10 slices in pie chart', async function () {
await pieChart.expectPieSliceCount(10, isNewChartsLibraryEnabled);
await pieChart.expectPieSliceCount(10);
});

it('should show correct data', async function () {
Expand Down Expand Up @@ -109,16 +107,16 @@ 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();
await pieChart.expectPieChartLabels(expectedTableData);
});

it('should apply correct filter on other bucket', async () => {
const expectedTableData = ['Missing', 'osx'];

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();
});
Expand All @@ -128,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();
});
Expand Down Expand Up @@ -187,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();
await pieChart.expectPieChartLabels(expectedTableData);
});
});

Expand All @@ -205,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();

await pieChart.expectPieChartLabels(expectedTableData, isNewChartsLibraryEnabled);
await pieChart.expectPieChartLabels(expectedTableData);
});

it('should correctly save disabled agg', async () => {
Expand All @@ -217,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();

const expectedTableData = [
'0',
Expand Down Expand Up @@ -287,7 +285,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
'osx',
].sort();

await pieChart.expectPieChartLabels(expectedTableData, isNewChartsLibraryEnabled);
await pieChart.expectPieChartLabels(expectedTableData);
});
});

Expand All @@ -307,15 +305,14 @@ 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();
const emptyFromTime = 'Sep 19, 2016 @ 06:31:44.000';
const emptyToTime = 'Sep 23, 2016 @ 18:31:44.000';
log.debug(
'Switch to a different time range from "' + emptyFromTime + '" to "' + emptyToTime + '"'
);
await timePicker.setAbsoluteRange(emptyFromTime, emptyToTime);
await visChart.waitForVisualization();
await visChart.expectError();
});
});
describe('multi series slice', () => {
Expand All @@ -341,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();
});

it('should show correct chart', async () => {
Expand Down Expand Up @@ -398,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();
Expand Down Expand Up @@ -430,26 +427,22 @@ 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();

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"
return;
}

// 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 () {
await visualize.navigateToNewAggBasedVisualization();
log.debug('clickPieChart');
await visualize.clickPieChart();
Expand All @@ -468,7 +461,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();
const legends = await visChart.getLegendEntries();
const expectedLegends = ['geo.dest:"US"', 'geo.dest:"UX"'];
expect(legends).to.eql(expectedLegends);
Expand All @@ -489,7 +482,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();
});

it('shows correct split chart', async () => {
Expand Down Expand Up @@ -521,7 +514,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);
Expand All @@ -538,7 +531,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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
legendNames = await visualBuilder.getLegendNames();
expect(legendNames).to.eql(['png', 'php']);

await visualize.clickRefresh(true);
await visualize.clickRefresh();
legendNames = await visualBuilder.getLegendNames();
expect(legendNames).to.eql(['png', 'php']);
});
Expand Down
Loading