Wrap logic for selecting options in acceptance tests
This commit is contained in:
@@ -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):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user