mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
parent
f85af486ee
commit
941533eb25
2 changed files with 57 additions and 0 deletions
|
@ -50,6 +50,7 @@
|
|||
aria-label="Enable aggregation"
|
||||
tooltip="Enable aggregation"
|
||||
tooltip-append-to-body="true"
|
||||
data-test-subj="disableAggregationBtn"
|
||||
type="button"
|
||||
class="kuiButton kuiButton--basic kuiButton--small">
|
||||
<i aria-hidden="true" class="fa fa-toggle-off"></i>
|
||||
|
|
|
@ -113,5 +113,61 @@ export default function ({ getService, getPageObjects }) {
|
|||
log.debug('pieData.length = ' + pieData.length);
|
||||
expect(pieData).to.eql(expectedTableData);
|
||||
});
|
||||
|
||||
describe('disabled aggs', () => {
|
||||
before(async () => {
|
||||
await PageObjects.visualize.loadSavedVisualization(vizName1);
|
||||
await PageObjects.visualize.waitForVisualization();
|
||||
// sleep a bit before trying to get the pie chart data below
|
||||
await PageObjects.common.sleep(2000);
|
||||
});
|
||||
|
||||
it('should show correct result with one agg disabled', async () => {
|
||||
const expectedTableData = [ 'win 8', 'win xp', 'win 7', 'ios', 'osx' ];
|
||||
|
||||
await PageObjects.visualize.clickAddBucket();
|
||||
await PageObjects.visualize.clickBucket('Split Slices');
|
||||
await PageObjects.visualize.selectAggregation('Terms');
|
||||
await PageObjects.visualize.selectField('machine.os.raw');
|
||||
await PageObjects.visualize.toggleDisabledAgg(2);
|
||||
await PageObjects.visualize.clickGo();
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
|
||||
const pieData = await PageObjects.visualize.getPieChartLabels();
|
||||
log.debug('pieData.length = ' + pieData.length);
|
||||
expect(pieData).to.eql(expectedTableData);
|
||||
});
|
||||
|
||||
it('should correctly save disabled agg', async () => {
|
||||
await PageObjects.visualize.saveVisualization(vizName1);
|
||||
const pageTitle = await PageObjects.common.getBreadcrumbPageTitle();
|
||||
log.debug(`Save viz page title is ${pageTitle}`);
|
||||
expect(pageTitle).to.contain(vizName1);
|
||||
await PageObjects.header.waitForToastMessageGone();
|
||||
await PageObjects.visualize.loadSavedVisualization(vizName1);
|
||||
await PageObjects.visualize.waitForVisualization();
|
||||
|
||||
const expectedTableData = [ 'win 8', 'win xp', 'win 7', 'ios', 'osx' ];
|
||||
const pieData = await PageObjects.visualize.getPieChartLabels();
|
||||
log.debug('pieData.length = ' + pieData.length);
|
||||
expect(pieData).to.eql(expectedTableData);
|
||||
});
|
||||
|
||||
it('should show correct result when agg is re-enabled', async () => {
|
||||
await PageObjects.visualize.toggleDisabledAgg(2);
|
||||
await PageObjects.visualize.clickGo();
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
|
||||
const expectedTableData = [
|
||||
'0', 'win 7', 'win xp', 'win 8', 'ios', 'osx', '40,000', 'win 8', 'ios', 'win 7', 'win xp', 'osx', '80,000',
|
||||
'win 7', 'win 8', 'osx', 'win xp', 'ios', '120,000', 'ios', 'win xp', 'win 7', 'win 8', 'osx', '160,000',
|
||||
'win 8', 'ios', 'win 7', 'win xp', 'osx', '200,000', 'win 8', 'ios', 'win xp', 'win 7', 'osx', '240,000',
|
||||
'ios', 'win 7', 'win xp', 'win 8', 'osx', '280,000', 'win xp', 'win 8', 'win 7', 'ios', 'osx', '320,000',
|
||||
'win xp', 'win 7', 'ios', 'win 8', 'osx', '360,000', 'win 7', 'win xp', 'ios', 'win 8', 'osx' ];
|
||||
const pieData = await PageObjects.visualize.getPieChartLabels();
|
||||
log.debug('pieData.length = ' + pieData.length);
|
||||
expect(pieData).to.eql(expectedTableData);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue