diff --git a/test/functional/apps/visualize/_area_chart.js b/test/functional/apps/visualize/_area_chart.js index 96b9c27ed651..d7435a3dc8c0 100644 --- a/test/functional/apps/visualize/_area_chart.js +++ b/test/functional/apps/visualize/_area_chart.js @@ -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)); - }); }); }); diff --git a/test/functional/apps/visualize/_line_chart.js b/test/functional/apps/visualize/_line_chart.js index bdf8617241ad..e0e1951d6124 100644 --- a/test/functional/apps/visualize/_line_chart.js +++ b/test/functional/apps/visualize/_line_chart.js @@ -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'); diff --git a/test/functional/apps/visualize/_pie_chart.js b/test/functional/apps/visualize/_pie_chart.js index 710321fbee3f..06877b48d75b 100644 --- a/test/functional/apps/visualize/_pie_chart.js +++ b/test/functional/apps/visualize/_pie_chart.js @@ -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'); diff --git a/test/functional/apps/visualize/_tile_map.js b/test/functional/apps/visualize/_tile_map.js index f192bd4c884c..13d81d603a4e 100644 --- a/test/functional/apps/visualize/_tile_map.js +++ b/test/functional/apps/visualize/_tile_map.js @@ -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'); diff --git a/test/functional/apps/visualize/_vertical_bar_chart.js b/test/functional/apps/visualize/_vertical_bar_chart.js index 6f1cbb67cdd5..9953b4fc7ab7 100644 --- a/test/functional/apps/visualize/_vertical_bar_chart.js +++ b/test/functional/apps/visualize/_vertical_bar_chart.js @@ -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'); diff --git a/test/support/pages/HeaderPage.js b/test/support/pages/HeaderPage.js index 7789cbd46734..c1e8767baf56 100644 --- a/test/support/pages/HeaderPage.js +++ b/test/support/pages/HeaderPage.js @@ -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'); - // }); } };