From b1f368c6829068bd3f5100829f9b36f479cc403c Mon Sep 17 00:00:00 2001 From: Michal Reznik Date: Thu, 7 Jun 2018 12:25:49 +0200 Subject: [PATCH] ui_tests: fixes for issues with sending key and focus on element Fixes 2 issues in WebUI tests. One issue is that we are unable to confirm a dialog by "Enter" keyboard - "actions.click()" helps here to get focus on the page. Second issue is probbaly related to screen resolution as we cannot click to some of the action buttons (buttons which are having issue varies). https://pagure.io/freeipa/issue/7583 Reviewed-By: Pavel Picka --- ipatests/test_webui/test_service.py | 1 + ipatests/test_webui/ui_driver.py | 1 + 2 files changed, 2 insertions(+) diff --git a/ipatests/test_webui/test_service.py b/ipatests/test_webui/test_service.py index 621ebe60c..74cca36be 100644 --- a/ipatests/test_webui/test_service.py +++ b/ipatests/test_webui/test_service.py @@ -592,6 +592,7 @@ class test_service(sevice_tasks): pkey = self.get_service_pkey('smtp') self.add_service('smtp', confirm=False) actions = ActionChains(self.driver) + actions.click() actions.send_keys(Keys.ENTER).perform() self.wait(1) assert self.has_record(pkey) diff --git a/ipatests/test_webui/ui_driver.py b/ipatests/test_webui/ui_driver.py index 6a611f9c0..88774c64f 100644 --- a/ipatests/test_webui/ui_driver.py +++ b/ipatests/test_webui/ui_driver.py @@ -1699,6 +1699,7 @@ class UI_driver(object): expand.click() action_link = self.find("li[data-name=%s] a" % name, By.CSS_SELECTOR, context, strict=True) + self.move_to_element_in_page(action_link) action_link.click() if confirm: self.wait(0.5) # wait for dialog