Fix "ID views" tests fail after running "Automember" tests

Clear default user/host group before deleting.

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

Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
Serhii Tsymbaliuk 2018-11-26 09:30:27 +01:00
parent bb4b558164
commit 07c163ca92
No known key found for this signature in database
GPG Key ID: 632C7F5C1BC85519
2 changed files with 10 additions and 1 deletions

View File

@ -595,6 +595,10 @@ class TestAutomember(UI_driver):
self.switch_to_facet('memberof_group')
self.assert_record(pkey)
# Clear default user group
self.navigate_by_menu('identity/automember/amgroup')
self.select_combobox('automemberdefaultgroup', '')
self.delete_users(user_pkey)
self.delete_user_groups(pkey)
@ -618,6 +622,10 @@ class TestAutomember(UI_driver):
self.switch_to_facet('memberof_hostgroup')
self.assert_record(pkey)
# Clear default host group
self.navigate_by_menu('identity/automember/amhostgroup')
self.select_combobox('automemberdefaultgroup', '')
self.delete('host', [{'pkey': host_data['pkey']}])
self.delete_host_groups(pkey)

View File

@ -965,7 +965,8 @@ class UI_driver:
self.wait_for_request()
list_cnt = self.find('.combobox-widget-list', By.CSS_SELECTOR, cb, strict=True)
opt_s = "select[name=list] option[value='%s']" % value
opt_s = 'select[name=list] option'
opt_s += "[value='%s']" % value if value else ':not([value])'
option = self.find(opt_s, By.CSS_SELECTOR, cb)
if combobox_input: