From 420dd2c72dbc870e4b22c06a6c7a221e10b5642d Mon Sep 17 00:00:00 2001 From: Elastic Jasper Date: Wed, 5 Oct 2016 18:46:13 -0400 Subject: [PATCH] Backport PR #8558 --------- **Commit 1:** remove unused vars do not hardcode css-snippet * Original sha: 56c130aa80a0080934f7379b93df0097b43bd01b * Authored by Thomas Neirynck on 2016-10-05T15:47:05Z --- test/functional/apps/visualize/_line_chart.js | 4 ++-- test/support/page_objects/visualize_page.js | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/test/functional/apps/visualize/_line_chart.js b/test/functional/apps/visualize/_line_chart.js index 29630c39035b9..cc2e1b6d4baf8 100644 --- a/test/functional/apps/visualize/_line_chart.js +++ b/test/functional/apps/visualize/_line_chart.js @@ -62,7 +62,7 @@ bdd.describe('visualize app', function describeIndexTests() { // sleep a bit before trying to get the chart data return PageObjects.common.sleep(3000) .then(function () { - return PageObjects.visualize.getLineChartData('fill="#57c17b"') + return PageObjects.visualize.getLineChartData('fill="#6eadc1"') .then(function showData(data) { PageObjects.common.debug('data=' + data); PageObjects.common.saveScreenshot('Visualize-line-chart'); @@ -92,7 +92,7 @@ bdd.describe('visualize app', function describeIndexTests() { }) .then(function () { return PageObjects.common.try(function () { - return PageObjects.visualize.getLineChartData('fill="#57c17b"') + return PageObjects.visualize.getLineChartData('fill="#6eadc1"') .then(function showData(data) { PageObjects.common.debug('data=' + data); PageObjects.common.saveScreenshot('Visualize-line-chart'); diff --git a/test/support/page_objects/visualize_page.js b/test/support/page_objects/visualize_page.js index 44b6cda612f10..fbffee157d5ff 100644 --- a/test/support/page_objects/visualize_page.js +++ b/test/support/page_objects/visualize_page.js @@ -75,7 +75,7 @@ export default class VisualizePage { } getChartTypes() { - var types = []; + return this.remote .setFindTimeout(defaultFindTimeout) .findAllByCssSelector('.wizard-type-heading h4') @@ -440,7 +440,6 @@ export default class VisualizePage { var chartData = []; var tempArray = []; var chartSections = 0; - var chartMap = {}; var height = 0; var yAxisLabel = 0; var yAxisHeight = 0; @@ -529,7 +528,7 @@ export default class VisualizePage { // 5). for each chart element, find the green circle, then the cy position function getChartType(chart) { return chart - .findByCssSelector('circle[fill="#6eadc1"]') + .findByCssSelector(`circle[${cssPart}]`) .then(function (circleObject) { // PageObjects.common.debug('circleObject = ' + circleObject + ' yAxisHeight= ' + yAxisHeight + ' yAxisLabel= ' + yAxisLabel); return circleObject @@ -619,8 +618,6 @@ export default class VisualizePage { } getPieChartData() { - var self = this.remote; - // 1). get the maximim chart Y-Axis marker value return this.remote .setFindTimeout(defaultFindTimeout * 2)