mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Lens][TSVB] Functional tests for converting of Top N. (#143181)
* Added functional tests for convert to lens top n * Updated tests to check metric with source field * Improved test for last value mode * Added test for static value * Fixed nits * Updated test Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
871cc592aa
commit
1055ec1fc8
11 changed files with 231 additions and 79 deletions
|
@ -148,6 +148,15 @@ export class VisualizePageObject extends FtrService {
|
|||
await this.waitForVisualizationSelectPage();
|
||||
}
|
||||
|
||||
public async navigateToLensFromAnotherVisulization() {
|
||||
const button = await this.testSubjects.find('visualizeEditInLensButton');
|
||||
await button.click();
|
||||
}
|
||||
|
||||
public async hasNavigateToLensButton() {
|
||||
return await this.testSubjects.exists('visualizeEditInLensButton');
|
||||
}
|
||||
|
||||
public async hasVisType(type: string) {
|
||||
return await this.testSubjects.exists(`visType-${type}`);
|
||||
}
|
||||
|
|
|
@ -11,8 +11,6 @@ import { FtrProviderContext } from '../../../../../ftr_provider_context';
|
|||
export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const { visualize, lens, timePicker } = getPageObjects(['visualize', 'lens', 'timePicker']);
|
||||
|
||||
const testSubjects = getService('testSubjects');
|
||||
|
||||
describe('Gauge', function describeIndexTests() {
|
||||
const isNewChartsLibraryEnabled = true;
|
||||
|
||||
|
@ -28,13 +26,11 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
it('should show the "Edit Visualization in Lens" menu item', async () => {
|
||||
const button = await testSubjects.exists('visualizeEditInLensButton');
|
||||
expect(button).to.eql(true);
|
||||
expect(await visualize.hasNavigateToLensButton()).to.eql(true);
|
||||
});
|
||||
|
||||
it('should convert to Lens', async () => {
|
||||
const button = await testSubjects.find('visualizeEditInLensButton');
|
||||
await button.click();
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
await lens.waitForVisualization('gaugeChart');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -11,8 +11,6 @@ import { FtrProviderContext } from '../../../../../ftr_provider_context';
|
|||
export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const { visualize, lens, timePicker } = getPageObjects(['visualize', 'lens', 'timePicker']);
|
||||
|
||||
const testSubjects = getService('testSubjects');
|
||||
|
||||
describe('Goal', function describeIndexTests() {
|
||||
const isNewChartsLibraryEnabled = true;
|
||||
|
||||
|
@ -28,13 +26,11 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
it('should show the "Edit Visualization in Lens" menu item', async () => {
|
||||
const button = await testSubjects.exists('visualizeEditInLensButton');
|
||||
expect(button).to.eql(true);
|
||||
expect(await visualize.hasNavigateToLensButton()).to.eql(true);
|
||||
});
|
||||
|
||||
it('should convert to Lens', async () => {
|
||||
const button = await testSubjects.find('visualizeEditInLensButton');
|
||||
await button.click();
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
await lens.waitForVisualization('mtrVis');
|
||||
expect((await lens.getMetricVisualizationData()).length).to.be.equal(1);
|
||||
expect(await lens.getMetricVisualizationData()).to.eql([
|
||||
|
|
|
@ -11,8 +11,6 @@ import { FtrProviderContext } from '../../../../../ftr_provider_context';
|
|||
export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const { visualize, lens, timePicker } = getPageObjects(['visualize', 'lens', 'timePicker']);
|
||||
|
||||
const testSubjects = getService('testSubjects');
|
||||
|
||||
describe('Metric', function describeIndexTests() {
|
||||
const isNewChartsLibraryEnabled = true;
|
||||
|
||||
|
@ -28,13 +26,11 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
it('should show the "Edit Visualization in Lens" menu item', async () => {
|
||||
const button = await testSubjects.exists('visualizeEditInLensButton');
|
||||
expect(button).to.eql(true);
|
||||
expect(await visualize.hasNavigateToLensButton()).to.eql(true);
|
||||
});
|
||||
|
||||
it('should convert to Lens', async () => {
|
||||
const button = await testSubjects.find('visualizeEditInLensButton');
|
||||
await button.click();
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
await lens.waitForVisualization('mtrVis');
|
||||
expect((await lens.getMetricVisualizationData()).length).to.be.equal(1);
|
||||
expect(await lens.getMetricVisualizationData()).to.eql([
|
||||
|
|
|
@ -17,7 +17,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
'header',
|
||||
]);
|
||||
|
||||
const testSubjects = getService('testSubjects');
|
||||
const pieChart = getService('pieChart');
|
||||
|
||||
describe('Pie', function describeIndexTests() {
|
||||
|
@ -35,8 +34,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
it('should hide the "Edit Visualization in Lens" menu item if no split slices were defined', async () => {
|
||||
const button = await testSubjects.exists('visualizeEditInLensButton');
|
||||
expect(button).to.eql(false);
|
||||
expect(await visualize.hasNavigateToLensButton()).to.eql(false);
|
||||
});
|
||||
|
||||
it('should show the "Edit Visualization in Lens" menu item', async () => {
|
||||
|
@ -46,8 +44,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
await header.waitUntilLoadingHasFinished();
|
||||
await visEditor.clickGo(isNewChartsLibraryEnabled);
|
||||
|
||||
const button = await testSubjects.exists('visualizeEditInLensButton');
|
||||
expect(button).to.eql(true);
|
||||
expect(await visualize.hasNavigateToLensButton()).to.eql(true);
|
||||
});
|
||||
|
||||
it('should convert to Lens', async () => {
|
||||
|
@ -58,8 +55,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
await header.waitUntilLoadingHasFinished();
|
||||
await visEditor.clickGo(isNewChartsLibraryEnabled);
|
||||
|
||||
const button = await testSubjects.find('visualizeEditInLensButton');
|
||||
await button.click();
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
await lens.waitForVisualization('partitionVisChart');
|
||||
|
||||
await pieChart.expectPieChartLabels(expectedTableData, isNewChartsLibraryEnabled);
|
||||
|
|
|
@ -45,8 +45,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
await panelActions.openContextMenu();
|
||||
await panelActions.clickEdit();
|
||||
|
||||
const button = await testSubjects.find('visualizeEditInLensButton');
|
||||
await button.click();
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
await lens.waitForVisualization('xyVisChart');
|
||||
await retry.try(async () => {
|
||||
const dimensions = await testSubjects.findAll('lns-dimensionTrigger');
|
||||
|
@ -74,8 +73,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
await panelActions.openContextMenu();
|
||||
await panelActions.clickEdit();
|
||||
|
||||
const button = await testSubjects.find('visualizeEditInLensButton');
|
||||
await button.click();
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
await lens.waitForVisualization('legacyMtrVis');
|
||||
await retry.try(async () => {
|
||||
const dimensions = await testSubjects.findAll('lns-dimensionTrigger');
|
||||
|
|
|
@ -35,13 +35,11 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
it('should show the "Edit Visualization in Lens" menu item', async () => {
|
||||
const button = await testSubjects.exists('visualizeEditInLensButton');
|
||||
expect(button).to.eql(true);
|
||||
expect(await visualize.hasNavigateToLensButton()).to.eql(true);
|
||||
});
|
||||
|
||||
it('should convert to Lens', async () => {
|
||||
const button = await testSubjects.find('visualizeEditInLensButton');
|
||||
await button.click();
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
await lens.waitForVisualization('mtrVis');
|
||||
|
||||
const metricData = await lens.getMetricVisualizationData();
|
||||
|
@ -54,8 +52,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
|
||||
const button = await testSubjects.find('visualizeEditInLensButton');
|
||||
await button.click();
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
await lens.waitForVisualization('mtrVis');
|
||||
await retry.try(async () => {
|
||||
const layers = await find.allByCssSelector(`[data-test-subj^="lns-layerPanel-"]`);
|
||||
|
@ -74,15 +71,13 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
|
||||
const canEdit = await testSubjects.exists('visualizeEditInLensButton');
|
||||
expect(canEdit).to.be(false);
|
||||
expect(await visualize.hasNavigateToLensButton()).to.be(false);
|
||||
});
|
||||
|
||||
it('should not allow converting of not valid panel', async () => {
|
||||
await visualBuilder.selectAggType('Value Count');
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
const canEdit = await testSubjects.exists('visualizeEditInLensButton');
|
||||
expect(canEdit).to.be(false);
|
||||
expect(await visualize.hasNavigateToLensButton()).to.be(false);
|
||||
});
|
||||
|
||||
it('should convert color ranges', async () => {
|
||||
|
@ -101,8 +96,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
await visualBuilder.setColorPickerValue('#54A000', 4);
|
||||
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
const button = await testSubjects.find('visualizeEditInLensButton');
|
||||
await button.click();
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
|
||||
await lens.waitForVisualization('mtrVis');
|
||||
await retry.try(async () => {
|
||||
|
|
|
@ -13,5 +13,6 @@ export default function ({ loadTestFile }: FtrProviderContext) {
|
|||
loadTestFile(require.resolve('./gauge'));
|
||||
loadTestFile(require.resolve('./timeseries'));
|
||||
loadTestFile(require.resolve('./dashboard'));
|
||||
loadTestFile(require.resolve('./top_n'));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -34,13 +34,11 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
it('should show the "Edit Visualization in Lens" menu item', async () => {
|
||||
const button = await testSubjects.exists('visualizeEditInLensButton');
|
||||
expect(button).to.eql(true);
|
||||
expect(await visualize.hasNavigateToLensButton()).to.eql(true);
|
||||
});
|
||||
|
||||
it('should convert to Lens', async () => {
|
||||
const button = await testSubjects.find('visualizeEditInLensButton');
|
||||
await button.click();
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
await lens.waitForVisualization('mtrVis');
|
||||
|
||||
const metricData = await lens.getMetricVisualizationData();
|
||||
|
@ -53,8 +51,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
|
||||
const button = await testSubjects.find('visualizeEditInLensButton');
|
||||
await button.click();
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
await lens.waitForVisualization('mtrVis');
|
||||
await retry.try(async () => {
|
||||
expect(await lens.getLayerCount()).to.be(1);
|
||||
|
@ -71,8 +68,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
|
||||
const button = await testSubjects.find('visualizeEditInLensButton');
|
||||
await button.click();
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
await lens.waitForVisualization('mtrVis');
|
||||
await retry.try(async () => {
|
||||
expect(await lens.getLayerCount()).to.be(1);
|
||||
|
@ -89,15 +85,13 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
|
||||
const canEdit = await testSubjects.exists('visualizeEditInLensButton');
|
||||
expect(canEdit).to.be(false);
|
||||
expect(await visualize.hasNavigateToLensButton()).to.be(false);
|
||||
});
|
||||
|
||||
it('should not allow converting of not valid panel', async () => {
|
||||
await visualBuilder.selectAggType('Value Count');
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
const canEdit = await testSubjects.exists('visualizeEditInLensButton');
|
||||
expect(canEdit).to.be(false);
|
||||
expect(await visualize.hasNavigateToLensButton()).to.be(false);
|
||||
});
|
||||
|
||||
it('should convert color ranges', async () => {
|
||||
|
@ -107,8 +101,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
await visualBuilder.setColorPickerValue('#54B399');
|
||||
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
const button = await testSubjects.find('visualizeEditInLensButton');
|
||||
await button.click();
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
|
||||
await lens.waitForVisualization('mtrVis');
|
||||
await retry.try(async () => {
|
||||
|
|
|
@ -35,15 +35,11 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
it('should show the "Edit Visualization in Lens" menu item for a count aggregation', async () => {
|
||||
const isMenuItemVisible = await find.existsByCssSelector(
|
||||
'[data-test-subj="visualizeEditInLensButton"]'
|
||||
);
|
||||
expect(isMenuItemVisible).to.be(true);
|
||||
expect(await visualize.hasNavigateToLensButton()).to.be(true);
|
||||
});
|
||||
|
||||
it('visualizes field to Lens and loads fields to the dimesion editor', async () => {
|
||||
const button = await testSubjects.find('visualizeEditInLensButton');
|
||||
await button.click();
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
await lens.waitForVisualization('xyVisChart');
|
||||
await retry.try(async () => {
|
||||
const dimensions = await testSubjects.findAll('lns-dimensionTrigger');
|
||||
|
@ -54,8 +50,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
it('navigates back to TSVB when the Back button is clicked', async () => {
|
||||
const button = await testSubjects.find('visualizeEditInLensButton');
|
||||
await button.click();
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
await lens.waitForVisualization('xyVisChart');
|
||||
|
||||
const goBackBtn = await testSubjects.find('lnsApp_goBackToAppButton');
|
||||
|
@ -70,8 +65,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
it('should preserve app filters in lens', async () => {
|
||||
await filterBar.addFilter('extension', 'is', 'css');
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
const button = await testSubjects.find('visualizeEditInLensButton');
|
||||
await button.click();
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
await lens.waitForVisualization('xyVisChart');
|
||||
|
||||
expect(await filterBar.hasFilter('extension', 'css')).to.be(true);
|
||||
|
@ -81,8 +75,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
await queryBar.setQuery('machine.os : ios');
|
||||
await queryBar.submitQuery();
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
const button = await testSubjects.find('visualizeEditInLensButton');
|
||||
await button.click();
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
await lens.waitForVisualization('xyVisChart');
|
||||
|
||||
expect(await queryBar.getQueryString()).to.equal('machine.os : ios');
|
||||
|
@ -95,8 +88,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
|
||||
const button = await testSubjects.find('visualizeEditInLensButton');
|
||||
await button.click();
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
await lens.waitForVisualization('xyVisChart');
|
||||
await retry.try(async () => {
|
||||
const layers = await find.allByCssSelector(`[data-test-subj^="lns-layerPanel-"]`);
|
||||
|
@ -121,8 +113,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
|
||||
const button = await testSubjects.find('visualizeEditInLensButton');
|
||||
await button.click();
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
await lens.waitForVisualization('xyVisChart');
|
||||
await retry.try(async () => {
|
||||
expect(await lens.getLayerCount()).to.be(1);
|
||||
|
@ -139,8 +130,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
it('should not allow converting of not valid panel', async () => {
|
||||
await visualBuilder.selectAggType('Counter Rate');
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
const canEdit = await testSubjects.exists('visualizeEditInLensButton');
|
||||
expect(canEdit).to.be(false);
|
||||
expect(await visualize.hasNavigateToLensButton()).to.be(false);
|
||||
});
|
||||
|
||||
it('should not allow converting of unsupported aggregations', async () => {
|
||||
|
@ -148,8 +138,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
await visualBuilder.setFieldForAggregation('machine.ram');
|
||||
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
const canEdit = await testSubjects.exists('visualizeEditInLensButton');
|
||||
expect(canEdit).to.be(false);
|
||||
expect(await visualize.hasNavigateToLensButton()).to.be(false);
|
||||
});
|
||||
|
||||
it('should convert parent pipeline aggregation with terms', async () => {
|
||||
|
@ -161,8 +150,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
await visualBuilder.setMetricsGroupByTerms('extension.raw');
|
||||
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
const button = await testSubjects.find('visualizeEditInLensButton');
|
||||
await button.click();
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
|
||||
await lens.waitForVisualization('xyVisChart');
|
||||
await retry.try(async () => {
|
||||
|
@ -185,8 +173,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
await visualBuilder.setMetricsGroupByTerms('extension.raw');
|
||||
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
const button = await testSubjects.find('visualizeEditInLensButton');
|
||||
await button.click();
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
|
||||
await lens.waitForVisualization('xyVisChart');
|
||||
await retry.try(async () => {
|
||||
|
|
|
@ -0,0 +1,186 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import expect from '@kbn/expect';
|
||||
import { FtrProviderContext } from '../../../../../ftr_provider_context';
|
||||
|
||||
export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const { visualize, visualBuilder, lens, header } = getPageObjects([
|
||||
'visualBuilder',
|
||||
'visualize',
|
||||
'header',
|
||||
'lens',
|
||||
]);
|
||||
|
||||
const testSubjects = getService('testSubjects');
|
||||
const retry = getService('retry');
|
||||
const filterBar = getService('filterBar');
|
||||
const queryBar = getService('queryBar');
|
||||
|
||||
describe('Top N', function describeIndexTests() {
|
||||
before(async () => {
|
||||
await visualize.initTests();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await visualize.navigateToNewVisualization();
|
||||
await visualize.clickVisualBuilder();
|
||||
await visualBuilder.checkVisualBuilderIsPresent();
|
||||
await visualBuilder.resetPage();
|
||||
await visualBuilder.clickTopN();
|
||||
await visualBuilder.checkTopNTabIsPresent();
|
||||
});
|
||||
|
||||
it('should not allow converting of not valid panel', async () => {
|
||||
await visualBuilder.selectAggType('Max');
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
expect(await visualize.hasNavigateToLensButton()).to.be(false);
|
||||
});
|
||||
|
||||
it('should not allow converting of unsupported aggregations', async () => {
|
||||
await visualBuilder.selectAggType('Sum of Squares');
|
||||
await visualBuilder.setFieldForAggregation('machine.ram');
|
||||
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
expect(await visualize.hasNavigateToLensButton()).to.be(false);
|
||||
});
|
||||
|
||||
it('should hide the "Edit Visualization in Lens" menu item for a sibling pipeline aggregations', async () => {
|
||||
await visualBuilder.createNewAgg();
|
||||
|
||||
await visualBuilder.selectAggType('Overall Average', 1);
|
||||
await visualBuilder.setFieldForAggregation('Count', 1);
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
expect(await visualize.hasNavigateToLensButton()).to.be(false);
|
||||
});
|
||||
|
||||
it('should hide the "Edit Visualization in Lens" menu item for a parent pipeline aggregations', async () => {
|
||||
await visualBuilder.clickPanelOptions('topN');
|
||||
await visualBuilder.setMetricsDataTimerangeMode('Last value');
|
||||
await visualBuilder.clickDataTab('topN');
|
||||
await visualBuilder.createNewAgg();
|
||||
|
||||
await visualBuilder.selectAggType('Cumulative Sum', 1);
|
||||
await visualBuilder.setFieldForAggregation('Count', 1);
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
expect(await visualize.hasNavigateToLensButton()).to.be(false);
|
||||
});
|
||||
|
||||
it('should show the "Edit Visualization in Lens" menu item for a count aggregation', async () => {
|
||||
expect(await visualize.hasNavigateToLensButton()).to.be(true);
|
||||
});
|
||||
|
||||
it('should convert to horizontal bar', async () => {
|
||||
await visualBuilder.selectAggType('Max');
|
||||
await visualBuilder.setFieldForAggregation('memory', 0);
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
await lens.waitForVisualization('xyVisChart');
|
||||
const chartSwitcher = await testSubjects.find('lnsChartSwitchPopover');
|
||||
const type = await chartSwitcher.getVisibleText();
|
||||
expect(type).to.be('Bar horizontal');
|
||||
await retry.try(async () => {
|
||||
const layerCount = await lens.getLayerCount();
|
||||
expect(layerCount).to.be(1);
|
||||
|
||||
const yDimensionText = await lens.getDimensionTriggerText('lnsXY_yDimensionPanel', 0);
|
||||
expect(yDimensionText).to.be('Maximum of memory');
|
||||
});
|
||||
});
|
||||
|
||||
it('should convert group by to vertical axis', async () => {
|
||||
await visualBuilder.setMetricsGroupByTerms('extension.raw');
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
await lens.waitForVisualization('xyVisChart');
|
||||
await retry.try(async () => {
|
||||
const layerCount = await lens.getLayerCount();
|
||||
expect(layerCount).to.be(1);
|
||||
|
||||
const xDimensionText = await lens.getDimensionTriggerText('lnsXY_xDimensionPanel', 0);
|
||||
const yDimensionText = await lens.getDimensionTriggerText('lnsXY_yDimensionPanel', 0);
|
||||
expect(xDimensionText).to.be('Top 10 values of extension.raw');
|
||||
expect(yDimensionText).to.be('Count of records');
|
||||
});
|
||||
});
|
||||
|
||||
it('should convert last value mode to reduced time range', async () => {
|
||||
await visualBuilder.clickPanelOptions('topN');
|
||||
await visualBuilder.setMetricsDataTimerangeMode('Last value');
|
||||
await visualBuilder.setIntervalValue('1m');
|
||||
await visualBuilder.clickDataTab('topN');
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
await lens.waitForVisualization('xyVisChart');
|
||||
await lens.openDimensionEditor('lnsXY_yDimensionPanel > lns-dimensionTrigger');
|
||||
await testSubjects.click('indexPattern-advanced-accordion');
|
||||
const reducedTimeRange = await testSubjects.find('indexPattern-dimension-reducedTimeRange');
|
||||
expect(await reducedTimeRange.getVisibleText()).to.be('1 minute (1m)');
|
||||
await retry.try(async () => {
|
||||
const layerCount = await lens.getLayerCount();
|
||||
expect(layerCount).to.be(1);
|
||||
const yDimensionText = await lens.getDimensionTriggerText('lnsXY_yDimensionPanel', 0);
|
||||
expect(yDimensionText).to.be('Count of records last 1m');
|
||||
});
|
||||
});
|
||||
|
||||
it('should convert static value to the separate layer with y dimension', async () => {
|
||||
await visualBuilder.createNewAggSeries();
|
||||
await visualBuilder.selectAggType('Static Value', 1);
|
||||
await visualBuilder.setStaticValue(10);
|
||||
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
await lens.waitForVisualization('xyVisChart');
|
||||
await retry.try(async () => {
|
||||
const layerCount = await lens.getLayerCount();
|
||||
expect(layerCount).to.be(2);
|
||||
const yDimensionText1 = await lens.getDimensionTriggerText('lnsXY_yDimensionPanel', 0);
|
||||
const yDimensionText2 = await lens.getDimensionTriggerText('lnsXY_yDimensionPanel', 1);
|
||||
expect(yDimensionText1).to.be('Count of records');
|
||||
expect(yDimensionText2).to.be('10');
|
||||
});
|
||||
});
|
||||
|
||||
it('visualizes field to Lens and loads fields to the dimesion editor', async () => {
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
await lens.waitForVisualization('xyVisChart');
|
||||
await retry.try(async () => {
|
||||
const yDimensionText = await lens.getDimensionTriggerText('lnsXY_yDimensionPanel', 0);
|
||||
expect(yDimensionText).to.be('Count of records');
|
||||
});
|
||||
});
|
||||
|
||||
it('navigates back to TSVB when the Back button is clicked', async () => {
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
await lens.waitForVisualization('xyVisChart');
|
||||
const goBackBtn = await testSubjects.find('lnsApp_goBackToAppButton');
|
||||
goBackBtn.click();
|
||||
await visualBuilder.checkTopNTabIsPresent();
|
||||
});
|
||||
|
||||
it('should preserve app filters in lens', async () => {
|
||||
await filterBar.addFilter('extension', 'is', 'css');
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
await lens.waitForVisualization('xyVisChart');
|
||||
|
||||
expect(await filterBar.hasFilter('extension', 'css')).to.be(true);
|
||||
});
|
||||
|
||||
it('should preserve query in lens', async () => {
|
||||
await queryBar.setQuery('machine.os : ios');
|
||||
await queryBar.submitQuery();
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
await lens.waitForVisualization('xyVisChart');
|
||||
|
||||
expect(await queryBar.getQueryString()).to.equal('machine.os : ios');
|
||||
});
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue