From 5a720c9fc9838136b0b1c6ecd9dadc6a6264f08c Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Fri, 23 Dec 2016 15:47:52 -0800 Subject: [PATCH] Fix functional tests for Visualize, to work with new landing page. --- .../kibana/public/visualize/wizard/step_1.html | 2 +- test/functional/apps/visualize/_area_chart.js | 2 +- test/functional/apps/visualize/_chart_types.js | 2 +- test/functional/apps/visualize/_data_table.js | 2 +- test/functional/apps/visualize/_line_chart.js | 2 +- test/functional/apps/visualize/_metric_chart.js | 2 +- test/functional/apps/visualize/_pie_chart.js | 2 +- test/functional/apps/visualize/_tile_map.js | 2 +- .../apps/visualize/_vertical_bar_chart.js | 2 +- test/support/page_objects/common.js | 9 +++++++++ test/support/page_objects/visualize_page.js | 14 ++------------ 11 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/core_plugins/kibana/public/visualize/wizard/step_1.html b/src/core_plugins/kibana/public/visualize/wizard/step_1.html index f4c69bf82cdc7..ce3b562e22eaa 100644 --- a/src/core_plugins/kibana/public/visualize/wizard/step_1.html +++ b/src/core_plugins/kibana/public/visualize/wizard/step_1.html @@ -31,7 +31,7 @@

class="wizard-type-heading-icon fa fa-fw" ng-class="type.icon" > -

{{type.title}}

+

{{type.title}}

{{type.description}}

