ES 6 visualize tests (#20178)
* ES 6 visualize tests * metric_chart es6 * correct test names, no screenshots * switch spy panel to inspector * ES 6 visualize tests * metric_chart es6 * correct test names, no screenshots * switch spy panel to inspector * es6 some more tests * un-skip tag_cloud tests * fix data table indentation
This commit is contained in:
parent
49c175afe0
commit
aa6c06e1f3
16 changed files with 1168 additions and 1692 deletions
|
@ -25,198 +25,133 @@ export default function ({ getService, getPageObjects }) {
|
|||
const retry = getService('retry');
|
||||
const PageObjects = getPageObjects(['common', 'visualize', 'header', 'settings']);
|
||||
|
||||
describe('visualize app', function describeIndexTests() {
|
||||
before(function () {
|
||||
describe('area charts', function indexPatternCreation() {
|
||||
const vizName1 = 'Visualization AreaChart Name Test';
|
||||
|
||||
before(async function () {
|
||||
const fromTime = '2015-09-19 06:31:44.000';
|
||||
const toTime = '2015-09-23 18:31:44.000';
|
||||
|
||||
log.debug('navigateToApp visualize');
|
||||
return PageObjects.common.navigateToUrl('visualize', 'new')
|
||||
.then(function () {
|
||||
log.debug('clickAreaChart');
|
||||
return PageObjects.visualize.clickAreaChart();
|
||||
})
|
||||
.then(function clickNewSearch() {
|
||||
log.debug('clickNewSearch');
|
||||
return PageObjects.visualize.clickNewSearch();
|
||||
})
|
||||
.then(function setAbsoluteRange() {
|
||||
log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
})
|
||||
.then(function clickBucket() {
|
||||
log.debug('Click X-Axis');
|
||||
return PageObjects.visualize.clickBucket('X-Axis');
|
||||
})
|
||||
.then(function selectAggregation() {
|
||||
log.debug('Click Date Histogram');
|
||||
return PageObjects.visualize.selectAggregation('Date Histogram');
|
||||
})
|
||||
.then(function getField() {
|
||||
log.debug('Check field value');
|
||||
return PageObjects.visualize.getField();
|
||||
})
|
||||
.then(function (fieldValue) {
|
||||
log.debug('fieldValue = ' + fieldValue);
|
||||
expect(fieldValue).to.be('@timestamp');
|
||||
})
|
||||
.then(function getInterval() {
|
||||
return PageObjects.visualize.getInterval();
|
||||
})
|
||||
.then(function (intervalValue) {
|
||||
log.debug('intervalValue = ' + intervalValue);
|
||||
expect(intervalValue).to.be('Auto');
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function waitUntilLoadingHasFinished() {
|
||||
log.debug('Waiting...');
|
||||
return PageObjects.header.waitUntilLoadingHasFinished();
|
||||
});
|
||||
await PageObjects.common.navigateToUrl('visualize', 'new');
|
||||
log.debug('clickAreaChart');
|
||||
await PageObjects.visualize.clickAreaChart();
|
||||
log.debug('clickNewSearch');
|
||||
await PageObjects.visualize.clickNewSearch();
|
||||
log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
await PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
log.debug('Click X-Axis');
|
||||
await PageObjects.visualize.clickBucket('X-Axis');
|
||||
log.debug('Click Date Histogram');
|
||||
await PageObjects.visualize.selectAggregation('Date Histogram');
|
||||
log.debug('Check field value');
|
||||
const fieldValue = await PageObjects.visualize.getField();
|
||||
log.debug('fieldValue = ' + fieldValue);
|
||||
expect(fieldValue).to.be('@timestamp');
|
||||
const intervalValue = await PageObjects.visualize.getInterval();
|
||||
log.debug('intervalValue = ' + intervalValue);
|
||||
expect(intervalValue).to.be('Auto');
|
||||
return PageObjects.visualize.clickGo();
|
||||
});
|
||||
|
||||
describe('area charts', function indexPatternCreation() {
|
||||
const vizName1 = 'Visualization AreaChart Name Test';
|
||||
it('should save and load with special characters', async function () {
|
||||
const vizNamewithSpecialChars = vizName1 + '/?&=%';
|
||||
await PageObjects.visualize.saveVisualization(vizNamewithSpecialChars);
|
||||
const pageTitle = await PageObjects.common.getBreadcrumbPageTitle();
|
||||
log.debug(`Save viz page title is ${pageTitle}`);
|
||||
expect(pageTitle).to.contain(vizNamewithSpecialChars);
|
||||
await PageObjects.header.waitForToastMessageGone();
|
||||
});
|
||||
|
||||
it('should save and load with special characters', function () {
|
||||
const vizNamewithSpecialChars = vizName1 + '/?&=%';
|
||||
return PageObjects.visualize.saveVisualization(vizNamewithSpecialChars)
|
||||
.then(() => {
|
||||
return PageObjects.common.getBreadcrumbPageTitle();
|
||||
})
|
||||
.then(pageTitle => {
|
||||
log.debug(`Save viz page title is ${pageTitle}`);
|
||||
expect(pageTitle).to.contain(vizNamewithSpecialChars);
|
||||
})
|
||||
.then(function testVisualizeWaitForToastMessageGone() {
|
||||
return PageObjects.header.waitForToastMessageGone();
|
||||
});
|
||||
it('should save and load with non-ascii characters', async function () {
|
||||
const vizNamewithSpecialChars = `${vizName1} with Umlaut ä`;
|
||||
await PageObjects.visualize.saveVisualization(vizNamewithSpecialChars);
|
||||
const pageTitle = await PageObjects.common.getBreadcrumbPageTitle();
|
||||
log.debug(`Saved viz page title with umlaut is ${pageTitle}`);
|
||||
expect(pageTitle).to.contain(vizNamewithSpecialChars);
|
||||
});
|
||||
|
||||
it('should save and load', async function () {
|
||||
await PageObjects.visualize.saveVisualization(vizName1);
|
||||
const pageTitle = await PageObjects.common.getBreadcrumbPageTitle();
|
||||
log.debug(`Saved viz page title is ${pageTitle}`);
|
||||
expect(pageTitle).to.contain(vizName1);
|
||||
await PageObjects.header.waitForToastMessageGone();
|
||||
await PageObjects.visualize.loadSavedVisualization(vizName1);
|
||||
await PageObjects.visualize.waitForVisualization();
|
||||
return PageObjects.common.sleep(2000);
|
||||
});
|
||||
|
||||
it('should have inspector enabled', async function () {
|
||||
const spyToggleExists = await PageObjects.visualize.isInspectorButtonEnabled();
|
||||
expect(spyToggleExists).to.be(true);
|
||||
});
|
||||
|
||||
it('should show correct chart', async function () {
|
||||
const xAxisLabels = [ '2015-09-20 00:00', '2015-09-21 00:00',
|
||||
'2015-09-22 00:00', '2015-09-23 00:00'
|
||||
];
|
||||
const yAxisLabels = ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400', '1,600'];
|
||||
const expectedAreaChartData = [37, 202, 740, 1437, 1371, 751, 188, 31, 42, 202,
|
||||
683, 1361, 1415, 707, 177, 27, 32, 175, 707, 1408, 1355, 726, 201, 29
|
||||
];
|
||||
|
||||
await retry.try(async function tryingForTime() {
|
||||
const labels = await PageObjects.visualize.getXAxisLabels();
|
||||
log.debug('X-Axis labels = ' + labels);
|
||||
expect(labels).to.eql(xAxisLabels);
|
||||
});
|
||||
const labels = await PageObjects.visualize.getYAxisLabels();
|
||||
log.debug('Y-Axis labels = ' + labels);
|
||||
expect(labels).to.eql(yAxisLabels);
|
||||
const paths = await PageObjects.visualize.getAreaChartData('Count');
|
||||
log.debug('expectedAreaChartData = ' + expectedAreaChartData);
|
||||
log.debug('actual chart data = ' + paths);
|
||||
expect(paths).to.eql(expectedAreaChartData);
|
||||
});
|
||||
|
||||
it('should save and load with non-ascii characters', async function () {
|
||||
const vizNamewithSpecialChars = `${vizName1} with Umlaut ä`;
|
||||
const pageTitle = await PageObjects.visualize.saveVisualization(vizNamewithSpecialChars).then(() => {
|
||||
return PageObjects.common.getBreadcrumbPageTitle();
|
||||
});
|
||||
it('should show correct data', async function () {
|
||||
const expectedTableData = [
|
||||
['2015-09-20 00:00', '37'],
|
||||
['2015-09-20 03:00', '202'],
|
||||
['2015-09-20 06:00', '740'],
|
||||
['2015-09-20 09:00', '1,437'],
|
||||
['2015-09-20 12:00', '1,371'],
|
||||
['2015-09-20 15:00', '751'],
|
||||
['2015-09-20 18:00', '188'],
|
||||
['2015-09-20 21:00', '31'],
|
||||
['2015-09-21 00:00', '42'],
|
||||
['2015-09-21 03:00', '202'],
|
||||
['2015-09-21 06:00', '683'],
|
||||
['2015-09-21 09:00', '1,361'],
|
||||
['2015-09-21 12:00', '1,415'],
|
||||
['2015-09-21 15:00', '707'],
|
||||
['2015-09-21 18:00', '177'],
|
||||
['2015-09-21 21:00', '27'],
|
||||
['2015-09-22 00:00', '32'],
|
||||
['2015-09-22 03:00', '175'],
|
||||
['2015-09-22 06:00', '707'],
|
||||
['2015-09-22 09:00', '1,408'],
|
||||
['2015-09-22 12:00', '1,355'],
|
||||
['2015-09-22 15:00', '726'],
|
||||
['2015-09-22 18:00', '201'],
|
||||
['2015-09-22 21:00', '29']
|
||||
];
|
||||
|
||||
log.debug(`Saved viz page title with umlaut is ${pageTitle}`);
|
||||
expect(pageTitle).to.contain(vizNamewithSpecialChars);
|
||||
});
|
||||
await PageObjects.visualize.openInspector();
|
||||
await PageObjects.visualize.setInspectorTablePageSize(50);
|
||||
const data = await PageObjects.visualize.getInspectorTableData();
|
||||
log.debug('getDataTableData = ' + data);
|
||||
expect(data).to.eql(expectedTableData);
|
||||
});
|
||||
|
||||
it('should save and load', function () {
|
||||
return PageObjects.visualize.saveVisualization(vizName1)
|
||||
.then(() => {
|
||||
return PageObjects.common.getBreadcrumbPageTitle();
|
||||
})
|
||||
.then(pageTitle => {
|
||||
log.debug(`Saved viz page title is ${pageTitle}`);
|
||||
expect(pageTitle).to.contain(vizName1);
|
||||
})
|
||||
.then(function testVisualizeWaitForToastMessageGone() {
|
||||
return PageObjects.header.waitForToastMessageGone();
|
||||
})
|
||||
.then(function loadSavedVisualization() {
|
||||
return PageObjects.visualize.loadSavedVisualization(vizName1);
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.visualize.waitForVisualization();
|
||||
})
|
||||
// We have to sleep sometime between loading the saved visTitle
|
||||
// and trying to access the chart below with getXAxisLabels
|
||||
// otherwise it hangs.
|
||||
.then(function sleep() {
|
||||
return PageObjects.common.sleep(2000);
|
||||
});
|
||||
});
|
||||
|
||||
it('should have inspector enabled', async function () {
|
||||
const spyToggleExists = await PageObjects.visualize.isInspectorButtonEnabled();
|
||||
expect(spyToggleExists).to.be(true);
|
||||
});
|
||||
|
||||
it('should show correct chart, take screenshot', function () {
|
||||
const xAxisLabels = [ '2015-09-20 00:00', '2015-09-21 00:00',
|
||||
'2015-09-22 00:00', '2015-09-23 00:00'
|
||||
];
|
||||
const yAxisLabels = ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400', '1,600'];
|
||||
const expectedAreaChartData = [37, 202, 740, 1437, 1371, 751, 188, 31, 42, 202,
|
||||
683, 1361, 1415, 707, 177, 27, 32, 175, 707, 1408, 1355, 726, 201, 29
|
||||
];
|
||||
|
||||
return retry.try(function tryingForTime() {
|
||||
return PageObjects.visualize.getXAxisLabels()
|
||||
.then(function compareLabels(labels) {
|
||||
log.debug('X-Axis labels = ' + labels);
|
||||
expect(labels).to.eql(xAxisLabels);
|
||||
});
|
||||
})
|
||||
.then(function getYAxisLabels() {
|
||||
return PageObjects.visualize.getYAxisLabels();
|
||||
})
|
||||
.then(function (labels) {
|
||||
log.debug('Y-Axis labels = ' + labels);
|
||||
expect(labels).to.eql(yAxisLabels);
|
||||
})
|
||||
.then(function getAreaChartData() {
|
||||
return PageObjects.visualize.getAreaChartData('Count');
|
||||
})
|
||||
.then(function (paths) {
|
||||
log.debug('expectedAreaChartData = ' + expectedAreaChartData);
|
||||
log.debug('actual chart data = ' + paths);
|
||||
expect(paths).to.eql(expectedAreaChartData);
|
||||
});
|
||||
});
|
||||
|
||||
it('should show correct data', function () {
|
||||
const expectedTableData = [
|
||||
['2015-09-20 00:00', '37'],
|
||||
['2015-09-20 03:00', '202'],
|
||||
['2015-09-20 06:00', '740'],
|
||||
['2015-09-20 09:00', '1,437'],
|
||||
['2015-09-20 12:00', '1,371'],
|
||||
['2015-09-20 15:00', '751'],
|
||||
['2015-09-20 18:00', '188'],
|
||||
['2015-09-20 21:00', '31'],
|
||||
['2015-09-21 00:00', '42'],
|
||||
['2015-09-21 03:00', '202'],
|
||||
['2015-09-21 06:00', '683'],
|
||||
['2015-09-21 09:00', '1,361'],
|
||||
['2015-09-21 12:00', '1,415'],
|
||||
['2015-09-21 15:00', '707'],
|
||||
['2015-09-21 18:00', '177'],
|
||||
['2015-09-21 21:00', '27'],
|
||||
['2015-09-22 00:00', '32'],
|
||||
['2015-09-22 03:00', '175'],
|
||||
['2015-09-22 06:00', '707'],
|
||||
['2015-09-22 09:00', '1,408'],
|
||||
['2015-09-22 12:00', '1,355'],
|
||||
['2015-09-22 15:00', '726'],
|
||||
['2015-09-22 18:00', '201'],
|
||||
['2015-09-22 21:00', '29']
|
||||
];
|
||||
|
||||
return PageObjects.visualize.openInspector()
|
||||
.then(function setPageSize() {
|
||||
return PageObjects.visualize.setInspectorTablePageSize(50);
|
||||
})
|
||||
.then(function getInspectorTableData() {
|
||||
return PageObjects.visualize.getInspectorTableData();
|
||||
})
|
||||
.then(function showData(data) {
|
||||
log.debug('getDataTableData = ' + data);
|
||||
expect(data).to.eql(expectedTableData);
|
||||
});
|
||||
});
|
||||
|
||||
it('should hide side editor if embed is set to true in url', async () => {
|
||||
const url = await remote.getCurrentUrl();
|
||||
const embedUrl = url.split('/visualize/').pop().replace('?_g=', '?embed=true&_g=');
|
||||
await PageObjects.common.navigateToUrl('visualize', embedUrl);
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
const sideEditorExists = await PageObjects.visualize.getSideEditorExists();
|
||||
expect(sideEditorExists).to.be(false);
|
||||
});
|
||||
it('should hide side editor if embed is set to true in url', async () => {
|
||||
const url = await remote.getCurrentUrl();
|
||||
const embedUrl = url.split('/visualize/').pop().replace('?_g=', '?embed=true&_g=');
|
||||
await PageObjects.common.navigateToUrl('visualize', embedUrl);
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
const sideEditorExists = await PageObjects.visualize.getSideEditorExists();
|
||||
expect(sideEditorExists).to.be(false);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -23,45 +23,39 @@ export default function ({ getService, getPageObjects }) {
|
|||
const log = getService('log');
|
||||
const PageObjects = getPageObjects(['common', 'visualize']);
|
||||
|
||||
describe('visualize app', function describeIndexTests() {
|
||||
|
||||
describe('chart types', function () {
|
||||
before(function () {
|
||||
log.debug('navigateToApp visualize');
|
||||
return PageObjects.common.navigateToUrl('visualize', 'new');
|
||||
});
|
||||
|
||||
it('should show the correct chart types', async function () {
|
||||
const expectedChartTypes = [
|
||||
'Area',
|
||||
'Heat Map',
|
||||
'Horizontal Bar',
|
||||
'Line',
|
||||
'Pie',
|
||||
'Vertical Bar',
|
||||
'Data Table',
|
||||
'Gauge',
|
||||
'Goal',
|
||||
'Metric',
|
||||
'Coordinate Map',
|
||||
'Region Map',
|
||||
'Timelion',
|
||||
'Visual Builder',
|
||||
'Controls',
|
||||
'Markdown',
|
||||
'Tag Cloud',
|
||||
'Vega',
|
||||
];
|
||||
|
||||
describe('chart types', function indexPatternCreation() {
|
||||
it('should show the correct chart types', function () {
|
||||
const expectedChartTypes = [
|
||||
'Area',
|
||||
'Heat Map',
|
||||
'Horizontal Bar',
|
||||
'Line',
|
||||
'Pie',
|
||||
'Vertical Bar',
|
||||
'Data Table',
|
||||
'Gauge',
|
||||
'Goal',
|
||||
'Metric',
|
||||
'Coordinate Map',
|
||||
'Region Map',
|
||||
'Timelion',
|
||||
'Visual Builder',
|
||||
'Controls',
|
||||
'Markdown',
|
||||
'Tag Cloud',
|
||||
'Vega',
|
||||
];
|
||||
|
||||
// find all the chart types and make sure there all there
|
||||
return PageObjects.visualize.getChartTypes()
|
||||
.then(function testChartTypes(chartTypes) {
|
||||
log.debug('returned chart types = ' + chartTypes);
|
||||
log.debug('expected chart types = ' + expectedChartTypes);
|
||||
expect(chartTypes).to.eql(expectedChartTypes);
|
||||
});
|
||||
});
|
||||
// find all the chart types and make sure there all there
|
||||
const chartTypes = await PageObjects.visualize.getChartTypes();
|
||||
log.debug('returned chart types = ' + chartTypes);
|
||||
log.debug('expected chart types = ' + expectedChartTypes);
|
||||
expect(chartTypes).to.eql(expectedChartTypes);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -25,128 +25,116 @@ export default function ({ getService, getPageObjects }) {
|
|||
const filterBar = getService('filterBar');
|
||||
const PageObjects = getPageObjects(['common', 'visualize', 'header']);
|
||||
|
||||
describe('visualize app', function describeIndexTests() {
|
||||
const fromTime = '2015-09-19 06:31:44.000';
|
||||
const toTime = '2015-09-23 18:31:44.000';
|
||||
const fromTime = '2015-09-19 06:31:44.000';
|
||||
const toTime = '2015-09-23 18:31:44.000';
|
||||
|
||||
before(function () {
|
||||
describe('data table', function indexPatternCreation() {
|
||||
const vizName1 = 'Visualization DataTable';
|
||||
|
||||
before(async function () {
|
||||
log.debug('navigateToApp visualize');
|
||||
return PageObjects.common.navigateToUrl('visualize', 'new')
|
||||
.then(function () {
|
||||
log.debug('clickDataTable');
|
||||
return PageObjects.visualize.clickDataTable();
|
||||
})
|
||||
.then(function clickNewSearch() {
|
||||
log.debug('clickNewSearch');
|
||||
return PageObjects.visualize.clickNewSearch();
|
||||
})
|
||||
.then(function setAbsoluteRange() {
|
||||
log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
})
|
||||
.then(function clickBucket() {
|
||||
log.debug('Bucket = Split Rows');
|
||||
return PageObjects.visualize.clickBucket('Split Rows');
|
||||
})
|
||||
.then(function selectAggregation() {
|
||||
log.debug('Aggregation = Histogram');
|
||||
return PageObjects.visualize.selectAggregation('Histogram');
|
||||
})
|
||||
.then(function selectField() {
|
||||
log.debug('Field = bytes');
|
||||
return PageObjects.visualize.selectField('bytes');
|
||||
})
|
||||
.then(function setInterval() {
|
||||
log.debug('Interval = 2000');
|
||||
return PageObjects.visualize.setNumericInterval('2000');
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.header.waitUntilLoadingHasFinished();
|
||||
});
|
||||
await PageObjects.common.navigateToUrl('visualize', 'new');
|
||||
log.debug('clickDataTable');
|
||||
await PageObjects.visualize.clickDataTable();
|
||||
log.debug('clickNewSearch');
|
||||
await PageObjects.visualize.clickNewSearch();
|
||||
log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
await PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
log.debug('Bucket = Split Rows');
|
||||
await PageObjects.visualize.clickBucket('Split Rows');
|
||||
log.debug('Aggregation = Histogram');
|
||||
await PageObjects.visualize.selectAggregation('Histogram');
|
||||
log.debug('Field = bytes');
|
||||
await PageObjects.visualize.selectField('bytes');
|
||||
log.debug('Interval = 2000');
|
||||
await PageObjects.visualize.setNumericInterval('2000');
|
||||
await PageObjects.visualize.clickGo();
|
||||
});
|
||||
|
||||
describe('data table', function indexPatternCreation() {
|
||||
const vizName1 = 'Visualization DataTable';
|
||||
it('should be able to save and load', async function () {
|
||||
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();
|
||||
});
|
||||
|
||||
it('should be able to save and load', function () {
|
||||
return PageObjects.visualize.saveVisualization(vizName1)
|
||||
.then(() => {
|
||||
return PageObjects.common.getBreadcrumbPageTitle();
|
||||
})
|
||||
.then(pageTitle => {
|
||||
log.debug(`Save viz page title is ${pageTitle}`);
|
||||
expect(pageTitle).to.contain(vizName1);
|
||||
})
|
||||
.then(function testVisualizeWaitForToastMessageGone() {
|
||||
return PageObjects.header.waitForToastMessageGone();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.visualize.loadSavedVisualization(vizName1);
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.visualize.waitForVisualization();
|
||||
});
|
||||
it('should have inspector enabled', async function () {
|
||||
const spyToggleExists = await PageObjects.visualize.isInspectorButtonEnabled();
|
||||
expect(spyToggleExists).to.be(true);
|
||||
});
|
||||
|
||||
it('should show correct data', function () {
|
||||
const expectedChartData = [
|
||||
[ '0B', '2,088' ],
|
||||
[ '1.953KB', '2,748' ],
|
||||
[ '3.906KB', '2,707' ],
|
||||
[ '5.859KB', '2,876' ],
|
||||
[ '7.813KB', '2,863' ],
|
||||
[ '9.766KB', '147' ],
|
||||
[ '11.719KB', '148' ],
|
||||
[ '13.672KB', '129' ],
|
||||
[ '15.625KB', '161' ],
|
||||
[ '17.578KB', '137' ]
|
||||
];
|
||||
|
||||
return retry.try(async function () {
|
||||
await PageObjects.visualize.openInspector();
|
||||
const data = await PageObjects.visualize.getInspectorTableData();
|
||||
await PageObjects.visualize.closeInspector();
|
||||
log.debug(data);
|
||||
expect(data).to.eql(expectedChartData);
|
||||
});
|
||||
});
|
||||
|
||||
it('should have inspector enabled', async function () {
|
||||
const spyToggleExists = await PageObjects.visualize.isInspectorButtonEnabled();
|
||||
expect(spyToggleExists).to.be(true);
|
||||
});
|
||||
it('should show correct data for a data table with date histogram', async () => {
|
||||
await PageObjects.common.navigateToUrl('visualize', 'new');
|
||||
await PageObjects.visualize.clickDataTable();
|
||||
await PageObjects.visualize.clickNewSearch();
|
||||
await PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
await PageObjects.visualize.clickBucket('Split Rows');
|
||||
await PageObjects.visualize.selectAggregation('Date Histogram');
|
||||
await PageObjects.visualize.selectField('@timestamp');
|
||||
await PageObjects.visualize.setInterval('Daily');
|
||||
await PageObjects.visualize.clickGo();
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
const data = await PageObjects.visualize.getTableVisData();
|
||||
log.debug(data.split('\n'));
|
||||
expect(data.trim().split('\n')).to.be.eql([
|
||||
'2015-09-20', '4,757',
|
||||
'2015-09-21', '4,614',
|
||||
'2015-09-22', '4,633',
|
||||
]);
|
||||
});
|
||||
|
||||
it('should show correct data, take screenshot', function () {
|
||||
const expectedChartData = [
|
||||
[ '0B', '2,088' ],
|
||||
[ '1.953KB', '2,748' ],
|
||||
[ '3.906KB', '2,707' ],
|
||||
[ '5.859KB', '2,876' ],
|
||||
[ '7.813KB', '2,863' ],
|
||||
[ '9.766KB', '147' ],
|
||||
[ '11.719KB', '148' ],
|
||||
[ '13.672KB', '129' ],
|
||||
[ '15.625KB', '161' ],
|
||||
[ '17.578KB', '137' ]
|
||||
];
|
||||
|
||||
return retry.try(async function () {
|
||||
await PageObjects.visualize.openInspector();
|
||||
const data = await PageObjects.visualize.getInspectorTableData();
|
||||
await PageObjects.visualize.closeInspector();
|
||||
log.debug(data);
|
||||
expect(data).to.eql(expectedChartData);
|
||||
});
|
||||
});
|
||||
|
||||
it('should show correct data for a data table with date histogram', async () => {
|
||||
await PageObjects.common.navigateToUrl('visualize', 'new');
|
||||
await PageObjects.visualize.clickDataTable();
|
||||
await PageObjects.visualize.clickNewSearch();
|
||||
await PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
await PageObjects.visualize.clickBucket('Split Rows');
|
||||
await PageObjects.visualize.selectAggregation('Date Histogram');
|
||||
await PageObjects.visualize.selectField('@timestamp');
|
||||
await PageObjects.visualize.setInterval('Daily');
|
||||
await PageObjects.visualize.clickGo();
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
const data = await PageObjects.visualize.getTableVisData();
|
||||
expect(data.trim().split('\n')).to.be.eql([
|
||||
'2015-09-20', '4,757',
|
||||
'2015-09-21', '4,614',
|
||||
'2015-09-22', '4,633',
|
||||
]);
|
||||
});
|
||||
|
||||
it('should correctly filter for applied time filter on the main timefield', async () => {
|
||||
await filterBar.addFilter('@timestamp', 'is between', ['2015-09-19', '2015-09-21']);
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
const data = await PageObjects.visualize.getTableVisData();
|
||||
expect(data.trim().split('\n')).to.be.eql([
|
||||
'2015-09-20', '4,757',
|
||||
]);
|
||||
});
|
||||
it('should show correct data for a data table with date histogram', async () => {
|
||||
await PageObjects.common.navigateToUrl('visualize', 'new');
|
||||
await PageObjects.visualize.clickDataTable();
|
||||
await PageObjects.visualize.clickNewSearch();
|
||||
await PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
await PageObjects.visualize.clickBucket('Split Rows');
|
||||
await PageObjects.visualize.selectAggregation('Date Histogram');
|
||||
await PageObjects.visualize.selectField('@timestamp');
|
||||
await PageObjects.visualize.setInterval('Daily');
|
||||
await PageObjects.visualize.clickGo();
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
const data = await PageObjects.visualize.getTableVisData();
|
||||
expect(data.trim().split('\n')).to.be.eql([
|
||||
'2015-09-20', '4,757',
|
||||
'2015-09-21', '4,614',
|
||||
'2015-09-22', '4,633',
|
||||
]);
|
||||
});
|
||||
|
||||
it('should correctly filter for applied time filter on the main timefield', async () => {
|
||||
await filterBar.addFilter('@timestamp', 'is between', ['2015-09-19', '2015-09-21']);
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
const data = await PageObjects.visualize.getTableVisData();
|
||||
expect(data.trim().split('\n')).to.be.eql([
|
||||
'2015-09-20', '4,757',
|
||||
]);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -24,100 +24,73 @@ export default function ({ getService, getPageObjects }) {
|
|||
const retry = getService('retry');
|
||||
const PageObjects = getPageObjects(['common', 'visualize', 'header']);
|
||||
|
||||
describe('visualize app', function describeIndexTests() {
|
||||
describe('gauge chart', function indexPatternCreation() {
|
||||
const fromTime = '2015-09-19 06:31:44.000';
|
||||
const toTime = '2015-09-23 18:31:44.000';
|
||||
|
||||
before(function () {
|
||||
before(async function () {
|
||||
log.debug('navigateToApp visualize');
|
||||
return PageObjects.common.navigateToUrl('visualize', 'new')
|
||||
.then(function () {
|
||||
log.debug('clickGauge');
|
||||
return PageObjects.visualize.clickGauge();
|
||||
})
|
||||
.then(function clickNewSearch() {
|
||||
return PageObjects.visualize.clickNewSearch();
|
||||
})
|
||||
.then(function setAbsoluteRange() {
|
||||
log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
});
|
||||
await PageObjects.common.navigateToUrl('visualize', 'new');
|
||||
log.debug('clickGauge');
|
||||
await PageObjects.visualize.clickGauge();
|
||||
await PageObjects.visualize.clickNewSearch();
|
||||
log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
await PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
});
|
||||
|
||||
describe('gauge chart', function indexPatternCreation() {
|
||||
|
||||
it('should have inspector enabled', async function () {
|
||||
const spyToggleExists = await PageObjects.visualize.isInspectorButtonEnabled();
|
||||
expect(spyToggleExists).to.be(true);
|
||||
});
|
||||
|
||||
it('should show Count', function () {
|
||||
const expectedCount = ['14,004', 'Count'];
|
||||
|
||||
// initial metric of "Count" is selected by default
|
||||
return retry.try(function tryingForTime() {
|
||||
return PageObjects.visualize.getGaugeValue()
|
||||
.then(function (metricValue) {
|
||||
expect(expectedCount).to.eql(metricValue[0].split('\n'));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should show Split Gauges', function () {
|
||||
const expectedTexts = [ 'win 8', 'win xp', 'win 7', 'ios' ];
|
||||
return PageObjects.visualize.clickMetricEditor()
|
||||
.then(function clickBucket() {
|
||||
log.debug('Bucket = Split Group');
|
||||
return PageObjects.visualize.clickBucket('Split Group');
|
||||
})
|
||||
.then(function selectAggregation() {
|
||||
log.debug('Aggregation = Terms');
|
||||
return PageObjects.visualize.selectAggregation('Terms');
|
||||
})
|
||||
.then(function selectField() {
|
||||
log.debug('Field = machine.os.raw');
|
||||
return PageObjects.visualize.selectField('machine.os.raw');
|
||||
})
|
||||
.then(function setSize() {
|
||||
log.debug('Size = 4');
|
||||
return PageObjects.visualize.setSize('4');
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return retry.try(function tryingForTime() {
|
||||
return PageObjects.visualize.getGaugeValue()
|
||||
.then(function (metricValue) {
|
||||
expect(expectedTexts).to.eql(metricValue);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should show correct values for fields with fieldFormatters', async function () {
|
||||
const expectedTexts = [ '2,904\nwin 8: Count', '0B\nwin 8: Min bytes' ];
|
||||
|
||||
|
||||
await PageObjects.visualize.clickMetricEditor();
|
||||
await PageObjects.visualize.clickBucket('Split Group');
|
||||
await PageObjects.visualize.selectAggregation('Terms');
|
||||
await PageObjects.visualize.selectField('machine.os.raw');
|
||||
await PageObjects.visualize.setSize('1');
|
||||
await PageObjects.visualize.clickAddMetric();
|
||||
await PageObjects.visualize.clickBucket('Metric');
|
||||
await PageObjects.visualize.selectAggregation('Min', 'metrics');
|
||||
await PageObjects.visualize.selectField('bytes', 'metrics');
|
||||
await PageObjects.visualize.clickGo();
|
||||
|
||||
return retry.try(function tryingForTime() {
|
||||
return PageObjects.visualize.getGaugeValue()
|
||||
.then(async function (metricValue) {
|
||||
expect(expectedTexts).to.eql(metricValue);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should have inspector enabled', async function () {
|
||||
const spyToggleExists = await PageObjects.visualize.isInspectorButtonEnabled();
|
||||
expect(spyToggleExists).to.be(true);
|
||||
});
|
||||
|
||||
it('should show Count', function () {
|
||||
const expectedCount = ['14,004', 'Count'];
|
||||
|
||||
// initial metric of "Count" is selected by default
|
||||
return retry.try(async function tryingForTime() {
|
||||
const metricValue = await PageObjects.visualize.getGaugeValue();
|
||||
expect(expectedCount).to.eql(metricValue[0].split('\n'));
|
||||
});
|
||||
});
|
||||
|
||||
it('should show Split Gauges', async function () {
|
||||
const expectedTexts = [ 'win 8', 'win xp', 'win 7', 'ios' ];
|
||||
await PageObjects.visualize.clickMetricEditor();
|
||||
log.debug('Bucket = Split Group');
|
||||
await PageObjects.visualize.clickBucket('Split Group');
|
||||
log.debug('Aggregation = Terms');
|
||||
await PageObjects.visualize.selectAggregation('Terms');
|
||||
log.debug('Field = machine.os.raw');
|
||||
await PageObjects.visualize.selectField('machine.os.raw');
|
||||
log.debug('Size = 4');
|
||||
await PageObjects.visualize.setSize('4');
|
||||
await PageObjects.visualize.clickGo();
|
||||
await retry.try(async function tryingForTime() {
|
||||
const metricValue = await PageObjects.visualize.getGaugeValue();
|
||||
expect(expectedTexts).to.eql(metricValue);
|
||||
});
|
||||
});
|
||||
|
||||
it('should show correct values for fields with fieldFormatters', async function () {
|
||||
const expectedTexts = [ '2,904\nwin 8: Count', '0B\nwin 8: Min bytes' ];
|
||||
|
||||
await PageObjects.visualize.clickMetricEditor();
|
||||
await PageObjects.visualize.clickBucket('Split Group');
|
||||
await PageObjects.visualize.selectAggregation('Terms');
|
||||
await PageObjects.visualize.selectField('machine.os.raw');
|
||||
await PageObjects.visualize.setSize('1');
|
||||
await PageObjects.visualize.clickAddMetric();
|
||||
await PageObjects.visualize.clickBucket('Metric');
|
||||
await PageObjects.visualize.selectAggregation('Min', 'metrics');
|
||||
await PageObjects.visualize.selectField('bytes', 'metrics');
|
||||
await PageObjects.visualize.clickGo();
|
||||
|
||||
await retry.try(async function tryingForTime() {
|
||||
const metricValue = await PageObjects.visualize.getGaugeValue();
|
||||
expect(expectedTexts).to.eql(metricValue);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
|
|
@ -21,121 +21,78 @@ import expect from 'expect.js';
|
|||
|
||||
export default function ({ getService, getPageObjects }) {
|
||||
const log = getService('log');
|
||||
const retry = getService('retry');
|
||||
const PageObjects = getPageObjects(['common', 'visualize', 'header']);
|
||||
|
||||
describe('visualize app', function describeIndexTests() {
|
||||
describe('heatmap chart', function indexPatternCreation() {
|
||||
const vizName1 = 'Visualization HeatmapChart';
|
||||
const fromTime = '2015-09-19 06:31:44.000';
|
||||
const toTime = '2015-09-23 18:31:44.000';
|
||||
|
||||
before(function () {
|
||||
before(async function () {
|
||||
log.debug('navigateToApp visualize');
|
||||
return PageObjects.common.navigateToUrl('visualize', 'new')
|
||||
.then(function () {
|
||||
log.debug('clickHeatmapChart');
|
||||
return PageObjects.visualize.clickHeatmapChart();
|
||||
})
|
||||
.then(function clickNewSearch() {
|
||||
return PageObjects.visualize.clickNewSearch();
|
||||
})
|
||||
.then(function setAbsoluteRange() {
|
||||
log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
})
|
||||
.then(function clickBucket() {
|
||||
log.debug('Bucket = X-Axis');
|
||||
return PageObjects.visualize.clickBucket('X-Axis');
|
||||
})
|
||||
.then(function selectAggregation() {
|
||||
log.debug('Aggregation = Date Histogram');
|
||||
return PageObjects.visualize.selectAggregation('Date Histogram');
|
||||
})
|
||||
.then(function selectField() {
|
||||
log.debug('Field = @timestamp');
|
||||
return PageObjects.visualize.selectField('@timestamp');
|
||||
})
|
||||
await PageObjects.common.navigateToUrl('visualize', 'new');
|
||||
log.debug('clickHeatmapChart');
|
||||
await PageObjects.visualize.clickHeatmapChart();
|
||||
await PageObjects.visualize.clickNewSearch();
|
||||
log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
await PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
log.debug('Bucket = X-Axis');
|
||||
await PageObjects.visualize.clickBucket('X-Axis');
|
||||
log.debug('Aggregation = Date Histogram');
|
||||
await PageObjects.visualize.selectAggregation('Date Histogram');
|
||||
log.debug('Field = @timestamp');
|
||||
await PageObjects.visualize.selectField('@timestamp');
|
||||
// leaving Interval set to Auto
|
||||
.then(function clickGo() {
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.header.waitUntilLoadingHasFinished();
|
||||
})
|
||||
.then(function waitForVisualization() {
|
||||
return PageObjects.visualize.waitForVisualization();
|
||||
});
|
||||
await PageObjects.visualize.clickGo();
|
||||
await PageObjects.visualize.waitForVisualization();
|
||||
});
|
||||
|
||||
describe('heatmap chart', function indexPatternCreation() {
|
||||
const vizName1 = 'Visualization HeatmapChart';
|
||||
it('should save and load', async function () {
|
||||
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();
|
||||
});
|
||||
|
||||
it('should save and load', function () {
|
||||
return PageObjects.visualize.saveVisualization(vizName1)
|
||||
.then(() => {
|
||||
return PageObjects.common.getBreadcrumbPageTitle();
|
||||
})
|
||||
.then(pageTitle => {
|
||||
log.debug(`Save viz page title is ${pageTitle}`);
|
||||
expect(pageTitle).to.contain(vizName1);
|
||||
})
|
||||
.then(function testVisualizeWaitForToastMessageGone() {
|
||||
return PageObjects.header.waitForToastMessageGone();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.visualize.loadSavedVisualization(vizName1);
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.header.waitUntilLoadingHasFinished();
|
||||
})
|
||||
.then(function waitForVisualization() {
|
||||
return PageObjects.visualize.waitForVisualization();
|
||||
});
|
||||
});
|
||||
it('should save and load', async function () {
|
||||
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.header.waitUntilLoadingHasFinished();
|
||||
await PageObjects.visualize.waitForVisualization();
|
||||
});
|
||||
|
||||
it('should have inspector enabled', async function () {
|
||||
const spyToggleExists = await PageObjects.visualize.isInspectorButtonEnabled();
|
||||
expect(spyToggleExists).to.be(true);
|
||||
});
|
||||
it('should have inspector enabled', async function () {
|
||||
const spyToggleExists = await PageObjects.visualize.isInspectorButtonEnabled();
|
||||
expect(spyToggleExists).to.be(true);
|
||||
});
|
||||
|
||||
it('should show correct chart, take screenshot', async function () {
|
||||
const expectedChartValues = ['0 - 400', '0 - 400', '400 - 800', '1,200 - 1,600',
|
||||
'1,200 - 1,600', '400 - 800', '0 - 400', '0 - 400', '0 - 400', '0 - 400', '400 - 800',
|
||||
'1,200 - 1,600', '1,200 - 1,600', '400 - 800', '0 - 400', '0 - 400', '0 - 400', '0 - 400',
|
||||
'400 - 800', '1,200 - 1,600', '1,200 - 1,600', '400 - 800', '0 - 400', '0 - 400' ];
|
||||
|
||||
await retry.try(async () => {
|
||||
const data = await PageObjects.visualize.getHeatmapData();
|
||||
log.debug('data=' + data);
|
||||
log.debug('data.length=' + data.length);
|
||||
expect(data).to.eql(expectedChartValues);
|
||||
});
|
||||
});
|
||||
it('should show correct data', async function () {
|
||||
// this is only the first page of the tabular data.
|
||||
const expectedChartData = [
|
||||
['2015-09-20 00:00', '37'],
|
||||
['2015-09-20 03:00', '202'],
|
||||
['2015-09-20 06:00', '740'],
|
||||
['2015-09-20 09:00', '1,437'],
|
||||
['2015-09-20 12:00', '1,371'],
|
||||
['2015-09-20 15:00', '751'],
|
||||
['2015-09-20 18:00', '188'],
|
||||
['2015-09-20 21:00', '31'],
|
||||
['2015-09-21 00:00', '42'],
|
||||
['2015-09-21 03:00', '202']
|
||||
];
|
||||
|
||||
|
||||
it('should show correct data', function () {
|
||||
// this is only the first page of the tabular data.
|
||||
const expectedChartData = [
|
||||
['2015-09-20 00:00', '37'],
|
||||
['2015-09-20 03:00', '202'],
|
||||
['2015-09-20 06:00', '740'],
|
||||
['2015-09-20 09:00', '1,437'],
|
||||
['2015-09-20 12:00', '1,371'],
|
||||
['2015-09-20 15:00', '751'],
|
||||
['2015-09-20 18:00', '188'],
|
||||
['2015-09-20 21:00', '31'],
|
||||
['2015-09-21 00:00', '42'],
|
||||
['2015-09-21 03:00', '202']
|
||||
];
|
||||
|
||||
return PageObjects.visualize.openInspector()
|
||||
.then(function showData() {
|
||||
return PageObjects.visualize.getInspectorTableData();
|
||||
})
|
||||
.then(function showData(data) {
|
||||
log.debug(data);
|
||||
expect(data).to.eql(expectedChartData);
|
||||
});
|
||||
});
|
||||
await PageObjects.visualize.openInspector();
|
||||
const data = await PageObjects.visualize.getInspectorTableData();
|
||||
log.debug(data);
|
||||
expect(data).to.eql(expectedChartData);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -21,9 +21,10 @@ import expect from 'expect.js';
|
|||
|
||||
export default function ({ getService, getPageObjects }) {
|
||||
const log = getService('log');
|
||||
const retry = getService('retry');
|
||||
const PageObjects = getPageObjects(['common', 'visualize', 'header']);
|
||||
|
||||
describe('histogram agg onSearchRequestStart', function describeIndexTests() {
|
||||
describe('histogram agg onSearchRequestStart', function () {
|
||||
before(async function () {
|
||||
const fromTime = '2015-09-19 06:31:44.000';
|
||||
const toTime = '2015-09-23 18:31:44.000';
|
||||
|
@ -43,21 +44,21 @@ export default function ({ getService, getPageObjects }) {
|
|||
await PageObjects.visualize.selectField('machine.ram');
|
||||
});
|
||||
|
||||
describe('interval parameter uses autoBounds', function indexPatternCreation() {
|
||||
describe('interval parameter uses autoBounds', function () {
|
||||
it('should use provided value when number of generated buckets is less than histogram:maxBars', async function () {
|
||||
const providedInterval = 2400000000;
|
||||
log.debug(`Interval = ${providedInterval}`);
|
||||
await PageObjects.visualize.setNumericInterval(providedInterval);
|
||||
await PageObjects.visualize.clickGo();
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
|
||||
const data = await PageObjects.visualize.getTableVisData();
|
||||
const dataArray = data.replace(/,/g, '').split('\n');
|
||||
expect(dataArray.length).to.eql(20);
|
||||
const bucketStart = parseInt(dataArray[0], 10);
|
||||
const bucketEnd = parseInt(dataArray[2], 10);
|
||||
const actualInterval = bucketEnd - bucketStart;
|
||||
expect(actualInterval).to.eql(providedInterval);
|
||||
await retry.try(async () => {
|
||||
const data = await PageObjects.visualize.getTableVisData();
|
||||
const dataArray = data.replace(/,/g, '').split('\n');
|
||||
expect(dataArray.length).to.eql(20);
|
||||
const bucketStart = parseInt(dataArray[0], 10);
|
||||
const bucketEnd = parseInt(dataArray[2], 10);
|
||||
const actualInterval = bucketEnd - bucketStart;
|
||||
expect(actualInterval).to.eql(providedInterval);
|
||||
});
|
||||
});
|
||||
|
||||
it('should scale value to round number when number of generated buckets is greater than histogram:maxBars', async function () {
|
||||
|
@ -65,15 +66,16 @@ export default function ({ getService, getPageObjects }) {
|
|||
log.debug(`Interval = ${providedInterval}`);
|
||||
await PageObjects.visualize.setNumericInterval(providedInterval);
|
||||
await PageObjects.visualize.clickGo();
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
|
||||
const data = await PageObjects.visualize.getTableVisData();
|
||||
const dataArray = data.replace(/,/g, '').split('\n');
|
||||
expect(dataArray.length).to.eql(20);
|
||||
const bucketStart = parseInt(dataArray[0], 10);
|
||||
const bucketEnd = parseInt(dataArray[2], 10);
|
||||
const actualInterval = bucketEnd - bucketStart;
|
||||
expect(actualInterval).to.eql(1200000000);
|
||||
await PageObjects.common.sleep(1000); //fix this
|
||||
await retry.try(async () => {
|
||||
const data = await PageObjects.visualize.getTableVisData();
|
||||
const dataArray = data.replace(/,/g, '').split('\n');
|
||||
expect(dataArray.length).to.eql(20);
|
||||
const bucketStart = parseInt(dataArray[0], 10);
|
||||
const bucketEnd = parseInt(dataArray[2], 10);
|
||||
const actualInterval = bucketEnd - bucketStart;
|
||||
expect(actualInterval).to.eql(1200000000);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -27,7 +27,8 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
const FIELD_NAME = 'machine.os.raw';
|
||||
|
||||
describe('visualize app', () => {
|
||||
describe('input control visualization', () => {
|
||||
|
||||
before(async () => {
|
||||
await PageObjects.common.navigateToUrl('visualize', 'new');
|
||||
await PageObjects.visualize.clickInputControlVis();
|
||||
|
@ -39,218 +40,215 @@ export default function ({ getService, getPageObjects }) {
|
|||
await PageObjects.common.sleep(1000); // give time for index-pattern to be fetched
|
||||
await PageObjects.visualize.setComboBox('fieldSelect-0', FIELD_NAME);
|
||||
await PageObjects.visualize.clickGo();
|
||||
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
});
|
||||
|
||||
describe('input control visualization', () => {
|
||||
|
||||
it('should not have inspector enabled', async function () {
|
||||
const spyToggleExists = await PageObjects.visualize.isInspectorButtonEnabled();
|
||||
expect(spyToggleExists).to.be(false);
|
||||
it('should not have inspector enabled', async function () {
|
||||
const spyToggleExists = await PageObjects.visualize.isInspectorButtonEnabled();
|
||||
expect(spyToggleExists).to.be(false);
|
||||
});
|
||||
|
||||
describe('updateFiltersOnChange is false', () => {
|
||||
|
||||
it('should contain dropdown with terms aggregation results as options', async () => {
|
||||
const menu = await PageObjects.visualize.getComboBoxOptions('listControlSelect0');
|
||||
expect(menu.trim().split('\n').join()).to.equal('ios,osx,win 7,win 8,win xp');
|
||||
});
|
||||
|
||||
describe('updateFiltersOnChange is false', () => {
|
||||
|
||||
it('should contain dropdown with terms aggregation results as options', async () => {
|
||||
const menu = await PageObjects.visualize.getComboBoxOptions('listControlSelect0');
|
||||
expect(menu.trim().split('\n').join()).to.equal('ios,osx,win 7,win 8,win xp');
|
||||
});
|
||||
|
||||
it('should display staging control buttons', async () => {
|
||||
const submitButtonExists = await testSubjects.exists('inputControlSubmitBtn');
|
||||
const cancelButtonExists = await testSubjects.exists('inputControlCancelBtn');
|
||||
const clearButtonExists = await testSubjects.exists('inputControlClearBtn');
|
||||
expect(submitButtonExists).to.equal(true);
|
||||
expect(cancelButtonExists).to.equal(true);
|
||||
expect(clearButtonExists).to.equal(true);
|
||||
});
|
||||
|
||||
it('should stage filter when item selected but not create filter pill', async () => {
|
||||
await PageObjects.visualize.setComboBox('listControlSelect0', 'ios');
|
||||
|
||||
const selectedOptions = await PageObjects.visualize.getComboBoxSelectedOptions('listControlSelect0');
|
||||
expect(selectedOptions[0].trim()).to.equal('ios');
|
||||
|
||||
const hasFilter = await filterBar.hasFilter(FIELD_NAME, 'ios');
|
||||
expect(hasFilter).to.equal(false);
|
||||
});
|
||||
|
||||
it('should add filter pill when submit button is clicked', async () => {
|
||||
await testSubjects.click('inputControlSubmitBtn');
|
||||
|
||||
const hasFilter = await filterBar.hasFilter(FIELD_NAME, 'ios');
|
||||
expect(hasFilter).to.equal(true);
|
||||
});
|
||||
|
||||
it('should replace existing filter pill(s) when new item is selected', async () => {
|
||||
await PageObjects.visualize.clearComboBox('listControlSelect0');
|
||||
await PageObjects.visualize.setComboBox('listControlSelect0', 'osx');
|
||||
await testSubjects.click('inputControlSubmitBtn');
|
||||
|
||||
const hasOldFilter = await filterBar.hasFilter(FIELD_NAME, 'ios');
|
||||
const hasNewFilter = await filterBar.hasFilter(FIELD_NAME, 'osx');
|
||||
expect(hasOldFilter).to.equal(false);
|
||||
expect(hasNewFilter).to.equal(true);
|
||||
});
|
||||
|
||||
it('should clear dropdown when filter pill removed', async () => {
|
||||
await filterBar.removeFilter(FIELD_NAME);
|
||||
await PageObjects.common.sleep(500); // give time for filter to be removed and event handlers to fire
|
||||
|
||||
const hasValue = await PageObjects.visualize.doesComboBoxHaveSelectedOptions('listControlSelect0');
|
||||
expect(hasValue).to.equal(false);
|
||||
});
|
||||
|
||||
it('should clear form when Clear button is clicked but not remove filter pill', async () => {
|
||||
await PageObjects.visualize.setComboBox('listControlSelect0', 'ios');
|
||||
await testSubjects.click('inputControlSubmitBtn');
|
||||
const hasFilterBeforeClearBtnClicked = await filterBar.hasFilter(FIELD_NAME, 'ios');
|
||||
expect(hasFilterBeforeClearBtnClicked).to.equal(true);
|
||||
|
||||
await testSubjects.click('inputControlClearBtn');
|
||||
const hasValue = await PageObjects.visualize.doesComboBoxHaveSelectedOptions('listControlSelect0');
|
||||
expect(hasValue).to.equal(false);
|
||||
|
||||
const hasFilterAfterClearBtnClicked = await filterBar.hasFilter(FIELD_NAME, 'ios');
|
||||
expect(hasFilterAfterClearBtnClicked).to.equal(true);
|
||||
});
|
||||
|
||||
it('should remove filter pill when cleared form is submitted', async () => {
|
||||
await testSubjects.click('inputControlSubmitBtn');
|
||||
const hasFilter = await filterBar.hasFilter(FIELD_NAME, 'ios');
|
||||
expect(hasFilter).to.equal(false);
|
||||
});
|
||||
it('should display staging control buttons', async () => {
|
||||
const submitButtonExists = await testSubjects.exists('inputControlSubmitBtn');
|
||||
const cancelButtonExists = await testSubjects.exists('inputControlCancelBtn');
|
||||
const clearButtonExists = await testSubjects.exists('inputControlClearBtn');
|
||||
expect(submitButtonExists).to.equal(true);
|
||||
expect(cancelButtonExists).to.equal(true);
|
||||
expect(clearButtonExists).to.equal(true);
|
||||
});
|
||||
|
||||
describe('updateFiltersOnChange is true', () => {
|
||||
before(async () => {
|
||||
await PageObjects.visualize.clickVisEditorTab('options');
|
||||
await PageObjects.visualize.checkCheckbox('inputControlEditorUpdateFiltersOnChangeCheckbox');
|
||||
await PageObjects.visualize.clickGo();
|
||||
it('should stage filter when item selected but not create filter pill', async () => {
|
||||
await PageObjects.visualize.setComboBox('listControlSelect0', 'ios');
|
||||
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
});
|
||||
const selectedOptions = await PageObjects.visualize.getComboBoxSelectedOptions('listControlSelect0');
|
||||
expect(selectedOptions[0].trim()).to.equal('ios');
|
||||
|
||||
after(async () => {
|
||||
await PageObjects.visualize.clickVisEditorTab('options');
|
||||
await PageObjects.visualize.uncheckCheckbox('inputControlEditorUpdateFiltersOnChangeCheckbox');
|
||||
await PageObjects.visualize.clickGo();
|
||||
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
});
|
||||
|
||||
it('should not display staging control buttons', async () => {
|
||||
const submitButtonExists = await testSubjects.exists('inputControlSubmitBtn');
|
||||
const cancelButtonExists = await testSubjects.exists('inputControlCancelBtn');
|
||||
const clearButtonExists = await testSubjects.exists('inputControlClearBtn');
|
||||
expect(submitButtonExists).to.equal(false);
|
||||
expect(cancelButtonExists).to.equal(false);
|
||||
expect(clearButtonExists).to.equal(false);
|
||||
});
|
||||
|
||||
it('should add filter pill when item selected', async () => {
|
||||
await PageObjects.visualize.setComboBox('listControlSelect0', 'ios');
|
||||
|
||||
const selectedOptions = await PageObjects.visualize.getComboBoxSelectedOptions('listControlSelect0');
|
||||
expect(selectedOptions[0].trim()).to.equal('ios');
|
||||
|
||||
const hasFilter = await filterBar.hasFilter(FIELD_NAME, 'ios');
|
||||
expect(hasFilter).to.equal(true);
|
||||
});
|
||||
const hasFilter = await filterBar.hasFilter(FIELD_NAME, 'ios');
|
||||
expect(hasFilter).to.equal(false);
|
||||
});
|
||||
|
||||
describe('useTimeFilter', () => {
|
||||
it('should use global time filter when getting terms', async () => {
|
||||
await PageObjects.visualize.clickVisEditorTab('options');
|
||||
await PageObjects.visualize.checkCheckbox('inputControlEditorUseTimeFilterCheckbox');
|
||||
await PageObjects.visualize.clickGo();
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
it('should add filter pill when submit button is clicked', async () => {
|
||||
await testSubjects.click('inputControlSubmitBtn');
|
||||
|
||||
// Expect control to be disabled because no terms could be gathered with time filter applied
|
||||
const input = await find.byCssSelector('[data-test-subj="inputControl0"] input');
|
||||
const isDisabled = await input.getProperty('disabled');
|
||||
expect(isDisabled).to.equal(true);
|
||||
});
|
||||
|
||||
it('should re-create control when global time filter is updated', async () => {
|
||||
await PageObjects.header.setAbsoluteRange('2015-01-01', '2016-01-01');
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
|
||||
// Expect control to have values for selected time filter
|
||||
const menu = await PageObjects.visualize.getComboBoxOptions('listControlSelect0');
|
||||
expect(menu.trim().split('\n').join()).to.equal('osx,win 7,win 8,win xp');
|
||||
});
|
||||
const hasFilter = await filterBar.hasFilter(FIELD_NAME, 'ios');
|
||||
expect(hasFilter).to.equal(true);
|
||||
});
|
||||
|
||||
describe('chained controls', () => {
|
||||
it('should replace existing filter pill(s) when new item is selected', async () => {
|
||||
await PageObjects.visualize.clearComboBox('listControlSelect0');
|
||||
await PageObjects.visualize.setComboBox('listControlSelect0', 'osx');
|
||||
await testSubjects.click('inputControlSubmitBtn');
|
||||
|
||||
before(async () => {
|
||||
await PageObjects.common.navigateToUrl('visualize', 'new');
|
||||
await PageObjects.visualize.clickInputControlVis();
|
||||
await PageObjects.visualize.clickVisEditorTab('controls');
|
||||
const hasOldFilter = await filterBar.hasFilter(FIELD_NAME, 'ios');
|
||||
const hasNewFilter = await filterBar.hasFilter(FIELD_NAME, 'osx');
|
||||
expect(hasOldFilter).to.equal(false);
|
||||
expect(hasNewFilter).to.equal(true);
|
||||
});
|
||||
|
||||
await PageObjects.visualize.addInputControl();
|
||||
await PageObjects.visualize.setComboBox('indexPatternSelect-0', 'logstash');
|
||||
await PageObjects.common.sleep(1000); // give time for index-pattern to be fetched
|
||||
await PageObjects.visualize.setComboBox('fieldSelect-0', 'geo.src');
|
||||
it('should clear dropdown when filter pill removed', async () => {
|
||||
await filterBar.removeFilter(FIELD_NAME);
|
||||
await PageObjects.common.sleep(500); // give time for filter to be removed and event handlers to fire
|
||||
|
||||
await PageObjects.visualize.addInputControl();
|
||||
await PageObjects.visualize.setComboBox('indexPatternSelect-1', 'logstash');
|
||||
await PageObjects.common.sleep(1000); // give time for index-pattern to be fetched
|
||||
await PageObjects.visualize.setComboBox('fieldSelect-1', 'clientip');
|
||||
await PageObjects.visualize.setSelectByOptionText('parentSelect-1', 'geo.src');
|
||||
const hasValue = await PageObjects.visualize.doesComboBoxHaveSelectedOptions('listControlSelect0');
|
||||
expect(hasValue).to.equal(false);
|
||||
});
|
||||
|
||||
await PageObjects.visualize.clickGo();
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
});
|
||||
it('should clear form when Clear button is clicked but not remove filter pill', async () => {
|
||||
await PageObjects.visualize.setComboBox('listControlSelect0', 'ios');
|
||||
await testSubjects.click('inputControlSubmitBtn');
|
||||
const hasFilterBeforeClearBtnClicked = await filterBar.hasFilter(FIELD_NAME, 'ios');
|
||||
expect(hasFilterBeforeClearBtnClicked).to.equal(true);
|
||||
|
||||
it('should disable child control when parent control is not set', async () => {
|
||||
const parentControlMenu = await PageObjects.visualize.getComboBoxOptions('listControlSelect0');
|
||||
expect(parentControlMenu.trim().split('\n').join()).to.equal('BR,CN,ID,IN,US');
|
||||
await testSubjects.click('inputControlClearBtn');
|
||||
const hasValue = await PageObjects.visualize.doesComboBoxHaveSelectedOptions('listControlSelect0');
|
||||
expect(hasValue).to.equal(false);
|
||||
|
||||
const childControlInput = await find.byCssSelector('[data-test-subj="inputControl1"] input');
|
||||
const isDisabled = await childControlInput.getProperty('disabled');
|
||||
expect(isDisabled).to.equal(true);
|
||||
});
|
||||
const hasFilterAfterClearBtnClicked = await filterBar.hasFilter(FIELD_NAME, 'ios');
|
||||
expect(hasFilterAfterClearBtnClicked).to.equal(true);
|
||||
});
|
||||
|
||||
it('should filter child control options by parent control value', async () => {
|
||||
await PageObjects.visualize.setComboBox('listControlSelect0', 'BR');
|
||||
it('should remove filter pill when cleared form is submitted', async () => {
|
||||
await testSubjects.click('inputControlSubmitBtn');
|
||||
const hasFilter = await filterBar.hasFilter(FIELD_NAME, 'ios');
|
||||
expect(hasFilter).to.equal(false);
|
||||
});
|
||||
});
|
||||
|
||||
const childControlMenu = await PageObjects.visualize.getComboBoxOptions('listControlSelect1');
|
||||
expect(childControlMenu.trim().split('\n').join()).to.equal('14.61.182.136,3.174.21.181,6.183.121.70,71.241.97.89,9.69.255.135');
|
||||
});
|
||||
describe('updateFiltersOnChange is true', () => {
|
||||
before(async () => {
|
||||
await PageObjects.visualize.clickVisEditorTab('options');
|
||||
await PageObjects.visualize.checkCheckbox('inputControlEditorUpdateFiltersOnChangeCheckbox');
|
||||
await PageObjects.visualize.clickGo();
|
||||
|
||||
it('should create a separate filter pill for parent control and child control', async () => {
|
||||
await PageObjects.visualize.setComboBox('listControlSelect1', '14.61.182.136');
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
});
|
||||
|
||||
await testSubjects.click('inputControlSubmitBtn');
|
||||
after(async () => {
|
||||
await PageObjects.visualize.clickVisEditorTab('options');
|
||||
await PageObjects.visualize.uncheckCheckbox('inputControlEditorUpdateFiltersOnChangeCheckbox');
|
||||
await PageObjects.visualize.clickGo();
|
||||
|
||||
const hasParentControlFilter = await filterBar.hasFilter('geo.src', 'BR');
|
||||
expect(hasParentControlFilter).to.equal(true);
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
});
|
||||
|
||||
const hasChildControlFilter = await filterBar.hasFilter('clientip', '14.61.182.136');
|
||||
expect(hasChildControlFilter).to.equal(true);
|
||||
});
|
||||
it('should not display staging control buttons', async () => {
|
||||
const submitButtonExists = await testSubjects.exists('inputControlSubmitBtn');
|
||||
const cancelButtonExists = await testSubjects.exists('inputControlCancelBtn');
|
||||
const clearButtonExists = await testSubjects.exists('inputControlClearBtn');
|
||||
expect(submitButtonExists).to.equal(false);
|
||||
expect(cancelButtonExists).to.equal(false);
|
||||
expect(clearButtonExists).to.equal(false);
|
||||
});
|
||||
|
||||
it('should clear child control dropdown when parent control value is removed', async () => {
|
||||
await PageObjects.visualize.clearComboBox('listControlSelect0');
|
||||
await PageObjects.common.sleep(500); // give time for filter to be removed and event handlers to fire
|
||||
it('should add filter pill when item selected', async () => {
|
||||
await PageObjects.visualize.setComboBox('listControlSelect0', 'ios');
|
||||
|
||||
const childControlInput = await find.byCssSelector('[data-test-subj="inputControl1"] input');
|
||||
const isDisabled = await childControlInput.getProperty('disabled');
|
||||
expect(isDisabled).to.equal(true);
|
||||
const selectedOptions = await PageObjects.visualize.getComboBoxSelectedOptions('listControlSelect0');
|
||||
expect(selectedOptions[0].trim()).to.equal('ios');
|
||||
|
||||
await testSubjects.click('inputControlCancelBtn');
|
||||
});
|
||||
const hasFilter = await filterBar.hasFilter(FIELD_NAME, 'ios');
|
||||
expect(hasFilter).to.equal(true);
|
||||
});
|
||||
});
|
||||
|
||||
it('should clear child control dropdown when parent control filter pill removed', async () => {
|
||||
await filterBar.removeFilter('geo.src');
|
||||
await PageObjects.common.sleep(500); // give time for filter to be removed and event handlers to fire
|
||||
describe('useTimeFilter', () => {
|
||||
it('should use global time filter when getting terms', async () => {
|
||||
await PageObjects.visualize.clickVisEditorTab('options');
|
||||
await PageObjects.visualize.checkCheckbox('inputControlEditorUseTimeFilterCheckbox');
|
||||
await PageObjects.visualize.clickGo();
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
|
||||
const hasValue = await PageObjects.visualize.doesComboBoxHaveSelectedOptions('listControlSelect0');
|
||||
expect(hasValue).to.equal(false);
|
||||
});
|
||||
// Expect control to be disabled because no terms could be gathered with time filter applied
|
||||
const input = await find.byCssSelector('[data-test-subj="inputControl0"] input');
|
||||
const isDisabled = await input.getProperty('disabled');
|
||||
expect(isDisabled).to.equal(true);
|
||||
});
|
||||
|
||||
it('should re-create control when global time filter is updated', async () => {
|
||||
await PageObjects.header.setAbsoluteRange('2015-01-01', '2016-01-01');
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
|
||||
// Expect control to have values for selected time filter
|
||||
const menu = await PageObjects.visualize.getComboBoxOptions('listControlSelect0');
|
||||
expect(menu.trim().split('\n').join()).to.equal('osx,win 7,win 8,win xp');
|
||||
});
|
||||
});
|
||||
|
||||
describe('chained controls', () => {
|
||||
|
||||
before(async () => {
|
||||
await PageObjects.common.navigateToUrl('visualize', 'new');
|
||||
await PageObjects.visualize.clickInputControlVis();
|
||||
await PageObjects.visualize.clickVisEditorTab('controls');
|
||||
|
||||
await PageObjects.visualize.addInputControl();
|
||||
await PageObjects.visualize.setComboBox('indexPatternSelect-0', 'logstash');
|
||||
await PageObjects.common.sleep(1000); // give time for index-pattern to be fetched
|
||||
await PageObjects.visualize.setComboBox('fieldSelect-0', 'geo.src');
|
||||
|
||||
await PageObjects.visualize.addInputControl();
|
||||
await PageObjects.visualize.setComboBox('indexPatternSelect-1', 'logstash');
|
||||
await PageObjects.common.sleep(1000); // give time for index-pattern to be fetched
|
||||
await PageObjects.visualize.setComboBox('fieldSelect-1', 'clientip');
|
||||
await PageObjects.visualize.setSelectByOptionText('parentSelect-1', 'geo.src');
|
||||
|
||||
await PageObjects.visualize.clickGo();
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
});
|
||||
|
||||
it('should disable child control when parent control is not set', async () => {
|
||||
const parentControlMenu = await PageObjects.visualize.getComboBoxOptions('listControlSelect0');
|
||||
expect(parentControlMenu.trim().split('\n').join()).to.equal('BR,CN,ID,IN,US');
|
||||
|
||||
const childControlInput = await find.byCssSelector('[data-test-subj="inputControl1"] input');
|
||||
const isDisabled = await childControlInput.getProperty('disabled');
|
||||
expect(isDisabled).to.equal(true);
|
||||
});
|
||||
|
||||
it('should filter child control options by parent control value', async () => {
|
||||
await PageObjects.visualize.setComboBox('listControlSelect0', 'BR');
|
||||
|
||||
const childControlMenu = await PageObjects.visualize.getComboBoxOptions('listControlSelect1');
|
||||
expect(childControlMenu.trim().split('\n').join()).to.equal('14.61.182.136,3.174.21.181,6.183.121.70,71.241.97.89,9.69.255.135');
|
||||
});
|
||||
|
||||
it('should create a seperate filter pill for parent control and child control', async () => {
|
||||
await PageObjects.visualize.setComboBox('listControlSelect1', '14.61.182.136');
|
||||
|
||||
await testSubjects.click('inputControlSubmitBtn');
|
||||
|
||||
const hasParentControlFilter = await filterBar.hasFilter('geo.src', 'BR');
|
||||
expect(hasParentControlFilter).to.equal(true);
|
||||
|
||||
const hasChildControlFilter = await filterBar.hasFilter('clientip', '14.61.182.136');
|
||||
expect(hasChildControlFilter).to.equal(true);
|
||||
});
|
||||
|
||||
it('should clear child control dropdown when parent control value is removed', async () => {
|
||||
await PageObjects.visualize.clearComboBox('listControlSelect0');
|
||||
await PageObjects.common.sleep(500); // give time for filter to be removed and event handlers to fire
|
||||
|
||||
const childControlInput = await find.byCssSelector('[data-test-subj="inputControl1"] input');
|
||||
const isDisabled = await childControlInput.getProperty('disabled');
|
||||
expect(isDisabled).to.equal(true);
|
||||
|
||||
await testSubjects.click('inputControlCancelBtn');
|
||||
});
|
||||
|
||||
it('should clear child control dropdown when parent control filter pill removed', async () => {
|
||||
await filterBar.removeFilter('geo.src');
|
||||
await PageObjects.common.sleep(500); // give time for filter to be removed and event handlers to fire
|
||||
|
||||
const hasValue = await PageObjects.visualize.doesComboBoxHaveSelectedOptions('listControlSelect0');
|
||||
expect(hasValue).to.equal(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -24,147 +24,101 @@ export default function ({ getService, getPageObjects }) {
|
|||
const retry = getService('retry');
|
||||
const PageObjects = getPageObjects(['common', 'visualize', 'header']);
|
||||
|
||||
describe('visualize app', function describeIndexTests() {
|
||||
before(function () {
|
||||
describe('line charts', function () {
|
||||
const vizName1 = 'Visualization LineChart';
|
||||
|
||||
before(async function () {
|
||||
const fromTime = '2015-09-19 06:31:44.000';
|
||||
const toTime = '2015-09-23 18:31:44.000';
|
||||
|
||||
log.debug('navigateToApp visualize');
|
||||
return PageObjects.common.navigateToUrl('visualize', 'new')
|
||||
.then(function () {
|
||||
log.debug('clickLineChart');
|
||||
return PageObjects.visualize.clickLineChart();
|
||||
})
|
||||
.then(function clickNewSearch() {
|
||||
return PageObjects.visualize.clickNewSearch();
|
||||
})
|
||||
.then(function setAbsoluteRange() {
|
||||
log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
})
|
||||
.then(function clickBucket() {
|
||||
log.debug('Bucket = Split Chart');
|
||||
return PageObjects.visualize.clickBucket('Split Chart');
|
||||
})
|
||||
.then(function selectAggregation() {
|
||||
log.debug('Aggregation = Terms');
|
||||
return PageObjects.visualize.selectAggregation('Terms');
|
||||
})
|
||||
.then(function selectField() {
|
||||
log.debug('Field = extension');
|
||||
return PageObjects.visualize.selectField('extension.raw');
|
||||
})
|
||||
.then(function setInterval() {
|
||||
log.debug('switch from Rows to Columns');
|
||||
return PageObjects.visualize.clickColumns();
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.header.waitUntilLoadingHasFinished();
|
||||
});
|
||||
await PageObjects.common.navigateToUrl('visualize', 'new');
|
||||
log.debug('clickLineChart');
|
||||
await PageObjects.visualize.clickLineChart();
|
||||
await PageObjects.visualize.clickNewSearch();
|
||||
log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
await PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
log.debug('Bucket = Split Chart');
|
||||
await PageObjects.visualize.clickBucket('Split Chart');
|
||||
log.debug('Aggregation = Terms');
|
||||
await PageObjects.visualize.selectAggregation('Terms');
|
||||
log.debug('Field = extension');
|
||||
await PageObjects.visualize.selectField('extension.raw');
|
||||
log.debug('switch from Rows to Columns');
|
||||
await PageObjects.visualize.clickColumns();
|
||||
await PageObjects.visualize.clickGo();
|
||||
});
|
||||
|
||||
describe('line charts', function indexPatternCreation() {
|
||||
const vizName1 = 'Visualization LineChart';
|
||||
afterEach(async () => {
|
||||
await PageObjects.visualize.closeInspector();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await PageObjects.visualize.closeInspector();
|
||||
it('should show correct chart', async function () {
|
||||
|
||||
// this test only verifies the numerical part of this data
|
||||
// it could also check the legend to verify the extensions
|
||||
const expectedChartData = ['jpg 9,109', 'css 2,159', 'png 1,373', 'gif 918', 'php 445'];
|
||||
|
||||
// sleep a bit before trying to get the chart data
|
||||
await PageObjects.common.sleep(3000);
|
||||
const data = await PageObjects.visualize.getLineChartData();
|
||||
log.debug('data=' + data);
|
||||
const tolerance = 10; // the y-axis scale is 10000 so 10 is 0.1%
|
||||
for (let x = 0; x < data.length; x++) {
|
||||
log.debug('x=' + x + ' expectedChartData[x].split(\' \')[1] = ' +
|
||||
(expectedChartData[x].split(' ')[1]).replace(',', '') + ' data[x]=' + data[x] +
|
||||
' diff=' + Math.abs(expectedChartData[x].split(' ')[1].replace(',', '') - data[x]));
|
||||
expect(Math.abs(expectedChartData[x].split(' ')[1].replace(',', '') - data[x]) < tolerance).to.be.ok();
|
||||
}
|
||||
log.debug('Done');
|
||||
});
|
||||
|
||||
|
||||
it('should have inspector enabled', async function () {
|
||||
const spyToggleExists = await PageObjects.visualize.isInspectorButtonEnabled();
|
||||
expect(spyToggleExists).to.be(true);
|
||||
});
|
||||
|
||||
it('should show correct chart order by Term', async function () {
|
||||
// this test only verifies the numerical part of this data
|
||||
// it could also check the legend to verify the extensions
|
||||
const expectedChartData = ['png 1,373', 'php 445', 'jpg 9,109', 'gif 918', 'css 2,159'];
|
||||
|
||||
log.debug('Order By = Term');
|
||||
await PageObjects.visualize.selectOrderBy('_key');
|
||||
await PageObjects.visualize.clickGo();
|
||||
await retry.try(async function () {
|
||||
const data = await PageObjects.visualize.getLineChartData();
|
||||
log.debug('data=' + data);
|
||||
const tolerance = 10; // the y-axis scale is 10000 so 10 is 0.1%
|
||||
for (let x = 0; x < data.length; x++) {
|
||||
log.debug('x=' + x + ' expectedChartData[x].split(\' \')[1] = ' +
|
||||
(expectedChartData[x].split(' ')[1]).replace(',', '') + ' data[x]=' + data[x] +
|
||||
' diff=' + Math.abs(expectedChartData[x].split(' ')[1].replace(',', '') - data[x]));
|
||||
expect(Math.abs(expectedChartData[x].split(' ')[1].replace(',', '') - data[x]) < tolerance).to.be.ok();
|
||||
}
|
||||
log.debug('Done');
|
||||
});
|
||||
});
|
||||
|
||||
it('should show correct chart, take screenshot', function () {
|
||||
it('should show correct data, ordered by Term', async function () {
|
||||
|
||||
// this test only verifies the numerical part of this data
|
||||
// it could also check the legend to verify the extensions
|
||||
const expectedChartData = ['jpg 9,109', 'css 2,159', 'png 1,373', 'gif 918', 'php 445'];
|
||||
const expectedChartData = [['png', '1,373'], ['php', '445'], ['jpg', '9,109'], ['gif', '918'], ['css', '2,159']];
|
||||
|
||||
// sleep a bit before trying to get the chart data
|
||||
return PageObjects.common.sleep(3000)
|
||||
.then(function () {
|
||||
return PageObjects.visualize.getLineChartData()
|
||||
.then(function showData(data) {
|
||||
log.debug('data=' + data);
|
||||
const tolerance = 10; // the y-axis scale is 10000 so 10 is 0.1%
|
||||
for (let x = 0; x < data.length; x++) {
|
||||
log.debug('x=' + x + ' expectedChartData[x].split(\' \')[1] = ' +
|
||||
(expectedChartData[x].split(' ')[1]).replace(',', '') + ' data[x]=' + data[x] +
|
||||
' diff=' + Math.abs(expectedChartData[x].split(' ')[1].replace(',', '') - data[x]));
|
||||
expect(Math.abs(expectedChartData[x].split(' ')[1].replace(',', '') - data[x]) < tolerance).to.be.ok();
|
||||
}
|
||||
log.debug('Done');
|
||||
});
|
||||
});
|
||||
});
|
||||
await PageObjects.visualize.openInspector();
|
||||
const data = await PageObjects.visualize.getInspectorTableData();
|
||||
log.debug(data);
|
||||
expect(data).to.eql(expectedChartData);
|
||||
});
|
||||
|
||||
it('should have inspector enabled', async function () {
|
||||
const spyToggleExists = await PageObjects.visualize.isInspectorButtonEnabled();
|
||||
expect(spyToggleExists).to.be(true);
|
||||
});
|
||||
|
||||
|
||||
it('should show correct chart order by Term', function () {
|
||||
|
||||
// this test only verifies the numerical part of this data
|
||||
// https://github.com/elastic/kibana/issues/8141
|
||||
const expectedChartData = ['png 1,373', 'php 445', 'jpg 9,109', 'gif 918', 'css 2,159'];
|
||||
|
||||
log.debug('Order By = Term');
|
||||
return PageObjects.visualize.selectOrderBy('_key')
|
||||
.then(function clickGo() {
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return retry.try(function () {
|
||||
return PageObjects.visualize.getLineChartData()
|
||||
.then(function showData(data) {
|
||||
log.debug('data=' + data);
|
||||
const tolerance = 10; // the y-axis scale is 10000 so 10 is 0.1%
|
||||
for (let x = 0; x < data.length; x++) {
|
||||
log.debug('x=' + x + ' expectedChartData[x].split(\' \')[1] = ' +
|
||||
(expectedChartData[x].split(' ')[1]).replace(',', '') + ' data[x]=' + data[x] +
|
||||
' diff=' + Math.abs(expectedChartData[x].split(' ')[1].replace(',', '') - data[x]));
|
||||
expect(Math.abs(expectedChartData[x].split(' ')[1].replace(',', '') - data[x]) < tolerance).to.be.ok();
|
||||
}
|
||||
log.debug('Done');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should show correct data, ordered by Term', function () {
|
||||
|
||||
const expectedChartData = [['png', '1,373'], ['php', '445'], ['jpg', '9,109'], ['gif', '918'], ['css', '2,159']];
|
||||
|
||||
return PageObjects.visualize.openInspector()
|
||||
.then(function getInspectorTableData() {
|
||||
return PageObjects.visualize.getInspectorTableData();
|
||||
})
|
||||
.then(function showData(data) {
|
||||
log.debug(data);
|
||||
expect(data).to.eql(expectedChartData);
|
||||
});
|
||||
});
|
||||
|
||||
it('should be able to save and load', function () {
|
||||
return PageObjects.visualize.saveVisualization(vizName1)
|
||||
.then(() => {
|
||||
return PageObjects.common.getBreadcrumbPageTitle();
|
||||
})
|
||||
.then(pageTitle => {
|
||||
log.debug(`Save viz page title is ${pageTitle}`);
|
||||
expect(pageTitle).to.contain(vizName1);
|
||||
})
|
||||
.then(function testVisualizeWaitForToastMessageGone() {
|
||||
return PageObjects.header.waitForToastMessageGone();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.visualize.loadSavedVisualization(vizName1);
|
||||
})
|
||||
.then(function waitForVisualization() {
|
||||
return PageObjects.visualize.waitForVisualization();
|
||||
});
|
||||
});
|
||||
it('should be able to save and load', async function () {
|
||||
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();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -22,266 +22,170 @@ import expect from 'expect.js';
|
|||
export default function ({ getService, getPageObjects }) {
|
||||
const log = getService('log');
|
||||
const retry = getService('retry');
|
||||
const screenshots = getService('screenshots');
|
||||
const PageObjects = getPageObjects(['common', 'visualize', 'header']);
|
||||
|
||||
describe('visualize app', function describeIndexTests() {
|
||||
describe('metric chart', function () {
|
||||
const fromTime = '2015-09-19 06:31:44.000';
|
||||
const toTime = '2015-09-23 18:31:44.000';
|
||||
|
||||
before(function () {
|
||||
before(async function () {
|
||||
log.debug('navigateToApp visualize');
|
||||
return PageObjects.common.navigateToUrl('visualize', 'new')
|
||||
.then(function () {
|
||||
log.debug('clickMetric');
|
||||
return PageObjects.visualize.clickMetric();
|
||||
})
|
||||
.then(function clickNewSearch() {
|
||||
return PageObjects.visualize.clickNewSearch();
|
||||
})
|
||||
.then(function setAbsoluteRange() {
|
||||
log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
});
|
||||
await PageObjects.common.navigateToUrl('visualize', 'new');
|
||||
log.debug('clickMetric');
|
||||
await PageObjects.visualize.clickMetric();
|
||||
await PageObjects.visualize.clickNewSearch();
|
||||
log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
await PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
});
|
||||
|
||||
describe('metric chart', function indexPatternCreation() {
|
||||
|
||||
it('should have inspector enabled', async function () {
|
||||
const spyToggleExists = await PageObjects.visualize.isInspectorButtonEnabled();
|
||||
expect(spyToggleExists).to.be(true);
|
||||
});
|
||||
|
||||
it('should show Count', function () {
|
||||
const expectedCount = ['14,004', 'Count'];
|
||||
|
||||
// initial metric of "Count" is selected by default
|
||||
return retry.try(function tryingForTime() {
|
||||
return PageObjects.visualize.getMetric()
|
||||
.then(function (metricValue) {
|
||||
screenshots.take('Visualize-metric-chart');
|
||||
expect(expectedCount).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should show Average', function () {
|
||||
const avgMachineRam = ['13,104,036,080.615', 'Average machine.ram'];
|
||||
return PageObjects.visualize.clickMetricEditor()
|
||||
.then(function () {
|
||||
log.debug('Aggregation = Average');
|
||||
return PageObjects.visualize.selectAggregation('Average');
|
||||
})
|
||||
.then(function selectField() {
|
||||
log.debug('Field = machine.ram');
|
||||
return PageObjects.visualize.selectField('machine.ram', 'metrics');
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return retry.try(function tryingForTime() {
|
||||
return PageObjects.visualize.getMetric()
|
||||
.then(function (metricValue) {
|
||||
expect(avgMachineRam).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should show Sum', function () {
|
||||
const sumPhpMemory = ['85,865,880', 'Sum of phpmemory'];
|
||||
log.debug('Aggregation = Sum');
|
||||
return PageObjects.visualize.selectAggregation('Sum')
|
||||
.then(function selectField() {
|
||||
log.debug('Field = phpmemory');
|
||||
return PageObjects.visualize.selectField('phpmemory', 'metrics');
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return retry.try(function tryingForTime() {
|
||||
return PageObjects.visualize.getMetric()
|
||||
.then(function (metricValue) {
|
||||
expect(sumPhpMemory).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should show Median', function () {
|
||||
const medianBytes = ['5,565.263', '50th percentile of bytes'];
|
||||
// For now, only comparing the text label part of the metric
|
||||
log.debug('Aggregation = Median');
|
||||
return PageObjects.visualize.selectAggregation('Median')
|
||||
.then(function selectField() {
|
||||
log.debug('Field = bytes');
|
||||
return PageObjects.visualize.selectField('bytes', 'metrics');
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return retry.try(function tryingForTime() {
|
||||
return PageObjects.visualize.getMetric()
|
||||
.then(function (metricValue) {
|
||||
// only comparing the text label!
|
||||
expect(medianBytes[1]).to.eql(metricValue.split('\n')[1]);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should show Min', function () {
|
||||
const minTimestamp = ['September 20th 2015, 00:00:00.000', 'Min @timestamp'];
|
||||
log.debug('Aggregation = Min');
|
||||
return PageObjects.visualize.selectAggregation('Min')
|
||||
.then(function selectField() {
|
||||
log.debug('Field = @timestamp');
|
||||
return PageObjects.visualize.selectField('@timestamp', 'metrics');
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return retry.try(function tryingForTime() {
|
||||
return PageObjects.visualize.getMetric()
|
||||
.then(function (metricValue) {
|
||||
expect(minTimestamp).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should show Max', function () {
|
||||
const maxRelatedContentArticleModifiedTime = ['April 4th 2015, 00:54:41.000', 'Max relatedContent.article:modified_time'];
|
||||
log.debug('Aggregation = Max');
|
||||
return PageObjects.visualize.selectAggregation('Max')
|
||||
.then(function selectField() {
|
||||
log.debug('Field = relatedContent.article:modified_time');
|
||||
return PageObjects.visualize.selectField('relatedContent.article:modified_time', 'metrics');
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return retry.try(function tryingForTime() {
|
||||
return PageObjects.visualize.getMetric()
|
||||
.then(function (metricValue) {
|
||||
expect(maxRelatedContentArticleModifiedTime).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should show Standard Deviation', function () {
|
||||
const standardDeviationBytes = [
|
||||
'-1,435.138', 'Lower Standard Deviation of bytes',
|
||||
'12,889.766', 'Upper Standard Deviation of bytes'
|
||||
];
|
||||
log.debug('Aggregation = Standard Deviation');
|
||||
return PageObjects.visualize.selectAggregation('Standard Deviation')
|
||||
.then(function selectField() {
|
||||
log.debug('Field = bytes');
|
||||
return PageObjects.visualize.selectField('bytes', 'metrics');
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return retry.try(function tryingForTime() {
|
||||
return PageObjects.visualize.getMetric()
|
||||
.then(function (metricValue) {
|
||||
expect(standardDeviationBytes).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should show Unique Count', function () {
|
||||
const uniqueCountClientip = ['1,000', 'Unique count of clientip'];
|
||||
log.debug('Aggregation = Unique Count');
|
||||
return PageObjects.visualize.selectAggregation('Unique Count')
|
||||
.then(function selectField() {
|
||||
log.debug('Field = clientip');
|
||||
return PageObjects.visualize.selectField('clientip', 'metrics');
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return retry.try(function tryingForTime() {
|
||||
return PageObjects.visualize.getMetric()
|
||||
.then(function (metricValue) {
|
||||
expect(uniqueCountClientip).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
});
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.visualize.getMetric()
|
||||
.then(function (metricValue) {
|
||||
log.debug('metricValue=' + metricValue.split('\n'));
|
||||
expect(uniqueCountClientip).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should show Percentiles', function () {
|
||||
const percentileMachineRam = [
|
||||
'2,147,483,648', '1st percentile of machine.ram',
|
||||
'3,221,225,472', '5th percentile of machine.ram',
|
||||
'7,516,192,768', '25th percentile of machine.ram',
|
||||
'12,884,901,888', '50th percentile of machine.ram',
|
||||
'18,253,611,008', '75th percentile of machine.ram',
|
||||
'32,212,254,720', '95th percentile of machine.ram',
|
||||
'32,212,254,720', '99th percentile of machine.ram'
|
||||
];
|
||||
|
||||
log.debug('Aggregation = Percentiles');
|
||||
return PageObjects.visualize.selectAggregation('Percentiles')
|
||||
.then(function selectField() {
|
||||
log.debug('Field = machine.ram');
|
||||
return PageObjects.visualize.selectField('machine.ram', 'metrics');
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return retry.try(function tryingForTime() {
|
||||
return PageObjects.visualize.getMetric()
|
||||
.then(function (metricValue) {
|
||||
expect(percentileMachineRam).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should show Percentile Ranks', function () {
|
||||
const percentileRankBytes = [ '2.036%', 'Percentile rank 99 of "memory"'];
|
||||
log.debug('Aggregation = Percentile Ranks');
|
||||
return PageObjects.visualize.selectAggregation('Percentile Ranks')
|
||||
.then(function selectField() {
|
||||
log.debug('Field = bytes');
|
||||
return PageObjects.visualize.selectField('memory', 'metrics');
|
||||
})
|
||||
.then(function selectField() {
|
||||
log.debug('Values = 99');
|
||||
return PageObjects.visualize.setValue('99');
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return retry.try(function tryingForTime() {
|
||||
return PageObjects.visualize.getMetric()
|
||||
.then(function (metricValue) {
|
||||
expect(percentileRankBytes).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should have inspector enabled', async function () {
|
||||
const spyToggleExists = await PageObjects.visualize.isInspectorButtonEnabled();
|
||||
expect(spyToggleExists).to.be(true);
|
||||
});
|
||||
|
||||
it('should show Count', async function () {
|
||||
const expectedCount = ['14,004', 'Count'];
|
||||
|
||||
// initial metric of "Count" is selected by default
|
||||
await retry.try(async function tryingForTime() {
|
||||
const metricValue = await PageObjects.visualize.getMetric();
|
||||
expect(expectedCount).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
});
|
||||
|
||||
it('should show Average', async function () {
|
||||
const avgMachineRam = ['13,104,036,080.615', 'Average machine.ram'];
|
||||
await PageObjects.visualize.clickMetricEditor();
|
||||
log.debug('Aggregation = Average');
|
||||
await PageObjects.visualize.selectAggregation('Average');
|
||||
log.debug('Field = machine.ram');
|
||||
await PageObjects.visualize.selectField('machine.ram', 'metrics');
|
||||
await PageObjects.visualize.clickGo();
|
||||
await retry.try(async function tryingForTime() {
|
||||
const metricValue = await PageObjects.visualize.getMetric();
|
||||
expect(avgMachineRam).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
});
|
||||
|
||||
it('should show Sum', async function () {
|
||||
const sumPhpMemory = ['85,865,880', 'Sum of phpmemory'];
|
||||
log.debug('Aggregation = Sum');
|
||||
await PageObjects.visualize.selectAggregation('Sum');
|
||||
log.debug('Field = phpmemory');
|
||||
await PageObjects.visualize.selectField('phpmemory', 'metrics');
|
||||
await PageObjects.visualize.clickGo();
|
||||
await retry.try(async function tryingForTime() {
|
||||
const metricValue = await PageObjects.visualize.getMetric();
|
||||
expect(sumPhpMemory).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
});
|
||||
|
||||
it('should show Median', async function () {
|
||||
const medianBytes = ['5,565.263', '50th percentile of bytes'];
|
||||
// For now, only comparing the text label part of the metric
|
||||
log.debug('Aggregation = Median');
|
||||
await PageObjects.visualize.selectAggregation('Median');
|
||||
log.debug('Field = bytes');
|
||||
await PageObjects.visualize.selectField('bytes', 'metrics');
|
||||
await PageObjects.visualize.clickGo();
|
||||
await retry.try(async function tryingForTime() {
|
||||
const metricValue = await PageObjects.visualize.getMetric();
|
||||
// only comparing the text label!
|
||||
expect(medianBytes[1]).to.eql(metricValue.split('\n')[1]);
|
||||
});
|
||||
});
|
||||
|
||||
it('should show Min', async function () {
|
||||
const minTimestamp = ['September 20th 2015, 00:00:00.000', 'Min @timestamp'];
|
||||
log.debug('Aggregation = Min');
|
||||
await PageObjects.visualize.selectAggregation('Min');
|
||||
log.debug('Field = @timestamp');
|
||||
await PageObjects.visualize.selectField('@timestamp', 'metrics');
|
||||
await PageObjects.visualize.clickGo();
|
||||
await retry.try(async function tryingForTime() {
|
||||
const metricValue = await PageObjects.visualize.getMetric();
|
||||
expect(minTimestamp).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
});
|
||||
|
||||
it('should show Max', async function () {
|
||||
const maxRelatedContentArticleModifiedTime = ['April 4th 2015, 00:54:41.000', 'Max relatedContent.article:modified_time'];
|
||||
log.debug('Aggregation = Max');
|
||||
await PageObjects.visualize.selectAggregation('Max');
|
||||
log.debug('Field = relatedContent.article:modified_time');
|
||||
await PageObjects.visualize.selectField('relatedContent.article:modified_time', 'metrics');
|
||||
await PageObjects.visualize.clickGo();
|
||||
await retry.try(async function tryingForTime() {
|
||||
const metricValue = await PageObjects.visualize.getMetric();
|
||||
expect(maxRelatedContentArticleModifiedTime).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
});
|
||||
|
||||
it('should show Standard Deviation', async function () {
|
||||
const standardDeviationBytes = [
|
||||
'-1,435.138', 'Lower Standard Deviation of bytes',
|
||||
'12,889.766', 'Upper Standard Deviation of bytes'
|
||||
];
|
||||
log.debug('Aggregation = Standard Deviation');
|
||||
await PageObjects.visualize.selectAggregation('Standard Deviation');
|
||||
log.debug('Field = bytes');
|
||||
await PageObjects.visualize.selectField('bytes', 'metrics');
|
||||
await PageObjects.visualize.clickGo();
|
||||
await retry.try(async function tryingForTime() {
|
||||
const metricValue = await PageObjects.visualize.getMetric();
|
||||
expect(standardDeviationBytes).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
});
|
||||
|
||||
it('should show Unique Count', async function () {
|
||||
const uniqueCountClientip = ['1,000', 'Unique count of clientip'];
|
||||
log.debug('Aggregation = Unique Count');
|
||||
await PageObjects.visualize.selectAggregation('Unique Count');
|
||||
log.debug('Field = clientip');
|
||||
await PageObjects.visualize.selectField('clientip', 'metrics');
|
||||
await PageObjects.visualize.clickGo();
|
||||
await retry.try(async function tryingForTime() {
|
||||
const metricValue = await PageObjects.visualize.getMetric();
|
||||
expect(uniqueCountClientip).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
});
|
||||
|
||||
it('should show Percentiles', async function () {
|
||||
const percentileMachineRam = [
|
||||
'2,147,483,648', '1st percentile of machine.ram',
|
||||
'3,221,225,472', '5th percentile of machine.ram',
|
||||
'7,516,192,768', '25th percentile of machine.ram',
|
||||
'12,884,901,888', '50th percentile of machine.ram',
|
||||
'18,253,611,008', '75th percentile of machine.ram',
|
||||
'32,212,254,720', '95th percentile of machine.ram',
|
||||
'32,212,254,720', '99th percentile of machine.ram'
|
||||
];
|
||||
|
||||
log.debug('Aggregation = Percentiles');
|
||||
await PageObjects.visualize.selectAggregation('Percentiles');
|
||||
log.debug('Field = machine.ram');
|
||||
await PageObjects.visualize.selectField('machine.ram', 'metrics');
|
||||
await PageObjects.visualize.clickGo();
|
||||
await retry.try(async function tryingForTime() {
|
||||
const metricValue = await PageObjects.visualize.getMetric();
|
||||
expect(percentileMachineRam).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
});
|
||||
|
||||
it('should show Percentile Ranks', async function () {
|
||||
const percentileRankBytes = [ '2.036%', 'Percentile rank 99 of "memory"'];
|
||||
log.debug('Aggregation = Percentile Ranks');
|
||||
await PageObjects.visualize.selectAggregation('Percentile Ranks');
|
||||
log.debug('Field = bytes');
|
||||
await PageObjects.visualize.selectField('memory', 'metrics');
|
||||
log.debug('Values = 99');
|
||||
await PageObjects.visualize.setValue('99');
|
||||
await PageObjects.visualize.clickGo();
|
||||
await retry.try(async function tryingForTime() {
|
||||
const metricValue = await PageObjects.visualize.getMetric();
|
||||
expect(percentileRankBytes).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
|
|
@ -25,165 +25,93 @@ export default function ({ getService, getPageObjects }) {
|
|||
const fromTime = '2015-09-19 06:31:44.000';
|
||||
const toTime = '2015-09-23 18:31:44.000';
|
||||
|
||||
describe('visualize app', function describeIndexTests() {
|
||||
before(function () {
|
||||
describe('pie chart', async function () {
|
||||
const vizName1 = 'Visualization PieChart';
|
||||
before(async function () {
|
||||
|
||||
log.debug('navigateToApp visualize');
|
||||
return PageObjects.common.navigateToUrl('visualize', 'new')
|
||||
.then(function () {
|
||||
log.debug('clickPieChart');
|
||||
return PageObjects.visualize.clickPieChart();
|
||||
})
|
||||
.then(function clickNewSearch() {
|
||||
return PageObjects.visualize.clickNewSearch();
|
||||
})
|
||||
.then(function setAbsoluteRange() {
|
||||
log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
})
|
||||
.then(function () {
|
||||
log.debug('select bucket Split Slices');
|
||||
return PageObjects.visualize.clickBucket('Split Slices');
|
||||
})
|
||||
.then(function () {
|
||||
log.debug('Click aggregation Histogram');
|
||||
return PageObjects.visualize.selectAggregation('Histogram');
|
||||
})
|
||||
.then(function () {
|
||||
log.debug('Click field memory');
|
||||
return PageObjects.visualize.selectField('memory');
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.header.waitUntilLoadingHasFinished();
|
||||
})
|
||||
.then(function sleep() {
|
||||
return PageObjects.common.sleep(1003);
|
||||
})
|
||||
.then(function () {
|
||||
log.debug('setNumericInterval 4000');
|
||||
return PageObjects.visualize.setNumericInterval('40000');
|
||||
})
|
||||
.then(function () {
|
||||
log.debug('clickGo');
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.header.waitUntilLoadingHasFinished();
|
||||
});
|
||||
await PageObjects.common.navigateToUrl('visualize', 'new');
|
||||
log.debug('clickPieChart');
|
||||
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 Slices');
|
||||
log.debug('Click aggregation Histogram');
|
||||
await PageObjects.visualize.selectAggregation('Histogram');
|
||||
log.debug('Click field memory');
|
||||
await PageObjects.visualize.selectField('memory');
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await PageObjects.common.sleep(1003);
|
||||
log.debug('setNumericInterval 4000');
|
||||
await PageObjects.visualize.setNumericInterval('40000');
|
||||
log.debug('clickGo');
|
||||
await PageObjects.visualize.clickGo();
|
||||
});
|
||||
|
||||
it('should save and load', async function () {
|
||||
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();
|
||||
// sleep a bit before trying to get the pie chart data below
|
||||
await PageObjects.common.sleep(2000);
|
||||
});
|
||||
|
||||
it('should have inspector enabled', async function () {
|
||||
const spyToggleExists = await PageObjects.visualize.isInspectorButtonEnabled();
|
||||
expect(spyToggleExists).to.be(true);
|
||||
});
|
||||
|
||||
|
||||
describe('pie chart', function indexPatternCreation() {
|
||||
const vizName1 = 'Visualization PieChart';
|
||||
it('should show 10 slices in pie chart', async function () {
|
||||
const expectedPieChartSliceCount = 10;
|
||||
|
||||
it('should save and load', function () {
|
||||
return PageObjects.visualize.saveVisualization(vizName1)
|
||||
.then(() => {
|
||||
return PageObjects.common.getBreadcrumbPageTitle();
|
||||
})
|
||||
.then(pageTitle => {
|
||||
log.debug(`Save viz page title is ${pageTitle}`);
|
||||
expect(pageTitle).to.contain(vizName1);
|
||||
})
|
||||
.then(function testVisualizeWaitForToastMessageGone() {
|
||||
return PageObjects.header.waitForToastMessageGone();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.visualize.loadSavedVisualization(vizName1);
|
||||
})
|
||||
.then(function waitForVisualization() {
|
||||
return PageObjects.visualize.waitForVisualization();
|
||||
})
|
||||
// sleep a bit before trying to get the pie chart data below
|
||||
.then(function sleep() {
|
||||
return PageObjects.common.sleep(2000);
|
||||
});
|
||||
});
|
||||
const pieData = await PageObjects.visualize.getPieChartData();
|
||||
log.debug('pieData.length = ' + pieData.length);
|
||||
expect(pieData.length).to.be(expectedPieChartSliceCount);
|
||||
});
|
||||
|
||||
it('should have inspector enabled', async function () {
|
||||
const spyToggleExists = await PageObjects.visualize.isInspectorButtonEnabled();
|
||||
expect(spyToggleExists).to.be(true);
|
||||
});
|
||||
it('should show correct data', async function () {
|
||||
const expectedTableData = [['0', '55'], ['40,000', '50'], ['80,000', '41'], ['120,000', '43'],
|
||||
['160,000', '44'], ['200,000', '40'], ['240,000', '46'], ['280,000', '39'], ['320,000', '40'], ['360,000', '47']
|
||||
];
|
||||
|
||||
it('should show 10 slices in pie chart, take screenshot', function () {
|
||||
const expectedPieChartSliceCount = 10;
|
||||
|
||||
return PageObjects.visualize.getPieChartData()
|
||||
.then(function (pieData) {
|
||||
log.debug('pieData.length = ' + pieData.length);
|
||||
expect(pieData.length).to.be(expectedPieChartSliceCount);
|
||||
});
|
||||
});
|
||||
await PageObjects.visualize.openInspector();
|
||||
await PageObjects.visualize.setInspectorTablePageSize(50);
|
||||
const data = await PageObjects.visualize.getInspectorTableData();
|
||||
log.debug(data);
|
||||
expect(data).to.eql(expectedTableData);
|
||||
});
|
||||
|
||||
it('should show correct data', function () {
|
||||
const expectedTableData = [['0', '55'], ['40,000', '50'], ['80,000', '41'], ['120,000', '43'],
|
||||
['160,000', '44'], ['200,000', '40'], ['240,000', '46'], ['280,000', '39'], ['320,000', '40'], ['360,000', '47']
|
||||
];
|
||||
it('should show other and missing bucket', async function () {
|
||||
const expectedTableData = [ 'win 8', 'win xp', 'win 7', 'ios', 'Missing', 'Other' ];
|
||||
|
||||
return PageObjects.visualize.openInspector()
|
||||
.then(function () {
|
||||
return PageObjects.visualize.setInspectorTablePageSize(50);
|
||||
})
|
||||
.then(function getInspectorTableData() {
|
||||
return PageObjects.visualize.getInspectorTableData();
|
||||
})
|
||||
.then(function showData(data) {
|
||||
log.debug(data);
|
||||
expect(data).to.eql(expectedTableData);
|
||||
});
|
||||
});
|
||||
|
||||
it('should show other and missing bucket', function () {
|
||||
const expectedTableData = [ 'win 8', 'win xp', 'win 7', 'ios', 'Missing', 'Other' ];
|
||||
|
||||
return PageObjects.common.navigateToUrl('visualize', 'new')
|
||||
.then(function () {
|
||||
log.debug('clickPieChart');
|
||||
return PageObjects.visualize.clickPieChart();
|
||||
})
|
||||
.then(function clickNewSearch() {
|
||||
return PageObjects.visualize.clickNewSearch();
|
||||
})
|
||||
.then(function setAbsoluteRange() {
|
||||
log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
})
|
||||
.then(function () {
|
||||
log.debug('select bucket Split Slices');
|
||||
return PageObjects.visualize.clickBucket('Split Slices');
|
||||
})
|
||||
.then(function () {
|
||||
log.debug('Click aggregation Histogram');
|
||||
return PageObjects.visualize.selectAggregation('Terms');
|
||||
})
|
||||
.then(function () {
|
||||
log.debug('Click field memory');
|
||||
return PageObjects.visualize.selectField('machine.os.raw');
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.visualize.toggleOtherBucket();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.visualize.toggleMissingBucket();
|
||||
})
|
||||
.then(function () {
|
||||
log.debug('clickGo');
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function waitForVisualization() {
|
||||
return PageObjects.header.waitUntilLoadingHasFinished();
|
||||
})
|
||||
.then(function sleep() {
|
||||
return PageObjects.common.sleep(1003);
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.visualize.getPieChartLabels();
|
||||
})
|
||||
.then(function (pieData) {
|
||||
log.debug('pieData.length = ' + pieData.length);
|
||||
expect(pieData).to.eql(expectedTableData);
|
||||
});
|
||||
});
|
||||
await PageObjects.common.navigateToUrl('visualize', 'new');
|
||||
log.debug('clickPieChart');
|
||||
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 Slices');
|
||||
log.debug('Click aggregation Histogram');
|
||||
await PageObjects.visualize.selectAggregation('Terms');
|
||||
log.debug('Click field memory');
|
||||
await PageObjects.visualize.selectField('machine.os.raw');
|
||||
await PageObjects.visualize.toggleOtherBucket();
|
||||
await PageObjects.visualize.toggleMissingBucket();
|
||||
log.debug('clickGo');
|
||||
await PageObjects.visualize.clickGo();
|
||||
await PageObjects.common.sleep(1003);
|
||||
const pieData = await PageObjects.visualize.getPieChartLabels();
|
||||
log.debug('pieData.length = ' + pieData.length);
|
||||
expect(pieData).to.eql(expectedTableData);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -26,81 +26,49 @@ export default function ({ getService, getPageObjects }) {
|
|||
const pointSeriesVis = PageObjects.pointSeries;
|
||||
|
||||
describe('point series', function describeIndexTests() {
|
||||
before(function () {
|
||||
before(async function () {
|
||||
const fromTime = '2015-09-19 06:31:44.000';
|
||||
const toTime = '2015-09-23 18:31:44.000';
|
||||
|
||||
log.debug('navigateToApp visualize');
|
||||
return PageObjects.common.navigateToUrl('visualize', 'new')
|
||||
.then(function () {
|
||||
log.debug('clickLineChart');
|
||||
return PageObjects.visualize.clickLineChart();
|
||||
})
|
||||
.then(function clickNewSearch() {
|
||||
return PageObjects.visualize.clickNewSearch();
|
||||
})
|
||||
.then(function setAbsoluteRange() {
|
||||
log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
})
|
||||
.then(function clickBucket() {
|
||||
log.debug('Bucket = X-Axis');
|
||||
return PageObjects.visualize.clickBucket('X-Axis');
|
||||
})
|
||||
.then(function selectAggregation() {
|
||||
log.debug('Aggregation = Date Histogram');
|
||||
return PageObjects.visualize.selectAggregation('Date Histogram');
|
||||
})
|
||||
.then(function selectField() {
|
||||
log.debug('Field = @timestamp');
|
||||
return PageObjects.visualize.selectField('@timestamp');
|
||||
})
|
||||
await PageObjects.common.navigateToUrl('visualize', 'new');
|
||||
log.debug('clickLineChart');
|
||||
await PageObjects.visualize.clickLineChart();
|
||||
await PageObjects.visualize.clickNewSearch();
|
||||
log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
await PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
log.debug('Bucket = X-Axis');
|
||||
await PageObjects.visualize.clickBucket('X-Axis');
|
||||
log.debug('Aggregation = Date Histogram');
|
||||
await PageObjects.visualize.selectAggregation('Date Histogram');
|
||||
log.debug('Field = @timestamp');
|
||||
await PageObjects.visualize.selectField('@timestamp');
|
||||
// add another metrics
|
||||
.then(function clickAddMetrics() {
|
||||
log.debug('Add Metric');
|
||||
return PageObjects.visualize.clickAddMetric();
|
||||
})
|
||||
.then(function () {
|
||||
log.debug('Metric = Value Axis');
|
||||
return PageObjects.visualize.clickBucket('Y-Axis');
|
||||
})
|
||||
.then(function selectAggregation() {
|
||||
log.debug('Aggregation = Average');
|
||||
return PageObjects.visualize.selectAggregation('Average', 'metrics');
|
||||
})
|
||||
.then(function selectField() {
|
||||
log.debug('Field = memory');
|
||||
return PageObjects.visualize.selectField('machine.ram', 'metrics');
|
||||
})
|
||||
log.debug('Add Metric');
|
||||
await PageObjects.visualize.clickAddMetric();
|
||||
log.debug('Metric = Value Axis');
|
||||
await PageObjects.visualize.clickBucket('Y-Axis');
|
||||
log.debug('Aggregation = Average');
|
||||
await PageObjects.visualize.selectAggregation('Average', 'metrics');
|
||||
log.debug('Field = memory');
|
||||
await PageObjects.visualize.selectField('machine.ram', 'metrics');
|
||||
// go to options page
|
||||
.then(function gotoAxisOptions() {
|
||||
log.debug('Going to axis options');
|
||||
return pointSeriesVis.clickAxisOptions();
|
||||
})
|
||||
log.debug('Going to axis options');
|
||||
await pointSeriesVis.clickAxisOptions();
|
||||
// add another value axis
|
||||
.then(function addAxis() {
|
||||
log.debug('adding axis');
|
||||
return pointSeriesVis.clickAddAxis();
|
||||
})
|
||||
log.debug('adding axis');
|
||||
await pointSeriesVis.clickAddAxis();
|
||||
// set average count to use second value axis
|
||||
.then(function setAxis() {
|
||||
return pointSeriesVis.toggleCollapsibleTitle('Average machine.ram')
|
||||
.then(function () {
|
||||
log.debug('Average memory value axis - ValueAxis-2');
|
||||
return pointSeriesVis.setSeriesAxis(1, 'ValueAxis-2');
|
||||
});
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.header.awaitGlobalLoadingIndicatorHidden();
|
||||
});
|
||||
await pointSeriesVis.toggleCollapsibleTitle('Average machine.ram');
|
||||
log.debug('Average memory value axis - ValueAxis-2');
|
||||
await pointSeriesVis.setSeriesAxis(1, 'ValueAxis-2');
|
||||
await PageObjects.visualize.clickGo();
|
||||
await PageObjects.header.awaitGlobalLoadingIndicatorHidden();
|
||||
});
|
||||
|
||||
describe('secondary value axis', function () {
|
||||
|
||||
it('should show correct chart, take screenshot', async function () {
|
||||
it('should show correct chart', async function () {
|
||||
const expectedChartValues = [
|
||||
[ 37, 202, 740, 1437, 1371, 751, 188, 31, 42, 202, 683,
|
||||
1361, 1415, 707, 177, 27, 32, 175, 707, 1408, 1355, 726, 201, 29 ],
|
||||
|
@ -116,7 +84,9 @@ export default function ({ getService, getPageObjects }) {
|
|||
log.debug('count data=' + data);
|
||||
log.debug('data.length=' + data.length);
|
||||
expect(data).to.eql(expectedChartValues[0]);
|
||||
});
|
||||
|
||||
await retry.try(async () => {
|
||||
const avgMemoryData = await PageObjects.visualize.getLineChartData('Average machine.ram', 'ValueAxis-2');
|
||||
log.debug('average memory data=' + avgMemoryData);
|
||||
log.debug('data.length=' + avgMemoryData.length);
|
||||
|
@ -124,69 +94,46 @@ export default function ({ getService, getPageObjects }) {
|
|||
});
|
||||
});
|
||||
|
||||
it('should put secondary axis on the right', function () {
|
||||
pointSeriesVis.getRightValueAxes().then(length => {
|
||||
expect(length).to.be(1);
|
||||
});
|
||||
it('should put secondary axis on the right', async function () {
|
||||
const length = await pointSeriesVis.getRightValueAxes();
|
||||
expect(length).to.be(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('multiple chart types', function () {
|
||||
it('should change average series type to histogram', function () {
|
||||
return pointSeriesVis.toggleCollapsibleTitle('RightAxis-1')
|
||||
.then(function () {
|
||||
return pointSeriesVis.setSeriesType(1, 'bar');
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function checkSeriesTypes() {
|
||||
pointSeriesVis.getHistogramSeries().then(length => {
|
||||
expect(length).to.be(1);
|
||||
});
|
||||
});
|
||||
it('should change average series type to histogram', async function () {
|
||||
await pointSeriesVis.toggleCollapsibleTitle('RightAxis-1');
|
||||
await pointSeriesVis.setSeriesType(1, 'bar');
|
||||
await PageObjects.visualize.clickGo();
|
||||
const length = await pointSeriesVis.getHistogramSeries();
|
||||
expect(length).to.be(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('grid lines', function () {
|
||||
before(function () {
|
||||
return pointSeriesVis.clickOptions();
|
||||
before(async function () {
|
||||
await pointSeriesVis.clickOptions();
|
||||
});
|
||||
|
||||
it('should show category grid lines', function () {
|
||||
return pointSeriesVis.toggleGridCategoryLines()
|
||||
.then(function () {
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return pointSeriesVis.getGridLines();
|
||||
})
|
||||
.then(function checkGridLines(gridLines) {
|
||||
expect(gridLines.length).to.be(9);
|
||||
gridLines.forEach(gridLine => {
|
||||
expect(gridLine.y).to.be(0);
|
||||
});
|
||||
|
||||
});
|
||||
it('should show category grid lines', async function () {
|
||||
await pointSeriesVis.toggleGridCategoryLines();
|
||||
await PageObjects.visualize.clickGo();
|
||||
const gridLines = await pointSeriesVis.getGridLines();
|
||||
expect(gridLines.length).to.be(9);
|
||||
gridLines.forEach(gridLine => {
|
||||
expect(gridLine.y).to.be(0);
|
||||
});
|
||||
});
|
||||
|
||||
it('should show value axis grid lines', function () {
|
||||
return pointSeriesVis.setGridValueAxis('ValueAxis-2')
|
||||
.then(function () {
|
||||
return pointSeriesVis.toggleGridCategoryLines();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return pointSeriesVis.getGridLines();
|
||||
})
|
||||
.then(function checkGridLines(gridLines) {
|
||||
expect(gridLines.length).to.be(9);
|
||||
gridLines.forEach(gridLine => {
|
||||
expect(gridLine.x).to.be(0);
|
||||
});
|
||||
});
|
||||
it('should show value axis grid lines', async function () {
|
||||
await pointSeriesVis.setGridValueAxis('ValueAxis-2');
|
||||
await pointSeriesVis.toggleGridCategoryLines();
|
||||
await PageObjects.visualize.clickGo();
|
||||
const gridLines = await pointSeriesVis.getGridLines();
|
||||
expect(gridLines.length).to.be(9);
|
||||
gridLines.forEach(gridLine => {
|
||||
expect(gridLine.x).to.be(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -22,48 +22,29 @@ import expect from 'expect.js';
|
|||
|
||||
export default function ({ getService, getPageObjects }) {
|
||||
|
||||
|
||||
describe('visualize app', function describeIndexTests() {
|
||||
|
||||
describe('vector map', function () {
|
||||
const fromTime = '2015-09-19 06:31:44.000';
|
||||
const toTime = '2015-09-23 18:31:44.000';
|
||||
|
||||
const log = getService('log');
|
||||
const PageObjects = getPageObjects(['common', 'visualize', 'header', 'settings']);
|
||||
|
||||
before(function () {
|
||||
before(async function () {
|
||||
|
||||
log.debug('navigateToApp visualize');
|
||||
return PageObjects.common.navigateToUrl('visualize', 'new')
|
||||
.then(function () {
|
||||
log.debug('clickRegionMap');
|
||||
return PageObjects.visualize.clickRegionMap();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.visualize.clickNewSearch();
|
||||
})
|
||||
.then(function () {
|
||||
log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
})
|
||||
.then(function clickBucket() {
|
||||
log.debug('Bucket = shape field');
|
||||
return PageObjects.visualize.clickBucket('shape field');
|
||||
})
|
||||
.then(function selectAggregation() {
|
||||
log.debug('Aggregation = Terms');
|
||||
return PageObjects.visualize.selectAggregation('Terms');
|
||||
})
|
||||
.then(function selectField() {
|
||||
log.debug('Field = geo.src');
|
||||
return PageObjects.visualize.selectField('geo.src');
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.header.waitUntilLoadingHasFinished();
|
||||
});
|
||||
await PageObjects.common.navigateToUrl('visualize', 'new');
|
||||
log.debug('clickRegionMap');
|
||||
await PageObjects.visualize.clickRegionMap();
|
||||
await PageObjects.visualize.clickNewSearch();
|
||||
log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
await PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
log.debug('Bucket = shape field');
|
||||
await PageObjects.visualize.clickBucket('shape field');
|
||||
log.debug('Aggregation = Terms');
|
||||
await PageObjects.visualize.selectAggregation('Terms');
|
||||
log.debug('Field = geo.src');
|
||||
await PageObjects.visualize.selectField('geo.src');
|
||||
await PageObjects.visualize.clickGo();
|
||||
});
|
||||
|
||||
describe('vector map', function indexPatternCreation() {
|
||||
|
|
|
@ -24,29 +24,23 @@ export default function ({ getService, getPageObjects }) {
|
|||
const retry = getService('retry');
|
||||
const PageObjects = getPageObjects(['common', 'visualize']);
|
||||
|
||||
describe('visualize app', function describeIndexTests() {
|
||||
|
||||
before(function () {
|
||||
describe('data-shared-item', function indexPatternCreation() {
|
||||
before(async function () {
|
||||
log.debug('navigateToApp visualize');
|
||||
return PageObjects.common.navigateToApp('visualize');
|
||||
await PageObjects.common.navigateToApp('visualize');
|
||||
});
|
||||
|
||||
describe('data-shared-item', function indexPatternCreation() {
|
||||
it('should have the correct data-shared-item title and description', async function () {
|
||||
const expected = {
|
||||
title: 'Shared-Item Visualization AreaChart',
|
||||
description: 'AreaChart'
|
||||
};
|
||||
|
||||
it('should have the correct data-shared-item title and description', function () {
|
||||
const expected = {
|
||||
title: 'Shared-Item Visualization AreaChart',
|
||||
description: 'AreaChart'
|
||||
};
|
||||
|
||||
return PageObjects.visualize.clickVisualizationByName('Shared-Item Visualization AreaChart')
|
||||
.then(() => retry.try(function () {
|
||||
return PageObjects.common.getSharedItemTitleAndDescription()
|
||||
.then(({ title, description }) => {
|
||||
expect(title).to.eql(expected.title);
|
||||
expect(description).to.eql(expected.description);
|
||||
});
|
||||
}));
|
||||
await PageObjects.visualize.clickVisualizationByName('Shared-Item Visualization AreaChart');
|
||||
await retry.try(async function () {
|
||||
const { title, description } = await PageObjects.common.getSharedItemTitleAndDescription();
|
||||
expect(title).to.eql(expected.title);
|
||||
expect(description).to.eql(expected.description);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -27,191 +27,151 @@ export default function ({ getService, getPageObjects }) {
|
|||
const find = getService('find');
|
||||
const PageObjects = getPageObjects(['common', 'visualize', 'header', 'settings']);
|
||||
|
||||
describe('visualize app', function () {
|
||||
describe('tag cloud chart', function () {
|
||||
const vizName1 = 'Visualization tagCloud';
|
||||
const fromTime = '2015-09-19 06:31:44.000';
|
||||
const toTime = '2015-09-23 18:31:44.000';
|
||||
const termsField = 'machine.ram';
|
||||
|
||||
before(function () {
|
||||
|
||||
before(async function () {
|
||||
log.debug('navigateToApp visualize');
|
||||
return PageObjects.common.navigateToUrl('visualize', 'new')
|
||||
.then(function () {
|
||||
log.debug('clickTagCloud');
|
||||
return PageObjects.visualize.clickTagCloud();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.visualize.clickNewSearch();
|
||||
})
|
||||
.then(function () {
|
||||
log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
})
|
||||
.then(function () {
|
||||
log.debug('select Tags');
|
||||
return PageObjects.visualize.clickBucket('Tags');
|
||||
})
|
||||
.then(function () {
|
||||
log.debug('Click aggregation Terms');
|
||||
return PageObjects.visualize.selectAggregation('Terms');
|
||||
})
|
||||
.then(function () {
|
||||
log.debug('Click field machine.ram');
|
||||
return retry.try(function tryingForTime() {
|
||||
return PageObjects.visualize.selectField(termsField);
|
||||
});
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.visualize.selectOrderBy('_key');
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await PageObjects.common.navigateToUrl('visualize', 'new');
|
||||
log.debug('clickTagCloud');
|
||||
await PageObjects.visualize.clickTagCloud();
|
||||
await PageObjects.visualize.clickNewSearch();
|
||||
log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
await PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
log.debug('select Tags');
|
||||
await PageObjects.visualize.clickBucket('Tags');
|
||||
log.debug('Click aggregation Terms');
|
||||
await PageObjects.visualize.selectAggregation('Terms');
|
||||
log.debug('Click field machine.ram');
|
||||
await retry.try(async function tryingForTime() {
|
||||
await PageObjects.visualize.selectField(termsField);
|
||||
});
|
||||
await PageObjects.visualize.selectOrderBy('_key');
|
||||
await PageObjects.visualize.clickGo();
|
||||
});
|
||||
|
||||
|
||||
it('should have inspector enabled', async function () {
|
||||
const spyToggleExists = await PageObjects.visualize.isInspectorButtonEnabled();
|
||||
expect(spyToggleExists).to.be(true);
|
||||
});
|
||||
|
||||
it('should show correct tag cloud data', async function () {
|
||||
const data = await PageObjects.visualize.getTextTag();
|
||||
log.debug(data);
|
||||
expect(data).to.eql([ '32,212,254,720', '21,474,836,480', '20,401,094,656', '19,327,352,832', '18,253,611,008' ]);
|
||||
});
|
||||
|
||||
it('should collapse the sidebar', async function () {
|
||||
const editorSidebar = await find.byCssSelector('.collapsible-sidebar');
|
||||
await PageObjects.visualize.clickEditorSidebarCollapse();
|
||||
// Give d3 tag cloud some time to rearrange tags
|
||||
await PageObjects.common.sleep(1000);
|
||||
const afterSize = await editorSidebar.getSize();
|
||||
expect(afterSize.width).to.be(0);
|
||||
await PageObjects.visualize.clickEditorSidebarCollapse();
|
||||
});
|
||||
|
||||
|
||||
it('should still show all tags after sidebar has been collapsed', async function () {
|
||||
await PageObjects.visualize.clickEditorSidebarCollapse();
|
||||
// Give d3 tag cloud some time to rearrange tags
|
||||
await PageObjects.common.sleep(1000);
|
||||
await PageObjects.visualize.clickEditorSidebarCollapse();
|
||||
// Give d3 tag cloud some time to rearrange tags
|
||||
await PageObjects.common.sleep(1000);
|
||||
const data = await PageObjects.visualize.getTextTag();
|
||||
log.debug(data);
|
||||
expect(data).to.eql(['32,212,254,720', '21,474,836,480', '20,401,094,656', '19,327,352,832', '18,253,611,008']);
|
||||
});
|
||||
|
||||
it('should still show all tags after browser was resized very small', async function () {
|
||||
await remote.setWindowSize(200, 200);
|
||||
await PageObjects.common.sleep(1000);
|
||||
await remote.setWindowSize(1200, 800);
|
||||
await PageObjects.common.sleep(1000);
|
||||
const data = await PageObjects.visualize.getTextTag();
|
||||
expect(data).to.eql([ '32,212,254,720', '21,474,836,480', '20,401,094,656', '19,327,352,832', '18,253,611,008' ]);
|
||||
});
|
||||
|
||||
it('should save and load', async function () {
|
||||
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();
|
||||
});
|
||||
|
||||
|
||||
|
||||
it('should show the tags and relative size', function () {
|
||||
return PageObjects.visualize.getTextSizes()
|
||||
.then(function (results) {
|
||||
log.debug('results here ' + results);
|
||||
expect(results).to.eql(['72px', '63px', '25px', '32px', '18px' ]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('tag cloud chart', function () {
|
||||
const vizName1 = 'Visualization tagCloud';
|
||||
|
||||
it('should have inspector enabled', async function () {
|
||||
const spyToggleExists = await PageObjects.visualize.isInspectorButtonEnabled();
|
||||
expect(spyToggleExists).to.be(true);
|
||||
it('should show correct data', async function () {
|
||||
const expectedTableData = [
|
||||
[ '32,212,254,720', '737' ],
|
||||
[ '21,474,836,480', '728' ],
|
||||
[ '20,401,094,656', '687' ],
|
||||
[ '19,327,352,832', '695' ],
|
||||
[ '18,253,611,008', '679' ]
|
||||
];
|
||||
|
||||
await PageObjects.visualize.openInspector();
|
||||
await await PageObjects.visualize.setInspectorTablePageSize('50');
|
||||
const data = await PageObjects.visualize.getInspectorTableData();
|
||||
log.debug(data);
|
||||
expect(data).to.eql(expectedTableData);
|
||||
});
|
||||
|
||||
describe('formatted field', function () {
|
||||
before(async function () {
|
||||
await PageObjects.settings.navigateTo();
|
||||
await PageObjects.settings.clickKibanaIndices();
|
||||
await PageObjects.settings.filterField(termsField);
|
||||
await PageObjects.settings.openControlsByName(termsField);
|
||||
await PageObjects.settings.setFieldFormat('Bytes');
|
||||
await PageObjects.settings.controlChangeSave();
|
||||
await PageObjects.common.navigateToUrl('visualize', 'new');
|
||||
await PageObjects.visualize.loadSavedVisualization(vizName1);
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
await PageObjects.visualize.waitForVisualization();
|
||||
});
|
||||
|
||||
it.skip('should show correct tag cloud data', async function () {
|
||||
after(async function () {
|
||||
await filterBar.removeFilter(termsField);
|
||||
await PageObjects.settings.navigateTo();
|
||||
await PageObjects.settings.clickKibanaIndices();
|
||||
await PageObjects.settings.filterField(termsField);
|
||||
await PageObjects.settings.openControlsByName(termsField);
|
||||
await PageObjects.settings.setFieldFormat('- default - ');
|
||||
await PageObjects.settings.controlChangeSave();
|
||||
});
|
||||
|
||||
it('should format tags with field formatter', async function () {
|
||||
const data = await PageObjects.visualize.getTextTag();
|
||||
log.debug(data);
|
||||
expect(data).to.eql([ '32,212,254,720', '21,474,836,480', '20,401,094,656', '19,327,352,832', '18,253,611,008' ]);
|
||||
expect(data).to.eql([ '30GB', '20GB', '19GB', '18GB', '17GB' ]);
|
||||
});
|
||||
|
||||
it('should collapse the sidebar', async function () {
|
||||
const editorSidebar = await find.byCssSelector('.collapsible-sidebar');
|
||||
await PageObjects.visualize.clickEditorSidebarCollapse();
|
||||
// Give d3 tag cloud some time to rearrange tags
|
||||
await PageObjects.common.sleep(1000);
|
||||
const afterSize = await editorSidebar.getSize();
|
||||
expect(afterSize.width).to.be(0);
|
||||
await PageObjects.visualize.clickEditorSidebarCollapse();
|
||||
});
|
||||
|
||||
|
||||
it.skip('should still show all tags after sidebar has been collapsed', async function () {
|
||||
await PageObjects.visualize.clickEditorSidebarCollapse();
|
||||
// Give d3 tag cloud some time to rearrange tags
|
||||
await PageObjects.common.sleep(1000);
|
||||
await PageObjects.visualize.clickEditorSidebarCollapse();
|
||||
// Give d3 tag cloud some time to rearrange tags
|
||||
await PageObjects.common.sleep(1000);
|
||||
it('should apply filter with unformatted value', async function () {
|
||||
await PageObjects.visualize.selectTagCloudTag('30GB');
|
||||
await PageObjects.common.sleep(500);
|
||||
const data = await PageObjects.visualize.getTextTag();
|
||||
log.debug(data);
|
||||
expect(data).to.eql(['32,212,254,720', '21,474,836,480', '20,401,094,656', '19,327,352,832', '18,253,611,008']);
|
||||
expect(data).to.eql([ '30GB' ]);
|
||||
});
|
||||
|
||||
it.skip('should still show all tags after browser was resized very small', async function () {
|
||||
await remote.setWindowSize(200, 200);
|
||||
await PageObjects.common.sleep(1000);
|
||||
await remote.setWindowSize(1200, 800);
|
||||
await PageObjects.common.sleep(1000);
|
||||
const data = await PageObjects.visualize.getTextTag();
|
||||
expect(data).to.eql([ '32,212,254,720', '21,474,836,480', '20,401,094,656', '19,327,352,832', '18,253,611,008' ]);
|
||||
});
|
||||
|
||||
it('should save and load', function () {
|
||||
return PageObjects.visualize.saveVisualization(vizName1)
|
||||
.then(() => {
|
||||
return PageObjects.common.getBreadcrumbPageTitle();
|
||||
})
|
||||
.then(pageTitle => {
|
||||
log.debug(`Save viz page title is ${pageTitle}`);
|
||||
expect(pageTitle).to.contain(vizName1);
|
||||
})
|
||||
.then(function testVisualizeWaitForToastMessageGone() {
|
||||
return PageObjects.header.waitForToastMessageGone();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.visualize.loadSavedVisualization(vizName1);
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.header.waitUntilLoadingHasFinished();
|
||||
})
|
||||
.then(function waitForVisualization() {
|
||||
return PageObjects.visualize.waitForVisualization();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
it.skip('should show the tags and relative size', function () {
|
||||
return PageObjects.visualize.getTextSizes()
|
||||
.then(function (results) {
|
||||
log.debug('results here ' + results);
|
||||
expect(results).to.eql(['72px', '63px', '25px', '32px', '18px' ]);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
it.skip('should show correct data', function () {
|
||||
const expectedTableData = [
|
||||
['32,212,254,720', '737'],
|
||||
['21,474,836,480', '728'],
|
||||
['20,401,094,656', '687'],
|
||||
['19,327,352,832', '695'],
|
||||
['18,253,611,008', '679'],
|
||||
];
|
||||
|
||||
return PageObjects.visualize.openInspector()
|
||||
.then(function () {
|
||||
return PageObjects.visualize.setInspectorTablePageSize(50);
|
||||
})
|
||||
.then(function getInspectorTableData() {
|
||||
return PageObjects.visualize.getInspectorTableData();
|
||||
})
|
||||
.then(function showData(data) {
|
||||
log.debug(data);
|
||||
expect(data).to.eql(expectedTableData);
|
||||
});
|
||||
});
|
||||
|
||||
describe('formatted field', function () {
|
||||
before(async function () {
|
||||
await PageObjects.settings.navigateTo();
|
||||
await PageObjects.settings.clickKibanaIndices();
|
||||
await PageObjects.settings.filterField(termsField);
|
||||
await PageObjects.settings.openControlsByName(termsField);
|
||||
await PageObjects.settings.setFieldFormat('Bytes');
|
||||
await PageObjects.settings.controlChangeSave();
|
||||
await PageObjects.common.navigateToUrl('visualize', 'new');
|
||||
await PageObjects.visualize.loadSavedVisualization(vizName1);
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
await PageObjects.visualize.waitForVisualization();
|
||||
});
|
||||
|
||||
after(async function () {
|
||||
await filterBar.removeFilter(termsField);
|
||||
await PageObjects.settings.navigateTo();
|
||||
await PageObjects.settings.clickKibanaIndices();
|
||||
await PageObjects.settings.filterField(termsField);
|
||||
await PageObjects.settings.openControlsByName(termsField);
|
||||
await PageObjects.settings.setFieldFormat('- default - ');
|
||||
await PageObjects.settings.controlChangeSave();
|
||||
});
|
||||
|
||||
it('should format tags with field formatter', async function () {
|
||||
const data = await PageObjects.visualize.getTextTag();
|
||||
log.debug(data);
|
||||
expect(data).to.eql([ '30GB', '20GB', '19GB', '18GB', '17GB' ]);
|
||||
});
|
||||
|
||||
it('should apply filter with unformatted value', async function () {
|
||||
await PageObjects.visualize.selectTagCloudTag('30GB');
|
||||
await PageObjects.common.sleep(500);
|
||||
const data = await PageObjects.visualize.getTextTag();
|
||||
expect(data).to.eql([ '30GB' ]);
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -72,11 +72,10 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
it('should show correct data', async function () {
|
||||
const expectedMetricValue = '157';
|
||||
return PageObjects.visualBuilder.getMetricValue()
|
||||
.then(function (value) {
|
||||
log.debug(`metric value: ${value}`);
|
||||
expect(value).to.eql(expectedMetricValue);
|
||||
});
|
||||
const value = await PageObjects.visualBuilder.getMetricValue();
|
||||
log.debug(`metric value: ${JSON.stringify(value)}`);
|
||||
log.debug(`metric value: ${value}`);
|
||||
expect(value).to.eql(expectedMetricValue);
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -94,11 +93,9 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
it('should show correct data', async function () {
|
||||
const expectedMetricValue = '156';
|
||||
return PageObjects.visualBuilder.getMetricValue()
|
||||
.then(function (value) {
|
||||
log.debug(`metric value: ${value}`);
|
||||
expect(value).to.eql(expectedMetricValue);
|
||||
});
|
||||
const value = await PageObjects.visualBuilder.getMetricValue();
|
||||
log.debug(`metric value: ${value}`);
|
||||
expect(value).to.eql(expectedMetricValue);
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -24,121 +24,85 @@ export default function ({ getService, getPageObjects }) {
|
|||
const retry = getService('retry');
|
||||
const PageObjects = getPageObjects(['common', 'visualize', 'header']);
|
||||
|
||||
describe('visualize app', function describeIndexTests() {
|
||||
describe('vertical bar chart', function () {
|
||||
const fromTime = '2015-09-19 06:31:44.000';
|
||||
const toTime = '2015-09-23 18:31:44.000';
|
||||
const vizName1 = 'Visualization VerticalBarChart';
|
||||
|
||||
const initBarChart = () => {
|
||||
const initBarChart = async () => {
|
||||
log.debug('navigateToApp visualize');
|
||||
return PageObjects.common.navigateToUrl('visualize', 'new')
|
||||
.then(function () {
|
||||
log.debug('clickVerticalBarChart');
|
||||
return PageObjects.visualize.clickVerticalBarChart();
|
||||
})
|
||||
.then(function clickNewSearch() {
|
||||
return PageObjects.visualize.clickNewSearch();
|
||||
})
|
||||
.then(function setAbsoluteRange() {
|
||||
log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
})
|
||||
.then(function clickBucket() {
|
||||
log.debug('Bucket = X-Axis');
|
||||
return PageObjects.visualize.clickBucket('X-Axis');
|
||||
})
|
||||
.then(function selectAggregation() {
|
||||
log.debug('Aggregation = Date Histogram');
|
||||
return PageObjects.visualize.selectAggregation('Date Histogram');
|
||||
})
|
||||
.then(function selectField() {
|
||||
log.debug('Field = @timestamp');
|
||||
return PageObjects.visualize.selectField('@timestamp');
|
||||
})
|
||||
await PageObjects.common.navigateToUrl('visualize', 'new');
|
||||
log.debug('clickVerticalBarChart');
|
||||
await PageObjects.visualize.clickVerticalBarChart();
|
||||
await PageObjects.visualize.clickNewSearch();
|
||||
log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
await PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
log.debug('Bucket = X-Axis');
|
||||
await PageObjects.visualize.clickBucket('X-Axis');
|
||||
log.debug('Aggregation = Date Histogram');
|
||||
await PageObjects.visualize.selectAggregation('Date Histogram');
|
||||
log.debug('Field = @timestamp');
|
||||
await PageObjects.visualize.selectField('@timestamp');
|
||||
// leaving Interval set to Auto
|
||||
.then(function clickGo() {
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.header.waitUntilLoadingHasFinished();
|
||||
})
|
||||
.then(function waitForVisualization() {
|
||||
return PageObjects.visualize.waitForVisualization();
|
||||
});
|
||||
await PageObjects.visualize.clickGo();
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await PageObjects.visualize.waitForVisualization();
|
||||
};
|
||||
|
||||
describe('vertical bar chart', function indexPatternCreation() {
|
||||
const vizName1 = 'Visualization VerticalBarChart';
|
||||
|
||||
before(initBarChart);
|
||||
before(initBarChart);
|
||||
|
||||
it('should save and load', function () {
|
||||
return PageObjects.visualize.saveVisualization(vizName1)
|
||||
.then(() => {
|
||||
return PageObjects.common.getBreadcrumbPageTitle();
|
||||
})
|
||||
.then(pageTitle => {
|
||||
log.debug(`Save viz page title is ${pageTitle}`);
|
||||
expect(pageTitle).to.contain(vizName1);
|
||||
})
|
||||
.then(function testVisualizeWaitForToastMessageGone() {
|
||||
return PageObjects.header.waitForToastMessageGone();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.visualize.loadSavedVisualization(vizName1);
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.header.waitUntilLoadingHasFinished();
|
||||
})
|
||||
.then(function waitForVisualization() {
|
||||
return PageObjects.visualize.waitForVisualization();
|
||||
});
|
||||
it('should save and load', async function () {
|
||||
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.header.waitUntilLoadingHasFinished();
|
||||
await PageObjects.visualize.waitForVisualization();
|
||||
});
|
||||
|
||||
it('should have inspector enabled', async function () {
|
||||
const spyToggleExists = await PageObjects.visualize.isInspectorButtonEnabled();
|
||||
expect(spyToggleExists).to.be(true);
|
||||
});
|
||||
|
||||
it('should show correct chart', async function () {
|
||||
const expectedChartValues = [37, 202, 740, 1437, 1371, 751, 188, 31, 42, 202, 683,
|
||||
1361, 1415, 707, 177, 27, 32, 175, 707, 1408, 1355, 726, 201, 29
|
||||
];
|
||||
|
||||
// Most recent failure on Jenkins usually indicates the bar chart is still being drawn?
|
||||
// return arguments[0].getAttribute(arguments[1]);","args":[{"ELEMENT":"592"},"fill"]}] arguments[0].getAttribute is not a function
|
||||
// try sleeping a bit before getting that data
|
||||
await retry.try(async () => {
|
||||
const data = await PageObjects.visualize.getBarChartData();
|
||||
log.debug('data=' + data);
|
||||
log.debug('data.length=' + data.length);
|
||||
expect(data).to.eql(expectedChartValues);
|
||||
});
|
||||
});
|
||||
|
||||
it('should have inspector enabled', async function () {
|
||||
const spyToggleExists = await PageObjects.visualize.isInspectorButtonEnabled();
|
||||
expect(spyToggleExists).to.be(true);
|
||||
});
|
||||
it('should show correct data', async function () {
|
||||
// this is only the first page of the tabular data.
|
||||
const expectedChartData = [
|
||||
['2015-09-20 00:00', '37'],
|
||||
['2015-09-20 03:00', '202'],
|
||||
['2015-09-20 06:00', '740'],
|
||||
['2015-09-20 09:00', '1,437'],
|
||||
['2015-09-20 12:00', '1,371'],
|
||||
['2015-09-20 15:00', '751'],
|
||||
['2015-09-20 18:00', '188'],
|
||||
['2015-09-20 21:00', '31'],
|
||||
['2015-09-21 00:00', '42'],
|
||||
['2015-09-21 03:00', '202'],
|
||||
];
|
||||
|
||||
it('should show correct chart, take screenshot', async function () {
|
||||
const expectedChartValues = [37, 202, 740, 1437, 1371, 751, 188, 31, 42, 202, 683,
|
||||
1361, 1415, 707, 177, 27, 32, 175, 707, 1408, 1355, 726, 201, 29
|
||||
];
|
||||
|
||||
// Most recent failure on Jenkins usually indicates the bar chart is still being drawn?
|
||||
// return arguments[0].getAttribute(arguments[1]);","args":[{"ELEMENT":"592"},"fill"]}] arguments[0].getAttribute is not a function
|
||||
// try sleeping a bit before getting that data
|
||||
await retry.try(async () => {
|
||||
const data = await PageObjects.visualize.getBarChartData();
|
||||
log.debug('data=' + data);
|
||||
log.debug('data.length=' + data.length);
|
||||
expect(data).to.eql(expectedChartValues);
|
||||
});
|
||||
});
|
||||
|
||||
it('should show correct data', function () {
|
||||
// this is only the first page of the tabular data.
|
||||
const expectedChartData = [
|
||||
['2015-09-20 00:00', '37'],
|
||||
['2015-09-20 03:00', '202'],
|
||||
['2015-09-20 06:00', '740'],
|
||||
['2015-09-20 09:00', '1,437'],
|
||||
['2015-09-20 12:00', '1,371'],
|
||||
['2015-09-20 15:00', '751'],
|
||||
['2015-09-20 18:00', '188'],
|
||||
['2015-09-20 21:00', '31'],
|
||||
['2015-09-21 00:00', '42'],
|
||||
['2015-09-21 03:00', '202'],
|
||||
];
|
||||
|
||||
return PageObjects.visualize.openInspector()
|
||||
.then(function showData() {
|
||||
return PageObjects.visualize.getInspectorTableData();
|
||||
})
|
||||
.then(function showData(data) {
|
||||
log.debug(data);
|
||||
expect(data).to.eql(expectedChartData);
|
||||
});
|
||||
});
|
||||
await PageObjects.visualize.openInspector();
|
||||
const data = await PageObjects.visualize.getInspectorTableData();
|
||||
log.debug(data);
|
||||
expect(data).to.eql(expectedChartData);
|
||||
});
|
||||
|
||||
describe('vertical bar with split series', function () {
|
||||
|
|
Loading…
Reference in a new issue