Fix UI_driver.has_class exception. Handle situation when element has no class attribute

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
This commit is contained in:
Serhii Tsymbaliuk
2018-09-19 13:32:51 +02:00
parent 1affddaabe
commit 46eb9a38f0
+2 -1
View File
@@ -1908,7 +1908,8 @@ class UI_driver(object):
"""
Check if el has CSS class
"""
return cls in el.get_attribute("class").split()
class_attr = el.get_attribute("class")
return bool(class_attr) and cls in class_attr.split()
def skip(self, reason):
"""