Module: Fluent::Platforms::WatirWebDriver::SelectList
- Defined in:
- lib/fluent/platform_watir/platform_web_elements/select_list.rb
Instance Method Summary collapse
-
#[](index) ⇒ Object
Returns an object representing the option for the index provided.
- #include?(value) ⇒ Boolean
-
#options ⇒ Array
Provides an array of Option objects that are contained within a select list object.
- #select(value) ⇒ Object
- #select_value(value) ⇒ Object
- #selected?(value) ⇒ Boolean
-
#selected_options ⇒ Array
Array of strings representing the text of the currently selected options.
-
#selected_values ⇒ Array
Array of strings representing the value of the currently selected options.
Instance Method Details
#[](index) ⇒ Object
Returns an object representing the option for the index provided. The index is zero-based.
36 37 38 |
# File 'lib/fluent/platform_watir/platform_web_elements/select_list.rb', line 36 def [](index) [index] end |
#include?(value) ⇒ Boolean
28 29 30 |
# File 'lib/fluent/platform_watir/platform_web_elements/select_list.rb', line 28 def include?(value) web_element.include? value end |
#options ⇒ Array
Provides an array of Option objects that are contained within a select list object.
44 45 46 |
# File 'lib/fluent/platform_watir/platform_web_elements/select_list.rb', line 44 def web_element..map { |option| ::Fluent::WebElements::Option.new(option, :platform => :watir_webdriver) } end |
#select(value) ⇒ Object
6 7 8 |
# File 'lib/fluent/platform_watir/platform_web_elements/select_list.rb', line 6 def select(value) web_element.select(value) end |
#select_value(value) ⇒ Object
10 11 12 |
# File 'lib/fluent/platform_watir/platform_web_elements/select_list.rb', line 10 def select_value(value) web_element.select_value(value) end |
#selected?(value) ⇒ Boolean
14 15 16 |
# File 'lib/fluent/platform_watir/platform_web_elements/select_list.rb', line 14 def selected?(value) web_element.selected? value end |
#selected_options ⇒ Array
Returns array of strings representing the text of the currently selected options.
19 20 21 |
# File 'lib/fluent/platform_watir/platform_web_elements/select_list.rb', line 19 def web_element..map { |e| e.text }.compact end |
#selected_values ⇒ Array
Returns array of strings representing the value of the currently selected options.
24 25 26 |
# File 'lib/fluent/platform_watir/platform_web_elements/select_list.rb', line 24 def selected_values web_element..map { |e| e.value }.compact end |