diff --git a/test/functional/apps/visualize/_area_chart.js b/test/functional/apps/visualize/_area_chart.js index 908462a993bdb..fc84ecb148f96 100644 --- a/test/functional/apps/visualize/_area_chart.js +++ b/test/functional/apps/visualize/_area_chart.js @@ -14,7 +14,7 @@ bdd.describe('visualize app', function describeIndexTests() { const toTime = '2015-09-23 18:31:44.000'; PageObjects.common.debug('navigateToApp visualize'); - return PageObjects.common.navigateToApp('visualize') + return PageObjects.common.navigateToUrl('visualize', 'step/1') .then(function () { PageObjects.common.debug('clickAreaChart'); return PageObjects.visualize.clickAreaChart(); diff --git a/test/functional/apps/visualize/_chart_types.js b/test/functional/apps/visualize/_chart_types.js index 374b53c8f8e62..07b78c50703fd 100644 --- a/test/functional/apps/visualize/_chart_types.js +++ b/test/functional/apps/visualize/_chart_types.js @@ -10,7 +10,7 @@ bdd.describe('visualize app', function describeIndexTests() { bdd.before(function () { PageObjects.common.debug('navigateToApp visualize'); - return PageObjects.common.navigateToApp('visualize'); + return PageObjects.common.navigateToUrl('visualize', 'step/1'); }); bdd.describe('chart types', function indexPatternCreation() { diff --git a/test/functional/apps/visualize/_data_table.js b/test/functional/apps/visualize/_data_table.js index 9d5fbe3c270ba..b8836f7dc2184 100644 --- a/test/functional/apps/visualize/_data_table.js +++ b/test/functional/apps/visualize/_data_table.js @@ -14,7 +14,7 @@ bdd.describe('visualize app', function describeIndexTests() { bdd.before(function () { PageObjects.common.debug('navigateToApp visualize'); - return PageObjects.common.navigateToApp('visualize') + return PageObjects.common.navigateToUrl('visualize', 'step/1') .then(function () { PageObjects.common.debug('clickDataTable'); return PageObjects.visualize.clickDataTable(); diff --git a/test/functional/apps/visualize/_line_chart.js b/test/functional/apps/visualize/_line_chart.js index 34cc5f88672ac..e760f046ce83b 100644 --- a/test/functional/apps/visualize/_line_chart.js +++ b/test/functional/apps/visualize/_line_chart.js @@ -14,7 +14,7 @@ bdd.describe('visualize app', function describeIndexTests() { const toTime = '2015-09-23 18:31:44.000'; PageObjects.common.debug('navigateToApp visualize'); - return PageObjects.common.navigateToApp('visualize') + return PageObjects.common.navigateToUrl('visualize', 'step/1') .then(function () { PageObjects.common.debug('clickLineChart'); return PageObjects.visualize.clickLineChart(); diff --git a/test/functional/apps/visualize/_metric_chart.js b/test/functional/apps/visualize/_metric_chart.js index dc861efb07bda..ab2da7edf0fbc 100644 --- a/test/functional/apps/visualize/_metric_chart.js +++ b/test/functional/apps/visualize/_metric_chart.js @@ -14,7 +14,7 @@ bdd.describe('visualize app', function describeIndexTests() { bdd.before(function () { PageObjects.common.debug('navigateToApp visualize'); - return PageObjects.common.navigateToApp('visualize') + return PageObjects.common.navigateToUrl('visualize', 'step/1') .then(function () { PageObjects.common.debug('clickMetric'); return PageObjects.visualize.clickMetric(); diff --git a/test/functional/apps/visualize/_pie_chart.js b/test/functional/apps/visualize/_pie_chart.js index 5c0770f2e9556..e053bb1f908bc 100644 --- a/test/functional/apps/visualize/_pie_chart.js +++ b/test/functional/apps/visualize/_pie_chart.js @@ -14,7 +14,7 @@ bdd.describe('visualize app', function describeIndexTests() { const toTime = '2015-09-23 18:31:44.000'; PageObjects.common.debug('navigateToApp visualize'); - return PageObjects.common.navigateToApp('visualize') + return PageObjects.common.navigateToUrl('visualize', 'step/1') .then(function () { PageObjects.common.debug('clickPieChart'); return PageObjects.visualize.clickPieChart(); diff --git a/test/functional/apps/visualize/_tile_map.js b/test/functional/apps/visualize/_tile_map.js index e0c61592cc151..2f5cd2f82933d 100644 --- a/test/functional/apps/visualize/_tile_map.js +++ b/test/functional/apps/visualize/_tile_map.js @@ -15,7 +15,7 @@ bdd.describe('visualize app', function describeIndexTests() { bdd.before(function () { PageObjects.common.debug('navigateToApp visualize'); - return PageObjects.common.navigateToApp('visualize') + return PageObjects.common.navigateToUrl('visualize', 'step/1') .then(function () { PageObjects.common.debug('clickTileMap'); return PageObjects.visualize.clickTileMap(); diff --git a/test/functional/apps/visualize/_vertical_bar_chart.js b/test/functional/apps/visualize/_vertical_bar_chart.js index 2b702fa929c4d..c474f20d9d9f5 100644 --- a/test/functional/apps/visualize/_vertical_bar_chart.js +++ b/test/functional/apps/visualize/_vertical_bar_chart.js @@ -14,7 +14,7 @@ bdd.describe('visualize app', function describeIndexTests() { bdd.before(function () { PageObjects.common.debug('navigateToApp visualize'); - return PageObjects.common.navigateToApp('visualize') + return PageObjects.common.navigateToUrl('visualize', 'step/1') .then(function () { PageObjects.common.debug('clickVerticalBarChart'); return PageObjects.visualize.clickVerticalBarChart(); diff --git a/test/support/page_objects/common.js b/test/support/page_objects/common.js index 073c4b0ad979d..287f6ef5e470d 100644 --- a/test/support/page_objects/common.js +++ b/test/support/page_objects/common.js @@ -80,6 +80,15 @@ export default class Common { return getUrl.baseUrl(config.servers.elasticsearch); } + navigateToUrl(appName, subUrl) { + const appConfig = Object.assign({}, config.apps[appName], { + // Overwrite the default hash with the URL we really want. + hash: `${appName}/${subUrl}`, + }); + const appUrl = getUrl.noAuth(config.servers.kibana, appConfig); + return this.remote.get(appUrl); + } + navigateToApp(appName, testStatusPage) { const self = this; const appUrl = getUrl.noAuth(config.servers.kibana, config.apps[appName]); diff --git a/test/support/page_objects/visualize_page.js b/test/support/page_objects/visualize_page.js index 22c7b902c4086..2964c5b36d97c 100644 --- a/test/support/page_objects/visualize_page.js +++ b/test/support/page_objects/visualize_page.js @@ -82,10 +82,7 @@ export default class VisualizePage { } getChartTypes() { - - return this.remote - .setFindTimeout(defaultFindTimeout) - .findAllByCssSelector('.wizard-type-heading h4') + return PageObjects.common.findAllTestSubjects('visualizeWizardChartTypeTitle') .then(function (chartTypes) { function getChartType(chart) { return chart.getVisibleText(); @@ -379,14 +376,7 @@ export default class VisualizePage { // this is for starting on the // bottom half of the "Create a new visualization Step 1" page openSavedVisualization(vizName) { - const self = this; - return self.filterVisByName(vizName) - .then(() => { - return PageObjects.common.sleep(1000); - }) - .then(function clickDashboardByLinkedText() { - return self.clickVisualizationByLinkText(vizName); - }); + return this.clickVisualizationByLinkText(vizName); } getXAxisLabels() {