Permalink
Browse files

Watir select list options should use watir elements

  • Loading branch information...
1 parent 41592fa commit 8ee65432404e36188f15ac1d995261c7bd26894e Justin Ko committed Dec 6, 2013
Showing with 2 additions and 8 deletions.
  1. +2 −8 lib/page-object/platforms/watir_webdriver/select_list.rb
@@ -10,7 +10,7 @@ module SelectList
# @return [PageObject::Elements::Option]
#
def [](idx)
- Object::PageObject::Elements::Option.new(options[idx], :platform => :watir_webdriver)
+ options[idx]
end
#
@@ -34,12 +34,7 @@ def select_value(value)
# @return [array of PageObject::Elements::Option]
#
def options
- elements = []
- options = element.wd.find_elements(:xpath, child_xpath)
- options.each do |opt|
- elements << Object::PageObject::Elements::Option.new(opt, :platform => :watir_webdriver)
- end
- elements
+ element.options.map { |e| ::PageObject::Elements::Option.new(e, :platform => :watir_webdriver) }
end
#
@@ -56,7 +51,6 @@ def selected_values
element.selected_options.map { |e| e.value }.compact
end
-
#
# Returns true if the select list has one or more options where text or label matches the given value.
#

0 comments on commit 8ee6543

Please sign in to comment.