Skip to content

Commit

Permalink
Use wait_time param when finding element parent (#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsfehler authored Sep 2, 2020
1 parent 68b17db commit 2721250
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion stere/fields/element_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ def find(self, wait_time: typing.Optional[int] = None):
return self._find_all(wait_time=wait_time)

if self.root:
self.parent_locator = self.root.find()
self.parent_locator = self.root.find(wait_time=wait_time)
return self._find_all_in_parent(wait_time=wait_time)
8 changes: 4 additions & 4 deletions stere/fields/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def value_equals(self, expected, wait_time: typing.Optional[int] = None):
retry_time=wait_time,
)

def find(self):
def find(self, wait_time: typing.Optional[int] = None):
"""Find the first matching element.
Returns:
Expand All @@ -208,16 +208,16 @@ def find(self):
ValueError - If more than one element is found.
"""
found_elements = self._element.find()
found_elements = self._element.find(wait_time)
if len(found_elements) >= 2:
raise ValueError("Expected one element, found multiple")
return found_elements[0]

def find_all(self):
def find_all(self, wait_time: typing.Optional[int] = None):
"""Find all matching elements.
Returns:
list
"""
return self._element.find()
return self._element.find(wait_time)

0 comments on commit 2721250

Please sign in to comment.