Module: PageObject::Platforms::LdsWatirWebDriver::SelectList
- Defined in:
- lib/page-object/platforms/lds_watir_webdriver/select_list.rb
Instance Method Summary collapse
-
#[](idx) ⇒ PageObject::Elements::Option
Return the PageObject::Elements::Option for the index provided.
-
#include?(value) ⇒ Boolean
Returns true if the select list has one or more options where text or label matches the given value.
-
#options ⇒ array of PageObject::Elements::Option
Return an array of Options contained in the select list.
-
#select(value) ⇒ Object
Select a value from the list.
-
#select_value(value) ⇒ Object
Select the option(s) whose value attribute matches the given string.
-
#selected?(value) ⇒ Boolean
Returns true if any of the selected options’ text or label match the given value.
-
#selected_options ⇒ Array<String>
An array of strings representing the text of the currently selected options.
-
#selected_values ⇒ Array<String>
An array of strings representing the value of the currently selected options.
Instance Method Details
#[](idx) ⇒ PageObject::Elements::Option
Return the PageObject::Elements::Option for the index provided. Index is zero based.
12 13 14 |
# File 'lib/page-object/platforms/lds_watir_webdriver/select_list.rb', line 12 def [](idx) [idx] end |
#include?(value) ⇒ Boolean
Returns true if the select list has one or more options where text or label matches the given value.
59 60 61 |
# File 'lib/page-object/platforms/lds_watir_webdriver/select_list.rb', line 59 def include?(value) element.include? value end |
#options ⇒ array of PageObject::Elements::Option
Return an array of Options contained in the select list.
36 37 38 |
# File 'lib/page-object/platforms/lds_watir_webdriver/select_list.rb', line 36 def element..map { |e| ::PageObject::Elements::Option.new(e, :platform => :lds_watir_webdriver) } end |
#select(value) ⇒ Object
Select a value from the list
19 20 21 |
# File 'lib/page-object/platforms/lds_watir_webdriver/select_list.rb', line 19 def select(value) element.select(value) end |
#select_value(value) ⇒ Object
Select the option(s) whose value attribute matches the given string
27 28 29 |
# File 'lib/page-object/platforms/lds_watir_webdriver/select_list.rb', line 27 def select_value(value) element.select_value(value) end |
#selected?(value) ⇒ Boolean
Returns true if any of the selected options’ text or label match the given value.
68 69 70 |
# File 'lib/page-object/platforms/lds_watir_webdriver/select_list.rb', line 68 def selected?(value) element.selected? value end |
#selected_options ⇒ Array<String>
Returns An array of strings representing the text of the currently selected options.
43 44 45 |
# File 'lib/page-object/platforms/lds_watir_webdriver/select_list.rb', line 43 def element..map { |e| e.text }.compact end |
#selected_values ⇒ Array<String>
Returns An array of strings representing the value of the currently selected options.
50 51 52 |
# File 'lib/page-object/platforms/lds_watir_webdriver/select_list.rb', line 50 def selected_values element..map { |e| e.value }.compact end |