Commit 359cbbb4 by David Baumgold

Fixing up ui_helpers based on feedback from Christina

parent 437e658f
......@@ -73,9 +73,8 @@ def css_click(css_selector, index=0, max_attempts=5, success_condition=lambda: T
for _ in range(max_attempts):
try:
world.css_find(css_selector)[index].click()
if not success_condition():
raise Exception("unsuccessful click")
return
if success_condition():
return
except WebDriverException:
# Occasionally, MathJax or other JavaScript can cover up
# an element temporarily.
......@@ -118,6 +117,8 @@ def css_check(css_selector, index=0, max_attempts=5, success_condition=lambda: T
else:
# try once more, letting exceptions raise
world.css_find(css_selector)[index].check()
if not success_condition():
raise Exception("unsuccessful check")
@world.absorb
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment