From b9d626aa70a81c124cd8e75de82e44a3d190df58 Mon Sep 17 00:00:00 2001 From: LeeDr Date: Tue, 19 Jan 2016 10:08:33 -0600 Subject: [PATCH] Fix screenshots Data Table and Tile Map. --- test/functional/apps/visualize/_data_table.js | 19 ++++++++----------- test/functional/apps/visualize/_tile_map.js | 13 +++++-------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/test/functional/apps/visualize/_data_table.js b/test/functional/apps/visualize/_data_table.js index 197b042927a2..72a23b032246 100644 --- a/test/functional/apps/visualize/_data_table.js +++ b/test/functional/apps/visualize/_data_table.js @@ -90,12 +90,10 @@ define(function (require) { bdd.describe('data table', function indexPatternCreation() { + var testSubName = 'DataTable'; + var vizName1 = 'Visualization ' + testSubName; - bdd.it('should be able to save and load, take screenshot', function pageHeader() { - - var testSubName = 'DataTable'; - var vizName1 = 'Visualization ' + testSubName; - + bdd.it('should be able to save and load', function pageHeader() { return visualizePage.saveVisualization(vizName1) .then(function (message) { common.debug('Saved viz message = ' + message); @@ -110,16 +108,11 @@ define(function (require) { .then(function () { return visualizePage.waitForVisualization(); }) - .then(function takeScreenshot() { - common.debug('Take screenshot'); - common.saveScreenshot('./screenshot-' + testSubName + '.png'); - }) .catch(common.handleError(this)); }); - bdd.it('should show correct data', function pageHeader() { - + bdd.it('should show correct data, take screenshot', function pageHeader() { var chartHeight = 0; var expectedChartData = [ '0 2,088', '2,000 2,748', '4,000 2,707', '6,000 2,876', '8,000 2,863', '10,000 147', '12,000 148', '14,000 129', '16,000 161', '18,000 137' @@ -130,6 +123,10 @@ define(function (require) { common.debug(data.split('\n')); expect(data.split('\n')).to.eql(expectedChartData); }) + .then(function takeScreenshot() { + common.debug('Take screenshot'); + common.saveScreenshot('./screenshot-' + testSubName + '.png'); + }) .catch(common.handleError(this)); }); diff --git a/test/functional/apps/visualize/_tile_map.js b/test/functional/apps/visualize/_tile_map.js index 50e9b5bd7965..c913da29f724 100644 --- a/test/functional/apps/visualize/_tile_map.js +++ b/test/functional/apps/visualize/_tile_map.js @@ -87,7 +87,7 @@ define(function (require) { bdd.describe('tile map chart', function indexPatternCreation() { - bdd.it('should save and load, take screenshot', function pageHeader() { + bdd.it('should save and load', function pageHeader() { var testSubName = 'TileMap'; common.debug('Start of test' + testSubName + 'Visualization'); var vizName1 = 'Visualization ' + testSubName; @@ -107,14 +107,10 @@ define(function (require) { .then(function waitForVisualization() { return visualizePage.waitForVisualization(); }) - .then(function takeScreenshot() { - common.debug('Take screenshot'); - common.saveScreenshot('./screenshot-' + testSubName + '.png'); - }) .catch(common.handleError(this)); }); - bdd.it('should show correct tile map data', function pageHeader() { + bdd.it('should show correct tile map data, take screenshot', function pageHeader() { var testSubName = 'TileMap'; common.debug('Start of test' + testSubName + 'Visualization'); // var remote = this.remote; @@ -137,8 +133,9 @@ define(function (require) { expect(data.trim().split('\n')).to.eql(expectedTableData); }); }) - .then(function () { - return visualizePage.collapseChart(); + .then(function takeScreenshot() { + common.debug('Take screenshot'); + common.saveScreenshot('./screenshot-' + testSubName + '.png'); }) .catch(common.handleError(this)); });