Class: Mohawk::Adapters::UIA::ComboBoxControl

Inherits:
ValueControl show all
Includes:
ElementLocator
Defined in:
lib/mohawk/adapters/uia/combo_box.rb

Instance Method Summary collapse

Methods inherited from ValueControl

#set

Methods inherited from Control

#click, #disabled?, #enabled?, #exist?, #focus, #handle, #initialize, #method_missing, valid_patterns, #view, #visible?

Methods included from Waiter

#wait_until

Constructor Details

This class inherits a constructor from Mohawk::Adapters::UIA::Control

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Mohawk::Adapters::UIA::Control

Instance Method Details

#ctrl_elementObject



10
# File 'lib/mohawk/adapters/uia/combo_box.rb', line 10

alias_method :ctrl_element, :element

#optionsObject



20
21
22
23
24
25
26
# File 'lib/mohawk/adapters/uia/combo_box.rb', line 20

def options
  if supports_selection?
    all_items.map &:name
  else
    element.items.map &:name
  end
end

#valueObject



12
13
14
15
16
17
18
# File 'lib/mohawk/adapters/uia/combo_box.rb', line 12

def value
  if supports_selection?
    selection_pattern.selected_items.map(&:name).first || ''
  else
    value_pattern.value
  end
end