Class: RFormSpec::BaseControl
- Inherits:
-
Object
- Object
- RFormSpec::BaseControl
show all
- Includes:
- Driver
- Defined in:
- lib/rformspec/control.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Driver
#close_window, #driver, #focus_window, #key_press, #mouse_click, #mouse_move, #open_file_dialog, #try_for, #wait_and_focus_window, #wait_for_window, #window_exists?
#connect_to_testwise, #debug, #dump_caller_stack, #notify_screenshot_location, #operation_delay
Constructor Details
#initialize(win, ctrl_id) ⇒ BaseControl
Returns a new instance of BaseControl.
8
9
10
11
|
# File 'lib/rformspec/control.rb', line 8
def initialize(win, ctrl_id)
@parent_win = win
@control_id = ctrl_id
end
|
Instance Attribute Details
#control_id ⇒ Object
Returns the value of attribute control_id.
6
7
8
|
# File 'lib/rformspec/control.rb', line 6
def control_id
@control_id
end
|
#parent_win ⇒ Object
Returns the value of attribute parent_win.
6
7
8
|
# File 'lib/rformspec/control.rb', line 6
def parent_win
@parent_win
end
|
Instance Method Details
#click ⇒ Object
40
41
42
|
# File 'lib/rformspec/control.rb', line 40
def click
driver.ControlClick(@parent_win.title, @parent_win.text, @control_id)
end
|
#focus ⇒ Object
26
27
28
|
# File 'lib/rformspec/control.rb', line 26
def focus
driver.ControlFocus(@parent_win.title, @parent_win.text, @control_id)
end
|
#get_text ⇒ Object
22
23
24
|
# File 'lib/rformspec/control.rb', line 22
def get_text
driver.ControlGetText(@parent_win.title, @parent_win.text, @control_id)
end
|
#is_enabled? ⇒ Boolean
30
31
32
33
|
# File 'lib/rformspec/control.rb', line 30
def is_enabled?
ret = driver.ControlCommand(@parent_win.title, @parent_win.text, @control_id, "IsEnabled" ,"")
ret == 1 or ret == "1"
end
|
#is_visible? ⇒ Boolean
35
36
37
38
|
# File 'lib/rformspec/control.rb', line 35
def is_visible?
ret = driver.ControlCommand(@parent_win.title, @parent_win.text, @control_id, "IsVisible" ,"")
ret == 1 or ret == "1"
end
|
#send_text(text) ⇒ Object
Also known as:
send_keys
17
18
19
|
# File 'lib/rformspec/control.rb', line 17
def send_text(text)
driver.ControlSend(@parent_win.title, @parent_win.text, @control_id, text)
end
|
#set_text(new_text) ⇒ Object
13
14
15
|
# File 'lib/rformspec/control.rb', line 13
def set_text(new_text)
driver.ControlSetText(@parent_win.title, @parent_win.text, @control_id, new_text)
end
|