Wrap logic for selecting options in acceptance tests

This commit is contained in:
Jay Zoldak
2013-09-26 16:07:20 -04:00
parent 2379e7c3fc
commit 8e6c0ea937
2 changed files with 15 additions and 8 deletions

View File

@@ -189,6 +189,19 @@ def css_click_at(css_selector, index=0, x_coord=10, y_coord=10, timeout=5):
element.action_chains.perform()
@world.absorb
def select_option(name, value, index=0, wait_time=30):
'''
A method to select an option
This method will return True if the selection worked.
'''
select_css = "select[name='{}']".format(name)
option_css = "option[value='{}']".format(value)
css_selector = "{} {}".format(select_css, option_css)
return css_click(css_selector=css_selector, index=index, wait_time=wait_time)
@world.absorb
def id_click(elem_id):
"""