TabsManager.py Added unit tests + documentation
This commit is contained in:
@@ -110,6 +110,14 @@ class Regex(AttrPredicate):
|
||||
return re.match(self.value, actual) is not None
|
||||
|
||||
|
||||
class And(AttrPredicate):
|
||||
def __init__(self, *predicates):
|
||||
super().__init__(predicates)
|
||||
|
||||
def validate(self, actual):
|
||||
return all(p.validate(actual) for p in self.value)
|
||||
|
||||
|
||||
class ChildrenPredicate(Predicate):
|
||||
"""
|
||||
Predicate given as a child of an element.
|
||||
@@ -791,10 +799,6 @@ def find(ft, expected):
|
||||
for element in elements_to_search:
|
||||
all_matches.extend(_search_tree(element, expected))
|
||||
|
||||
# Raise error if nothing found
|
||||
if not all_matches:
|
||||
raise AssertionError(f"No element found for '{expected}'")
|
||||
|
||||
return all_matches
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user