Skip to content

Commit

Permalink
remove check
Browse files Browse the repository at this point in the history
  • Loading branch information
mbondyra committed Oct 31, 2024
1 parent 1a368d9 commit 4bd496d
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 61 deletions.
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();

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();
});

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();

await retry.try(async function tryingForTime() {
const metricValue = await visChart.getGaugeValue();
Expand Down
61 changes: 30 additions & 31 deletions test/functional/apps/visualize/group3/_pie_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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 () => {
Expand Down Expand Up @@ -108,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(true);
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 @@ -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();
});
Expand Down Expand Up @@ -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);
});
});

Expand All @@ -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 () => {
Expand All @@ -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',
Expand Down Expand Up @@ -286,7 +285,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
'osx',
].sort();

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

Expand All @@ -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(
Expand Down Expand Up @@ -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 () => {
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}

Expand All @@ -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);
Expand All @@ -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 () => {
Expand Down Expand Up @@ -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);
Expand All @@ -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();
Expand Down
14 changes: 6 additions & 8 deletions x-pack/test/functional/apps/lens/open_in_lens/agg_based/pie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down Expand Up @@ -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);
});
Expand Down Expand Up @@ -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();
Expand All @@ -108,15 +106,15 @@ 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 () => {
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();
Expand All @@ -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();
Expand Down
Loading

0 comments on commit 4bd496d

Please sign in to comment.