parent
4c5f822429
commit
d41f985f53
6 changed files with 50 additions and 46 deletions
|
@ -119,7 +119,7 @@ define(function (require) {
|
|||
return headerPage.getSpinnerDone();
|
||||
})
|
||||
.then(function sleep() {
|
||||
return common.sleep(10000);
|
||||
return common.sleep(4000);
|
||||
})
|
||||
.then(function takeScreenshot() {
|
||||
common.debug('Take screenshot');
|
||||
|
@ -129,6 +129,43 @@ define(function (require) {
|
|||
});
|
||||
|
||||
|
||||
|
||||
bdd.it('should show correct chart', function pageHeader() {
|
||||
|
||||
var chartHeight = 0;
|
||||
var xAxisLabels = [ '2015-09-20 00:00', '2015-09-21 00:00',
|
||||
'2015-09-22 00:00', '2015-09-23 00:00'
|
||||
];
|
||||
var yAxisLabels = ['0','200','400','600','800','1,000','1,200','1,400','1,600'];
|
||||
var 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 visualizePage.getXAxisLabels()
|
||||
.then(function (labels) {
|
||||
common.debug('X-Axis labels = ' + labels);
|
||||
expect(labels).to.eql(xAxisLabels);
|
||||
})
|
||||
.then(function getYAxisLabels() {
|
||||
return visualizePage.getYAxisLabels();
|
||||
})
|
||||
.then(function (labels) {
|
||||
common.debug('Y-Axis labels = ' + labels);
|
||||
expect(labels).to.eql(yAxisLabels);
|
||||
})
|
||||
.then(function getAreaChartData() {
|
||||
//return common.tryForTime(500, function () {
|
||||
return visualizePage.getAreaChartData();
|
||||
})
|
||||
.then(function (paths) {
|
||||
common.debug('expectedAreaChartData = ' + expectedAreaChartData);
|
||||
common.debug('actual chart data = ' + paths);
|
||||
expect(paths).to.eql(expectedAreaChartData);
|
||||
})
|
||||
.catch(common.handleError(this));
|
||||
});
|
||||
|
||||
|
||||
bdd.it('should show correct data', function pageHeader() {
|
||||
|
||||
var expectedTableData = [ 'September 20th 2015, 00:00:00.000 37',
|
||||
|
@ -168,50 +205,10 @@ define(function (require) {
|
|||
common.debug('getDataTableData = ' + data.split('\n'));
|
||||
expect(data.trim().split('\n')).to.eql(expectedTableData);
|
||||
})
|
||||
.then(function collapseChart() {
|
||||
return visualizePage.collapseChart();
|
||||
})
|
||||
.then(function sleep() {
|
||||
return common.sleep(2000);
|
||||
})
|
||||
.catch(common.handleError(this));
|
||||
});
|
||||
|
||||
|
||||
bdd.it('should show correct chart', function pageHeader() {
|
||||
|
||||
var chartHeight = 0;
|
||||
var xAxisLabels = [ '2015-09-20 00:00', '2015-09-21 00:00',
|
||||
'2015-09-22 00:00', '2015-09-23 00:00'
|
||||
];
|
||||
var yAxisLabels = ['0','200','400','600','800','1,000','1,200','1,400','1,600'];
|
||||
var 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 visualizePage.getXAxisLabels()
|
||||
.then(function (labels) {
|
||||
common.debug('X-Axis labels = ' + labels);
|
||||
expect(labels).to.eql(xAxisLabels);
|
||||
})
|
||||
.then(function getYAxisLabels() {
|
||||
return visualizePage.getYAxisLabels();
|
||||
})
|
||||
.then(function (labels) {
|
||||
common.debug('Y-Axis labels = ' + labels);
|
||||
expect(labels).to.eql(yAxisLabels);
|
||||
})
|
||||
.then(function getAreaChartData() {
|
||||
//return common.tryForTime(500, function () {
|
||||
return visualizePage.getAreaChartData();
|
||||
})
|
||||
.then(function (paths) {
|
||||
common.debug('expectedAreaChartData = ' + expectedAreaChartData);
|
||||
common.debug('actual chart data = ' + paths);
|
||||
expect(paths).to.eql(expectedAreaChartData);
|
||||
})
|
||||
.catch(common.handleError(this));
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
@ -104,6 +104,9 @@ define(function (require) {
|
|||
.then(function () {
|
||||
return visualizePage.loadSavedVisualization(vizName1);
|
||||
})
|
||||
.then(function sleep() {
|
||||
return common.sleep(4000);
|
||||
})
|
||||
.then(function takeScreenshot() {
|
||||
// take a snapshot just as an example.
|
||||
common.debug('Take screenshot');
|
||||
|
|
|
@ -111,6 +111,9 @@ define(function (require) {
|
|||
.then(function () {
|
||||
return visualizePage.loadSavedVisualization(vizName1);
|
||||
})
|
||||
.then(function sleep() {
|
||||
return common.sleep(4000);
|
||||
})
|
||||
.then(function takeScreenshot() {
|
||||
common.debug('Take screenshot');
|
||||
common.saveScreenshot('./screenshot-' + testSubName + '.png');
|
||||
|
|
|
@ -104,6 +104,9 @@ define(function (require) {
|
|||
.then(function () {
|
||||
return visualizePage.loadSavedVisualization(vizName1);
|
||||
})
|
||||
.then(function sleep() {
|
||||
return common.sleep(4000);
|
||||
})
|
||||
.then(function takeScreenshot() {
|
||||
common.debug('Take screenshot');
|
||||
common.saveScreenshot('./screenshot-' + testSubName + '.png');
|
||||
|
|
|
@ -109,6 +109,9 @@ define(function (require) {
|
|||
.then(function () {
|
||||
return headerPage.getSpinnerDone(); // only matches the hidden spinner
|
||||
})
|
||||
.then(function sleep() {
|
||||
return common.sleep(4000);
|
||||
})
|
||||
.then(function takeScreenshot() {
|
||||
common.debug('Take screenshot');
|
||||
common.saveScreenshot('./screenshot-' + testSubName + '.png');
|
||||
|
|
|
@ -142,11 +142,6 @@ define(function (require) {
|
|||
return this.remote
|
||||
.setFindTimeout(defaultTimeout * 10)
|
||||
.findByCssSelector('span.spinner.ng-hide');
|
||||
// .then(function () {
|
||||
// return self.remote
|
||||
// .setFindTimeout(defaultTimeout * 10)
|
||||
// .findByCssSelector('div.spinner.large.ng-hide');
|
||||
// });
|
||||
}
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue