webui tests: fix test_host:test_crud failure

test_host.py::test_host::test_crud fails in nightly tests in delete record
step.

It started to fail probably after commit 4295df17a4
which changed host-add behavior into showing a warning message about DNS resolution
instead of raising an error. This warning notification stays displayed for some
time, as all longer, notifications. By being open it takes some area on the page.
Given that webui tests proceeds quicker than a user, the notification can
cover some elements.

The test fails because web driver cannot click on an element which is covered
by the notification. In this case, it cannot open a deleter dialog.

So the fix is to close the notification(s). This is OK since a user would do
it as well if it was in a way.

This kind of issue is harder to reproduce when testing locally because
most people uses screen resolution 1920x1200 or full HD. PR-CI uses
1400x1200 for web ui testing.
  /usr/bin/Xvfb $DISPLAY -ac -noreset -screen 0 1400x1200x8

So alternative fix would be to change resolution used by the PR-CI. Combination
of both could be the best.

https://pagure.io/freeipa/issue/7468

Reviewed-By: Felipe Volpone <fbarreto@redhat.com>
This commit is contained in:
Petr Vobornik 2018-03-24 22:13:49 +01:00 committed by Christian Heimes
parent 34d06b2be7
commit 70c6da9c54

View File

@ -1379,6 +1379,8 @@ class UI_driver(object):
dialog_btn=add_dialog_btn
)
self.close_notifications()
# Find
self.find_record(parent_entity, data, search_facet)
@ -1397,6 +1399,8 @@ class UI_driver(object):
self.mod_record(entity, data, details_facet, update_btn)
self.validate_fields(data.get('mod_v'))
self.close_notifications()
if not breadcrumb:
self.navigate_to_entity(entity, search_facet)
else:
@ -1405,6 +1409,7 @@ class UI_driver(object):
# 5. Delete record
if delete:
self.delete_record(pkey, data.get('del'))
self.close_notifications()
def add_table_record(self, name, data, parent=None):
"""