lib/aranha/selenium/session.rb in aranha-selenium-0.3.0 vs lib/aranha/selenium/session.rb in aranha-selenium-0.4.0
- old
+ new
@@ -27,9 +27,23 @@
def find_or_not_element(find_element_args)
r = find_elements(find_element_args)
r.any? ? r.first : nil
end
+ def select_option(field, value, *find_element_args)
+ select = find_element(*find_element_args)
+ option = ::Selenium::WebDriver::Support::Select.new(select)
+ option.select_by(field, value)
+ end
+
+ def select_option_by_text(text, *find_element_args)
+ select_option(:text, text, *find_element_args)
+ end
+
+ def select_option_by_value(value, *find_element_args)
+ select_option(:value, value, *find_element_args)
+ end
+
def wait_for_click(find_element_args)
wait.until do
element = find_element(find_element_args)
element ? element_click(element) : nil
end