Class: Mohawk::Adapters::UIA::TextBox

Inherits:
Control
  • Object
show all
Defined in:
lib/mohawk/adapters/uia/text_box.rb

Instance Method Summary collapse

Methods inherited from Control

#click, #disabled?, #element, #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

#clearObject



24
25
26
27
28
29
30
# File 'lib/mohawk/adapters/uia/text_box.rb', line 24

def clear
  if is_value?
    set ''
  else
    send_keys [:control, :home], [:control, :shift, :end], :backspace
  end
end

#enter(*args) ⇒ Object



7
8
9
# File 'lib/mohawk/adapters/uia/text_box.rb', line 7

def enter(*args)
  send_keys *args
end

#set(value) ⇒ Object



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

def set(value)
  if is_value?
    value_pattern.value = value
  else
    text_pattern.text = value
  end
end

#valueObject



19
20
21
22
# File 'lib/mohawk/adapters/uia/text_box.rb', line 19

def value
  return value_pattern.value if is_value?
  text_pattern.text
end