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 <ppicka@redhat.com>
This commit is contained in:
Michal Reznik
2018-06-07 12:25:49 +02:00
committed by Michal Reznik (mreznik)
parent f976f6cfd8
commit b1f368c682
2 changed files with 2 additions and 0 deletions

View File

@@ -592,6 +592,7 @@ class test_service(sevice_tasks):
pkey = self.get_service_pkey('smtp') pkey = self.get_service_pkey('smtp')
self.add_service('smtp', confirm=False) self.add_service('smtp', confirm=False)
actions = ActionChains(self.driver) actions = ActionChains(self.driver)
actions.click()
actions.send_keys(Keys.ENTER).perform() actions.send_keys(Keys.ENTER).perform()
self.wait(1) self.wait(1)
assert self.has_record(pkey) assert self.has_record(pkey)

View File

@@ -1699,6 +1699,7 @@ class UI_driver(object):
expand.click() expand.click()
action_link = self.find("li[data-name=%s] a" % name, By.CSS_SELECTOR, action_link = self.find("li[data-name=%s] a" % name, By.CSS_SELECTOR,
context, strict=True) context, strict=True)
self.move_to_element_in_page(action_link)
action_link.click() action_link.click()
if confirm: if confirm:
self.wait(0.5) # wait for dialog self.wait(0.5) # wait for dialog