From bf1f2d1c3f16cea1800e773cbf7e8e59203bbbde Mon Sep 17 00:00:00 2001 From: Michal Reznik Date: Tue, 13 Mar 2018 22:14:49 +0100 Subject: [PATCH] ui_tests: select_combobox() fixes Move strict "search_btn" element finding to later so we do not fail when using combobox without search button. Also switch open_btn.click() before fill_textbox() as it is used to close the selection. https://pagure.io/freeipa/issue/7441 Reviewed-By: Petr Vobornik --- ipatests/test_webui/ui_driver.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ipatests/test_webui/ui_driver.py b/ipatests/test_webui/ui_driver.py index 570f09231..6b42218be 100644 --- a/ipatests/test_webui/ui_driver.py +++ b/ipatests/test_webui/ui_driver.py @@ -872,19 +872,19 @@ class UI_driver(object): self.wait_for_request() list_cnt = self.find('.combobox-widget-list', By.CSS_SELECTOR, cb, strict=True) - search_btn = self.find('a[name=search] i', By.CSS_SELECTOR, cb, strict=True) opt_s = "select[name=list] option[value='%s']" % value option = self.find(opt_s, By.CSS_SELECTOR, cb) if combobox_input: if not option: - self.fill_textbox(combobox_input, value, cb) open_btn.click() + self.fill_textbox(combobox_input, value, cb) else: if not option: # try to search self.fill_textbox('filter', value, cb) - + search_btn = self.find('a[name=search] i', By.CSS_SELECTOR, cb, + strict=True) search_btn.click() self.wait_for_request() option = self.find(opt_s, By.CSS_SELECTOR, cb, strict=True)