mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-26 16:16:31 -06:00
ui_tests: make associations cancelable
Adjust associations functions to simulate "cancel" action. https://pagure.io/freeipa/issue/7441 Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
This commit is contained in:
parent
18e8c964f5
commit
553183944a
@ -1415,7 +1415,8 @@ class UI_driver(object):
|
||||
self.wait_for_request()
|
||||
|
||||
def prepare_associations(
|
||||
self, pkeys, facet=None, facet_btn='add', member_pkeys=None):
|
||||
self, pkeys, facet=None, facet_btn='add', member_pkeys=None,
|
||||
confirm_btn='add'):
|
||||
"""
|
||||
Helper function for add_associations and delete_associations
|
||||
"""
|
||||
@ -1430,7 +1431,7 @@ class UI_driver(object):
|
||||
self.select_record(key, table_name='available')
|
||||
self.button_click('add')
|
||||
|
||||
self.dialog_button_click('add')
|
||||
self.dialog_button_click(confirm_btn)
|
||||
self.wait_for_request()
|
||||
|
||||
if member_pkeys:
|
||||
@ -1442,12 +1443,16 @@ class UI_driver(object):
|
||||
|
||||
def add_associations(
|
||||
self, pkeys, facet=None, delete=False, facet_btn='add',
|
||||
member_pkeys=None):
|
||||
member_pkeys=None, confirm_btn='add'):
|
||||
"""
|
||||
Add associations
|
||||
"""
|
||||
check_pkeys = self.prepare_associations(
|
||||
pkeys, facet, facet_btn, member_pkeys)
|
||||
pkeys, facet, facet_btn, member_pkeys, confirm_btn=confirm_btn)
|
||||
|
||||
# we need to return if we want to "cancel" to avoid assert record fail
|
||||
if confirm_btn == 'cancel':
|
||||
return
|
||||
|
||||
for key in check_pkeys:
|
||||
self.assert_record(key)
|
||||
|
Loading…
Reference in New Issue
Block a user