Changed naming of attempts to max_attempts and changed css_selector
This commit is contained in:
@@ -58,7 +58,7 @@ def css_find(css, wait_time=5):
|
||||
|
||||
|
||||
@world.absorb
|
||||
def css_click(css_selector, index=0, attempts=5, success_condition=lambda: True):
|
||||
def css_click(css_selector, index=0, max_attempts=5, success_condition=lambda: True):
|
||||
"""
|
||||
Perform a click on a CSS selector, retrying if it initially fails.
|
||||
|
||||
@@ -72,7 +72,7 @@ def css_click(css_selector, index=0, attempts=5, success_condition=lambda: True)
|
||||
assert is_css_present(css_selector)
|
||||
attempt = 0
|
||||
result = False
|
||||
while attempt < attempts:
|
||||
while attempt < max_attempts:
|
||||
try:
|
||||
world.css_find(css_selector)[index].click()
|
||||
if success_condition():
|
||||
@@ -90,7 +90,7 @@ def css_click(css_selector, index=0, attempts=5, success_condition=lambda: True)
|
||||
|
||||
|
||||
@world.absorb
|
||||
def css_check(css_selector, index=0, attempts=5, success_condition=lambda: True):
|
||||
def css_check(css_selector, index=0, max_attempts=5, success_condition=lambda: True):
|
||||
"""
|
||||
Checks a check box based on a CSS selector, retrying if it initially fails.
|
||||
|
||||
@@ -104,7 +104,7 @@ def css_check(css_selector, index=0, attempts=5, success_condition=lambda: True)
|
||||
assert is_css_present(css_selector)
|
||||
attempt = 0
|
||||
result = False
|
||||
while attempt < attempts:
|
||||
while attempt < max_attempts:
|
||||
try:
|
||||
world.css_find(css_selector)[index].check()
|
||||
if success_condition():
|
||||
|
||||
Reference in New Issue
Block a user