Skip to content

Commit

Permalink
Trying 4 sec sleep before screenshots.
Browse files Browse the repository at this point in the history
Fixes #5932
  • Loading branch information
LeeDr committed Jan 19, 2016
1 parent 4c5f822 commit d41f985
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 46 deletions.
79 changes: 38 additions & 41 deletions test/functional/apps/visualize/_area_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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',
Expand Down Expand Up @@ -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));
});

});
});
Expand Down
3 changes: 3 additions & 0 deletions test/functional/apps/visualize/_line_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
3 changes: 3 additions & 0 deletions test/functional/apps/visualize/_pie_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
3 changes: 3 additions & 0 deletions test/functional/apps/visualize/_tile_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
3 changes: 3 additions & 0 deletions test/functional/apps/visualize/_vertical_bar_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
5 changes: 0 additions & 5 deletions test/support/pages/HeaderPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
// });
}

};
Expand Down

0 comments on commit d41f985

Please sign in to comment.