Class: AutoItWindow
- Inherits:
-
Object
- Object
- AutoItWindow
- Defined in:
- lib/selenium/auto_it_window.rb
Class Method Summary collapse
- .on_activation(autoit, title, text = nil) {|window| ... } ⇒ Object
- .wait_for(autoit, title, text = nil) ⇒ Object
Instance Method Summary collapse
- #activate ⇒ Object
- #activate_if_needed ⇒ Object
- #active? ⇒ Boolean
- #close ⇒ Object
-
#initialize(autoit, title, text = nil) ⇒ AutoItWindow
constructor
A new instance of AutoItWindow.
- #send_keys(keys) ⇒ Object
- #state ⇒ Object
- #wait_for_activation ⇒ Object
- #wait_for_appear ⇒ Object
Constructor Details
#initialize(autoit, title, text = nil) ⇒ AutoItWindow
Returns a new instance of AutoItWindow.
6 7 8 9 10 |
# File 'lib/selenium/auto_it_window.rb', line 6 def initialize(autoit, title, text=nil) @autoit = autoit @title = title @text = text end |
Class Method Details
.on_activation(autoit, title, text = nil) {|window| ... } ⇒ Object
18 19 20 21 |
# File 'lib/selenium/auto_it_window.rb', line 18 def self.on_activation(autoit, title, text = nil) window = wait_for(autoit, title, text) yield window end |
.wait_for(autoit, title, text = nil) ⇒ Object
12 13 14 15 16 |
# File 'lib/selenium/auto_it_window.rb', line 12 def self.wait_for(autoit, title, text = nil) window = self.new(autoit, title, text) window.wait_for_appear window end |
Instance Method Details
#activate ⇒ Object
31 32 33 |
# File 'lib/selenium/auto_it_window.rb', line 31 def activate @autoit.WinActivate(@title, @text) end |
#activate_if_needed ⇒ Object
52 53 54 55 |
# File 'lib/selenium/auto_it_window.rb', line 52 def activate_if_needed winstate = state activate unless winstate.active? end |
#active? ⇒ Boolean
35 36 37 |
# File 'lib/selenium/auto_it_window.rb', line 35 def active? 1 == @autoit.WinActive(@title, @text) end |
#close ⇒ Object
48 49 50 |
# File 'lib/selenium/auto_it_window.rb', line 48 def close @autoit.WinClose(@title) end |
#send_keys(keys) ⇒ Object
43 44 45 46 |
# File 'lib/selenium/auto_it_window.rb', line 43 def send_keys(keys) activate_if_needed @autoit.Send(keys) end |
#state ⇒ Object
39 40 41 |
# File 'lib/selenium/auto_it_window.rb', line 39 def state AutoItWindowState.new(@autoit.WinGetState(@title, @text)) end |
#wait_for_activation ⇒ Object
23 24 25 |
# File 'lib/selenium/auto_it_window.rb', line 23 def wait_for_activation @autoit.WinWaitActive(@title, @text, 30) end |
#wait_for_appear ⇒ Object
27 28 29 |
# File 'lib/selenium/auto_it_window.rb', line 27 def wait_for_appear @autoit.WinWait(@title, @text, 30) end |