From b7a149feb22700ccc3a84bb74799b75df963ec23 Mon Sep 17 00:00:00 2001 From: Serhii Tsymbaliuk Date: Thu, 18 Oct 2018 10:04:51 +0200 Subject: [PATCH] UI tests for "Automount": check creating automount key without some fields https://pagure.io/freeipa/issue/7735 Reviewed-By: Petr Cech --- ipatests/test_webui/test_automount.py | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/ipatests/test_webui/test_automount.py b/ipatests/test_webui/test_automount.py index 3d19434d1..89d583178 100644 --- a/ipatests/test_webui/test_automount.py +++ b/ipatests/test_webui/test_automount.py @@ -420,6 +420,38 @@ class TestAutomount(UI_driver): self.navigate_to_entity(LOC_ENTITY) self.delete_record(LOC_PKEY) + def test_add_key_with_missing_fields(self): + """ + Test creating automount key without key name and mount information + """ + + keys = { + 'automountkey': { + 'pkey': 'key1', + 'add': [('textbox', 'automountinformation', '/itest/key')], + }, + 'automountinformation': { + 'pkey': 'key2', + 'add': [('textbox', 'automountkey', 'key2')], + }, + } + + self.add_record(LOC_ENTITY, LOC_DATA) + self.navigate_to_record(LOC_PKEY) + + self.add_record(LOC_ENTITY, MAP_DATA, facet='maps', navigate=False) + self.navigate_to_record(MAP_PKEY) + + for missing_field, key in keys.items(): + self.add_record(MAP_ENTITY, key, negative=True, + facet='keys', navigate=False) + assert self.has_form_error(missing_field) + self.dialog_button_click('cancel') + self.assert_record(key['pkey'], negative=True) + + self.navigate_to_entity(LOC_ENTITY) + self.delete_record(LOC_PKEY) + def test_modify_key(self): """ Test automount key 'Settings'