From 41b6f06a1c770819930238f2d2eba4bb19d4b53f Mon Sep 17 00:00:00 2001 From: Stacey Gammon Date: Thu, 31 Aug 2017 09:47:09 -0400 Subject: [PATCH] Investigate flaky add new visualization link test (#13755) (#13776) --- .../public/visualize/editor/panels/save.html | 1 + test/functional/page_objects/header_page.js | 4 +++- test/functional/page_objects/visualize_page.js | 17 +++++++++++++---- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/core_plugins/kibana/public/visualize/editor/panels/save.html b/src/core_plugins/kibana/public/visualize/editor/panels/save.html index d525912215d74..48dc4102b18b3 100644 --- a/src/core_plugins/kibana/public/visualize/editor/panels/save.html +++ b/src/core_plugins/kibana/public/visualize/editor/panels/save.html @@ -7,6 +7,7 @@ class="kuiLocalDropdownInput" input-focus="select" type="text" + data-test-subj="visTitleInput" name="visTitle" ng-model="opts.savedVis.title" required diff --git a/test/functional/page_objects/header_page.js b/test/functional/page_objects/header_page.js index e66666749ed05..3a87673aab4e5 100644 --- a/test/functional/page_objects/header_page.js +++ b/test/functional/page_objects/header_page.js @@ -170,7 +170,9 @@ export function HeaderPageProvider({ getService, getPageObjects }) { async getToastMessage(findTimeout = defaultFindTimeout) { const toastMessage = await find.displayedByCssSelector('kbn-truncated.toast-message.ng-isolate-scope', findTimeout); - return toastMessage.getVisibleText(); + const messageText = await toastMessage.getVisibleText(); + log.debug(`getToastMessage: ${messageText}`); + return messageText; } async waitForToastMessageGone() { diff --git a/test/functional/page_objects/visualize_page.js b/test/functional/page_objects/visualize_page.js index e2a623888bf0a..c391a0cba1620 100644 --- a/test/functional/page_objects/visualize_page.js +++ b/test/functional/page_objects/visualize_page.js @@ -307,11 +307,20 @@ export function VisualizePageProvider({ getService, getPageObjects }) { await find.clickByCssSelector('input[name="wms.enabled"]'); } + async ensureSavePanelOpen() { + log.debug('ensureSavePanelOpen'); + let isOpen = await testSubjects.exists('saveVisualizationButton'); + await retry.try(async () => { + while (!isOpen) { + await testSubjects.click('visualizeSaveButton'); + isOpen = await testSubjects.exists('saveVisualizationButton'); + } + }); + } + async saveVisualization(vizName) { - await testSubjects.click('visualizeSaveButton'); - log.debug('saveButton button clicked'); - const visTitle = await find.byName('visTitle'); - await visTitle.type(vizName); + await this.ensureSavePanelOpen(); + await testSubjects.setValue('visTitleInput', vizName); log.debug('click submit button'); await testSubjects.click('saveVisualizationButton'); await PageObjects.header.waitUntilLoadingHasFinished();