mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Add missing Dashboard test files.
This commit is contained in:
parent
988be91266
commit
1333cbe6ff
2 changed files with 151 additions and 0 deletions
138
test/functional/apps/dashboard/_dashboard.js
Normal file
138
test/functional/apps/dashboard/_dashboard.js
Normal file
|
@ -0,0 +1,138 @@
|
|||
import {
|
||||
bdd,
|
||||
common,
|
||||
dashboardPage,
|
||||
headerPage,
|
||||
scenarioManager
|
||||
} from '../../../support';
|
||||
|
||||
(function () {
|
||||
var expect = require('expect.js');
|
||||
|
||||
(function () {
|
||||
bdd.describe('discover tab', function describeIndexTests() {
|
||||
|
||||
bdd.before(function () {
|
||||
|
||||
var fromTime = '2015-09-19 06:31:44.000';
|
||||
var toTime = '2015-09-23 18:31:44.000';
|
||||
|
||||
common.debug('Starting dashboard before method');
|
||||
common.debug('navigateToApp dashboard');
|
||||
return scenarioManager.unload('emptyKibana')
|
||||
.then(function () {
|
||||
return common.try(function () {
|
||||
return scenarioManager.updateConfigDoc({'dateFormat:tz':'UTC', 'defaultIndex':'logstash-*'});
|
||||
});
|
||||
})
|
||||
// and load a set of makelogs data
|
||||
.then(function loadkibana4() {
|
||||
common.debug('load kibana index with visualizations');
|
||||
return common.elasticLoad('kibana4.json','.kibana');
|
||||
})
|
||||
.then(function () {
|
||||
return scenarioManager.loadIfEmpty('logstashFunctional');
|
||||
})
|
||||
.then(function () {
|
||||
return common.navigateToApp('dashboard');
|
||||
})
|
||||
.catch(common.handleError(this));
|
||||
});
|
||||
|
||||
|
||||
bdd.describe('add visualizations to dashboard', function dashboardTest() {
|
||||
var visualizations = ['Visualization漢字 AreaChart',
|
||||
'Visualization☺漢字 DataTable',
|
||||
'Visualization漢字 LineChart',
|
||||
'Visualization PieChart',
|
||||
'Visualization TileMap',
|
||||
'Visualization☺ VerticalBarChart',
|
||||
'Visualization MetricChart'
|
||||
];
|
||||
|
||||
|
||||
bdd.it('should be able to add visualizations to dashboard', function addVisualizations() {
|
||||
|
||||
function addVisualizations(arr) {
|
||||
return arr.reduce(function (promise, vizName) {
|
||||
return promise
|
||||
.then(function () {
|
||||
return dashboardPage.addVisualization(vizName);
|
||||
});
|
||||
}, Promise.resolve());
|
||||
}
|
||||
|
||||
return addVisualizations(visualizations)
|
||||
.then(function () {
|
||||
console.log('all done');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
bdd.it('set the timepicker time to that which contains our test data', function setTimepicker() {
|
||||
var fromTime = '2015-09-19 06:31:44.000';
|
||||
var toTime = '2015-09-23 18:31:44.000';
|
||||
var testSubName = 'Dashboard Test 1';
|
||||
|
||||
// .then(function () {
|
||||
common.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return headerPage.setAbsoluteRange(fromTime, toTime)
|
||||
.then(function sleep() {
|
||||
return common.sleep(4000);
|
||||
})
|
||||
.then(function takeScreenshot() {
|
||||
common.debug('Take screenshot');
|
||||
common.saveScreenshot('./screenshot-' + testSubName + '.png');
|
||||
})
|
||||
.catch(common.handleError(this));
|
||||
});
|
||||
|
||||
bdd.it('should save and load dashboard', function saveAndLoadDashboard() {
|
||||
var testSubName = 'Dashboard Test 1';
|
||||
// save time on the dashboard?
|
||||
return dashboardPage.saveDashboard(testSubName)
|
||||
// click New Dashboard just to clear the one we just created
|
||||
.then(function () {
|
||||
return dashboardPage.clickNewDashboard();
|
||||
})
|
||||
.then(function () {
|
||||
return dashboardPage.loadSavedDashboard(testSubName);
|
||||
})
|
||||
.catch(common.handleError(this));
|
||||
});
|
||||
|
||||
bdd.it('should have all the expected visualizations', function checkVisualizations() {
|
||||
return common.tryForTime(10000, function () {
|
||||
return dashboardPage.getPanelTitles()
|
||||
.then(function (panelTitles) {
|
||||
common.log('visualization titles = ' + panelTitles);
|
||||
expect(panelTitles).to.eql(visualizations);
|
||||
});
|
||||
})
|
||||
.catch(common.handleError(this));
|
||||
});
|
||||
|
||||
bdd.it('should have all the expected initial sizes', function checkVisualizationSizes() {
|
||||
var visObjects = [ { dataCol: '1', dataRow: '1', dataSizeX: '3', dataSizeY: '2', title: 'Visualization漢字 AreaChart' },
|
||||
{ dataCol: '4', dataRow: '1', dataSizeX: '3', dataSizeY: '2', title: 'Visualization☺漢字 DataTable' },
|
||||
{ dataCol: '7', dataRow: '1', dataSizeX: '3', dataSizeY: '2', title: 'Visualization漢字 LineChart' },
|
||||
{ dataCol: '10', dataRow: '1', dataSizeX: '3', dataSizeY: '2', title: 'Visualization PieChart' },
|
||||
{ dataCol: '1', dataRow: '3', dataSizeX: '3', dataSizeY: '2', title: 'Visualization TileMap' },
|
||||
{ dataCol: '4', dataRow: '3', dataSizeX: '3', dataSizeY: '2', title: 'Visualization☺ VerticalBarChart' },
|
||||
{ dataCol: '7', dataRow: '3', dataSizeX: '3', dataSizeY: '2', title: 'Visualization MetricChart' }
|
||||
];
|
||||
return common.tryForTime(10000, function () {
|
||||
return dashboardPage.getPanelData()
|
||||
.then(function (panelTitles) {
|
||||
common.log('visualization titles = ' + panelTitles);
|
||||
expect(panelTitles).to.eql(visObjects);
|
||||
});
|
||||
})
|
||||
.catch(common.handleError(this));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
}());
|
||||
}());
|
13
test/functional/apps/dashboard/index.js
Normal file
13
test/functional/apps/dashboard/index.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
import { bdd, remote, scenarioManager, defaultTimeout } from '../../../support';
|
||||
|
||||
(function () {
|
||||
bdd.describe('dashboard app', function () {
|
||||
this.timeout = defaultTimeout;
|
||||
|
||||
bdd.before(function () {
|
||||
return remote.setWindowSize(1200,800);
|
||||
});
|
||||
|
||||
require('./_dashboard');
|
||||
});
|
||||
}());
|
Loading…
Add table
Add a link
Reference in a new issue