From 45825b84b0d140f62e1459c3b5dbb5281229cad6 Mon Sep 17 00:00:00 2001 From: Pavel Vomacka Date: Wed, 20 Jul 2016 16:28:38 +0200 Subject: [PATCH] Add function which check whether the field is empty Part of: https://fedorahosted.org/freeipa/ticket/6064 Reviewed-By: Lenka Doudova --- ipatests/test_webui/ui_driver.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ipatests/test_webui/ui_driver.py b/ipatests/test_webui/ui_driver.py index f7f990a60..4bbb90c5a 100644 --- a/ipatests/test_webui/ui_driver.py +++ b/ipatests/test_webui/ui_driver.py @@ -1566,6 +1566,17 @@ class UI_driver(object): s = "div[name='%s'] %s[name='%s']" % (name, element, name) self.assert_text(s, value, parent) + def assert_empty_value(self, selector, parent=None, negative=False): + """ + Assert empty value of some field in details page or in a form + """ + value = self.get_value(selector, parent) + + if negative: + assert not value == '' + else: + assert value == '' + def assert_no_dialog(self): """ Assert that no dialog is opened