Commit eec095a1 by JonahStanley

Changed naming of attempts to max_attempts and changed css_selector

parent 96c4d287
......@@ -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():
......
......@@ -83,7 +83,7 @@ def click_on_section(step, section):
world.css_click(section_css)
subid = "ui-accordion-accordion-panel-" + str(int(section) - 1)
subsection_css = 'ul.ui-accordion-content-active[id=\'%s\'][aria-expanded=\'true\']> li > a' % subid
subsection_css = 'ul.ui-accordion-content-active[id=\'%s\'] > li > a' % subid
prev_url = world.browser.url
changed_section = lambda: prev_url != world.browser.url
......
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