webui:tests: close big notifications in realm domains tests

Realm domains commands produce big fat warnings about DNS state/checks.
Given the length of these warnings, they stay displayed for longer time.
As Web UI automated tests progresses quickly more of the warnings can
be displayed at the same time and thus taking a lot of space and thus
covering UI needed for next test step.

By closing the notifications before next action we make sure that test
won't fail because notification covered the required UI.

Reviewed-By: Petr Cech <pcech@redhat.com>
This commit is contained in:
Petr Vobornik
2018-02-16 23:54:40 +01:00
committed by Christian Heimes
parent d73d49f3f6
commit 6b214512b3
2 changed files with 18 additions and 0 deletions

View File

@@ -39,6 +39,7 @@ class test_realmdomains(UI_driver):
self.facet_button_click('save')
self.dialog_button_click(button)
self.wait_for_request()
self.close_notifications()
@screenshot
def test_read(self):
@@ -53,6 +54,7 @@ class test_realmdomains(UI_driver):
self.facet_button_click('save')
self.dialog_button_click('force')
self.wait_for_request()
self.close_notifications()
# delete
self.del_realm_domain('itest.bar', 'force')
@@ -78,6 +80,7 @@ class test_realmdomains(UI_driver):
# remove the added domain from Realm Domain
self.navigate_to_entity(ENTITY)
self.del_realm_domain(realmdomain, 'ok')
self.close_notifications()
# re-add _TXT kerberos.$domain "$REALM"
self.navigate_to_entity(ZONE_ENTITY)

View File

@@ -711,6 +711,21 @@ class UI_driver(object):
# possible dialog transition effect
self.wait(0.5)
def close_notifications(self):
"""
Close all notifications like success messages, warnings, infos
"""
self.wait()
while True:
# get close button of notification
s = ".notification-area .alert button"
button = self.find(s, By.CSS_SELECTOR, strict=False)
if button:
button.click()
self.wait()
else:
break
def get_form(self):
"""
Get last dialog or visible facet