From e884b0e5a2d4e1f3df912940173ce2d8d4fa5985 Mon Sep 17 00:00:00 2001 From: Bill McConaghy Date: Mon, 23 Jul 2018 21:04:36 -0400 Subject: [PATCH 1/2] fixing flaky management settings test --- test/functional/page_objects/settings_page.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/functional/page_objects/settings_page.js b/test/functional/page_objects/settings_page.js index 163d3e089aa35..f849152dc1e4a 100644 --- a/test/functional/page_objects/settings_page.js +++ b/test/functional/page_objects/settings_page.js @@ -75,8 +75,11 @@ export function SettingsPageProvider({ getService, getPageObjects }) { } async setAdvancedSettingsSelect(propertyName, propertyValue) { - await remote.setFindTimeout(defaultFindTimeout) - .findByCssSelector(`[data-test-subj="advancedSetting-editField-${propertyName}"] option[value="${propertyValue}"]`).click(); + let option; + await retry.try(() => { + option = remote.findByCssSelector(`[data-test-subj="advancedSetting-editField-${propertyName}"] option[value="${propertyValue}"]`); + }); + await option.click(); await PageObjects.header.waitUntilLoadingHasFinished(); await testSubjects.click(`advancedSetting-saveEditField-${propertyName}`); await PageObjects.header.waitUntilLoadingHasFinished(); From dd7ab8ffdbd3ca1dfc5d29f059c3ef5a44ca4391 Mon Sep 17 00:00:00 2001 From: Bill McConaghy Date: Mon, 23 Jul 2018 22:28:17 -0400 Subject: [PATCH 2/2] fix for the fix (awaiting results of find) --- test/functional/page_objects/settings_page.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/functional/page_objects/settings_page.js b/test/functional/page_objects/settings_page.js index f849152dc1e4a..ce42b6e4dff35 100644 --- a/test/functional/page_objects/settings_page.js +++ b/test/functional/page_objects/settings_page.js @@ -76,8 +76,10 @@ export function SettingsPageProvider({ getService, getPageObjects }) { async setAdvancedSettingsSelect(propertyName, propertyValue) { let option; - await retry.try(() => { - option = remote.findByCssSelector(`[data-test-subj="advancedSetting-editField-${propertyName}"] option[value="${propertyValue}"]`); + await retry.try(async () => { + option = await remote.findByCssSelector( + `[data-test-subj="advancedSetting-editField-${propertyName}"] option[value="${propertyValue}"]` + ); }); await option.click(); await PageObjects.header.waitUntilLoadingHasFinished();