mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-28 09:06:44 -06:00
ui_tests: add assert_field_required()
Add assert_field_required() to check whether we got 'Required field' error message. https://pagure.io/freeipa/issue/7441 Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
This commit is contained in:
parent
01fa54117d
commit
7fb4f755e9
@ -1876,6 +1876,19 @@ class UI_driver(object):
|
||||
assert is_enabled == enabled, ('Invalid enabled state of action item %s. '
|
||||
'Expected: %s') % (action, str(visible))
|
||||
|
||||
def assert_field_validation_required(self, parent=None):
|
||||
"""
|
||||
Assert we got 'Required field' error message in field validation
|
||||
"""
|
||||
|
||||
if not parent:
|
||||
parent = self.get_form()
|
||||
|
||||
req_field_css = '.help-block[name="error_link"]'
|
||||
|
||||
res = self.find(req_field_css, By.CSS_SELECTOR, context=parent)
|
||||
assert 'Required field' in res.text, 'No "Required field" error found'
|
||||
|
||||
def assert_notification(self, type='success', assert_text=None):
|
||||
"""
|
||||
Assert whether we have a notification of particular type
|
||||
|
Loading…
Reference in New Issue
Block a user