module PageObject::Platforms::LdsWatirWebDriver::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/platforms/lds_watir_webdriver/select_list.rb, line 12
def [](idx)
  options[idx]
end
include?(value) click to toggle source

Returns true if the select list has one or more options where text or label matches the given value.

@param [String, Regexp] value A value. @return [Boolean]

# File lib/page-object/platforms/lds_watir_webdriver/select_list.rb, line 59
def include?(value)
  element.include? value
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/platforms/lds_watir_webdriver/select_list.rb, line 36
def options
  element.options.map { |e| ::PageObject::Elements::Option.new(e, :platform => :lds_watir_webdriver) }
end
select(value) click to toggle source

Select a value from the list

# File lib/page-object/platforms/lds_watir_webdriver/select_list.rb, line 19
def select(value)
  element.select(value)
end
select_value(value) click to toggle source

Select the option(s) whose value attribute matches the given string

# File lib/page-object/platforms/lds_watir_webdriver/select_list.rb, line 27
def select_value(value)
  element.select_value(value)
end
selected?(value) click to toggle source

Returns true if any of the selected options’ text or label match the given value.

@param [String, Regexp] value A value. @return [Boolean]

# File lib/page-object/platforms/lds_watir_webdriver/select_list.rb, line 68
def selected?(value)
  element.selected? value
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/platforms/lds_watir_webdriver/select_list.rb, line 43
def selected_options
  element.selected_options.map { |e| e.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/platforms/lds_watir_webdriver/select_list.rb, line 50
def selected_values
  element.selected_options.map { |e| e.value }.compact
end