add raw data to split column (#26321)

This commit is contained in:
Peter Pisljar 2018-11-28 14:56:05 +01:00 committed by GitHub
parent 80ff16ecba
commit 22ae565e2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 81 additions and 1 deletions

View file

@ -9,7 +9,7 @@
<li ng-if="changeTimeFilter" class="changeTimeFilter filter" ng-click="changeTimeFilter.meta.apply = !changeTimeFilter.meta.apply"><input type="checkbox" ng-checked="changeTimeFilter.meta.apply"/> <strong>Change time to:</strong> {{changeTimeFilter.meta.value}} </li>
<li>
<div class="kuiButtonGroup">
<button class="kuiButton kuiButton--primary kuiButton--small">
<button class="kuiButton kuiButton--primary kuiButton--small" data-test-subj="filterBarApplyFilters">
Apply Now
</button>

View file

@ -70,6 +70,11 @@ const LegacyResponseHandlerProvider = function () {
}
let previousSplitAgg = new AggConfigResult(splitAgg, null, splitValue, splitValue);
previousSplitAgg.rawData = {
table: table,
column: splitColumnIndex,
row: rowIndex,
};
const tableIndex = splitMap[splitValue];
const newRow = _.map(converted.tables[tableIndex].tables[0].columns, column => {
const value = row[column.id];

View file

@ -274,5 +274,77 @@ export default function ({ getService, getPageObjects }) {
expect(legends).to.eql(expectedLegends);
});
});
describe('split chart', () => {
before(async () => {
await PageObjects.visualize.navigateToNewVisualization();
await PageObjects.visualize.clickPieChart();
await PageObjects.visualize.clickNewSearch();
log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
await PageObjects.header.setAbsoluteRange(fromTime, toTime);
log.debug('select bucket Split Slices');
await PageObjects.visualize.clickBucket('Split Chart');
await PageObjects.visualize.selectAggregation('Terms');
await PageObjects.visualize.selectField('machine.os.raw');
await PageObjects.visualize.toggleAggregationEditor(2);
log.debug('Add a new series');
await PageObjects.visualize.clickAddBucket();
log.debug('select bucket Split Slices');
await PageObjects.visualize.clickBucket('Split Slices');
await PageObjects.visualize.selectAggregation('Terms');
await PageObjects.visualize.selectField('geo.src');
await PageObjects.visualize.clickGo();
await PageObjects.visualize.waitForVisualization();
});
it ('shows correct split chart', async () => {
const expectedTableData = [
[ 'win 8', '2,904', 'CN', '560' ],
[ 'win 8', '2,904', 'IN', '489' ],
[ 'win 8', '2,904', 'US', '223' ],
[ 'win 8', '2,904', 'ID', '100' ],
[ 'win 8', '2,904', 'BR', '89' ],
[ 'win xp', '2,858', 'CN', '526' ],
[ 'win xp', '2,858', 'IN', '467' ],
[ 'win xp', '2,858', 'US', '250' ],
[ 'win xp', '2,858', 'ID', '98' ],
[ 'win xp', '2,858', 'BR', '84' ],
[ 'win 7', '2,814', 'CN', '537' ],
[ 'win 7', '2,814', 'IN', '460' ],
[ 'win 7', '2,814', 'US', '260' ],
[ 'win 7', '2,814', 'ID', '102' ],
[ 'win 7', '2,814', 'BR', '74' ],
[ 'ios', '2,784', 'IN', '494' ],
[ 'ios', '2,784', 'CN', '478' ],
[ 'ios', '2,784', 'US', '222' ],
[ 'ios', '2,784', 'ID', '96' ],
[ 'ios', '2,784', 'BR', '84' ],
[ 'osx', '1,322', 'IN', '242' ],
[ 'osx', '1,322', 'CN', '228' ],
[ 'osx', '1,322', 'US', '130' ],
[ 'osx', '1,322', 'ID', '56' ],
[ 'osx', '1,322', 'BR', '30' ]
];
await PageObjects.visualize.openInspector();
await PageObjects.visualize.setInspectorTablePageSize(50);
const data = await PageObjects.visualize.getInspectorTableData();
await PageObjects.visualize.closeInspector();
log.debug(data);
expect(data).to.eql(expectedTableData);
});
it ('correctly applies filter', async () => {
const expectedTableData = [[ 'win 8', '560', 'CN', '560' ]];
await PageObjects.visualize.filterLegend('CN');
await PageObjects.visualize.applyFilters();
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.visualize.openInspector();
await PageObjects.visualize.setInspectorTablePageSize(50);
const data = await PageObjects.visualize.getInspectorTableData();
await PageObjects.visualize.closeInspector();
log.debug(data);
expect(data).to.eql(expectedTableData);
});
});
});
}

View file

@ -420,6 +420,9 @@ export function VisualizePageProvider({ getService, getPageObjects }) {
await PageObjects.common.sleep(500);
}
async applyFilters() {
return await testSubjects.click('filterBarApplyFilters');
}
/**
* Set the test for a filter aggregation.
* @param {*} filterValue the string value of the filter