class PageObject::Elements::SelectList
Public Instance Methods
[](idx)
click to toggle source
Return the PageObject::Elements::Option
for the index provided. Index is zero based.
@return [PageObject::Elements::Option]
# File lib/page-object/elements/select_list.rb, line 11 def [](idx) options[idx] end
options()
click to toggle source
Return an array of Options contained in the select list.
@return [array of PageObject::Elements::Option]
# File lib/page-object/elements/select_list.rb, line 20 def options element.options.map { |e| PageObject::Elements::Option.new(e) } end
selected_options()
click to toggle source
@return [Array<String>] An array of strings representing the text of the currently selected options.
# File lib/page-object/elements/select_list.rb, line 27 def selected_options element.selected_options.map(&:text).compact end
selected_values()
click to toggle source
@return [Array<String>] An array of strings representing the value of the currently selected options.
# File lib/page-object/elements/select_list.rb, line 34 def selected_values element.selected_options.map(&:value).compact end