rautomation 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +14 -0
- data/README.rdoc +1 -1
- data/VERSION +1 -1
- data/ext/IAccessibleDLL/IAccessibleDLL.suo +0 -0
- data/ext/IAccessibleDLL/IAccessibleDLL/IAccessibleDLL.cpp +0 -6
- data/ext/IAccessibleDLL/IAccessibleDLL/IAccessibleDLL.vcxproj +2 -0
- data/ext/IAccessibleDLL/IAccessibleDLL/IAccessibleDLL.vcxproj.filters +3 -0
- data/ext/IAccessibleDLL/IAccessibleDLL/stdafx.h +9 -3
- data/ext/IAccessibleDLL/IAccessibleDLL/table_support.cpp +282 -0
- data/ext/IAccessibleDLL/Release/IAccessibleDLL.dll +0 -0
- data/ext/ListViewExplorer/ListViewExplorer.sln +20 -0
- data/ext/ListViewExplorer/ListViewExplorer.suo +0 -0
- data/ext/ListViewExplorer/ListViewExplorer/ListViewExplorer.cpp +174 -0
- data/ext/ListViewExplorer/ListViewExplorer/ListViewExplorer.vcxproj +95 -0
- data/ext/ListViewExplorer/ListViewExplorer/ListViewExplorer.vcxproj.filters +42 -0
- data/ext/ListViewExplorer/ListViewExplorer/ListViewExplorer.vcxproj.user +3 -0
- data/ext/ListViewExplorer/ListViewExplorer/ReadMe.txt +40 -0
- data/ext/ListViewExplorer/ListViewExplorer/stdafx.cpp +8 -0
- data/ext/ListViewExplorer/ListViewExplorer/stdafx.h +17 -0
- data/ext/ListViewExplorer/ListViewExplorer/table_support.cpp +250 -0
- data/ext/ListViewExplorer/ListViewExplorer/table_support.h +2 -0
- data/ext/ListViewExplorer/ListViewExplorer/targetver.h +8 -0
- data/ext/UiaDll/Release/UiaDll.dll +0 -0
- data/ext/UiaDll/UiaDll.sln +20 -0
- data/ext/UiaDll/UiaDll.suo +0 -0
- data/ext/UiaDll/UiaDll/ReadMe.txt +48 -0
- data/ext/UiaDll/UiaDll/UiaDll.cpp +205 -0
- data/ext/UiaDll/UiaDll/UiaDll.vcxproj +104 -0
- data/ext/UiaDll/UiaDll/UiaDll.vcxproj.filters +42 -0
- data/ext/UiaDll/UiaDll/dllmain.cpp +39 -0
- data/ext/UiaDll/UiaDll/globals.h +3 -0
- data/ext/UiaDll/UiaDll/stdafx.cpp +8 -0
- data/ext/UiaDll/UiaDll/stdafx.h +19 -0
- data/ext/UiaDll/UiaDll/targetver.h +8 -0
- data/ext/WindowsForms/bin/WindowsForms.exe +0 -0
- data/ext/WindowsForms/src/WindowsForms/WindowsForms.suo +0 -0
- data/ext/WindowsForms/src/WindowsForms/WindowsForms/DataEntryForm.Designer.cs +27 -7
- data/ext/WindowsForms/src/WindowsForms/WindowsForms/DataEntryForm.cs +1 -0
- data/ext/WindowsForms/src/WindowsForms/WindowsForms/MainFormWindow.Designer.cs +110 -11
- data/ext/WindowsForms/src/WindowsForms/WindowsForms/bin/Release/WindowsForms.exe +0 -0
- data/lib/rautomation.rb +2 -3
- data/lib/rautomation/adapter/autoit.rb +2 -2
- data/lib/rautomation/adapter/win_ffi.rb +4 -0
- data/lib/rautomation/adapter/win_ffi/button.rb +6 -0
- data/lib/rautomation/adapter/win_ffi/checkbox.rb +7 -0
- data/lib/rautomation/adapter/win_ffi/constants.rb +44 -3
- data/lib/rautomation/adapter/win_ffi/control.rb +36 -3
- data/lib/rautomation/adapter/win_ffi/functions.rb +37 -3
- data/lib/rautomation/adapter/win_ffi/keystroke_converter.rb +67 -0
- data/lib/rautomation/adapter/win_ffi/label.rb +21 -0
- data/lib/rautomation/adapter/win_ffi/list_box.rb +60 -0
- data/lib/rautomation/adapter/win_ffi/locators.rb +0 -1
- data/lib/rautomation/adapter/win_ffi/ms_uia/uia_dll.rb +36 -0
- data/lib/rautomation/adapter/win_ffi/radio.rb +7 -0
- data/lib/rautomation/adapter/win_ffi/select_list.rb +30 -7
- data/lib/rautomation/adapter/win_ffi/table.rb +42 -3
- data/lib/rautomation/adapter/win_ffi/text_field.rb +17 -1
- data/lib/rautomation/adapter/win_ffi/window.rb +47 -8
- data/lib/rautomation/button.rb +5 -0
- data/lib/rautomation/element_collections.rb +8 -5
- data/lib/rautomation/text_field.rb +10 -0
- data/lib/rautomation/window.rb +20 -14
- data/spec/adapter/win_ffi/button_spec.rb +41 -0
- data/spec/adapter/win_ffi/checkbox_spec.rb +19 -0
- data/spec/adapter/win_ffi/keystroke_converter_spec.rb +47 -0
- data/spec/adapter/win_ffi/label_spec.rb +21 -0
- data/spec/adapter/win_ffi/listbox_spec.rb +52 -0
- data/spec/adapter/win_ffi/radio_spec.rb +16 -0
- data/spec/adapter/win_ffi/select_list_spec.rb +29 -4
- data/spec/adapter/win_ffi/table_spec.rb +20 -1
- data/spec/adapter/win_ffi/text_field_spec.rb +23 -0
- data/spec/adapter/win_ffi/window_spec.rb +29 -0
- data/spec/button_spec.rb +1 -0
- data/spec/spec_helper.rb +4 -1
- data/spec/text_field_spec.rb +27 -15
- metadata +52 -34
- data/ext/IAccessibleDLL/Release/IAccessibleDLL.exp +0 -0
- data/ext/IAccessibleDLL/Release/IAccessibleDLL.lib +0 -0
- data/ext/WindowsForms/src/WindowsForms/WindowsForms/bin/Debug/WindowsForms.exe +0 -0
- data/ext/WindowsForms/src/WindowsForms/WindowsForms/bin/Debug/WindowsForms.pdb +0 -0
- data/ext/WindowsForms/src/WindowsForms/WindowsForms/bin/Debug/WindowsForms.vshost.exe +0 -0
- data/ext/WindowsForms/src/WindowsForms/WindowsForms/bin/Debug/WindowsForms.vshost.exe.manifest +0 -11
- data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache +0 -0
- data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache +0 -0
- data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/GenerateResource.read.1.tlog +0 -0
- data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/GenerateResource.write.1.tlog +0 -0
- data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/ResolveAssemblyReference.cache +0 -0
- data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.AboutBox.resources +0 -0
- data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.DataEntryForm.resources +0 -0
- data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.MainFormWindow.resources +0 -0
- data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.PersonForm.resources +0 -0
- data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.Properties.Resources.resources +0 -0
- data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.SimpleElementsForm.resources +0 -0
- data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.csproj.FileListAbsolute.txt +0 -25
- data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.exe +0 -0
- data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.pdb +0 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "WinFfi::Label", :if => SpecHelper.adapter == :win_ffi do
|
4
|
+
it "#exist?" do
|
5
|
+
window = RAutomation::Window.new(:title => "MainFormWindow")
|
6
|
+
|
7
|
+
window.label(:value => "This is a sample text").should exist
|
8
|
+
window.label(:value => "This label should not exist").should_not exist
|
9
|
+
end
|
10
|
+
|
11
|
+
it "check for label class" do
|
12
|
+
RAutomation::Window.new(:title => "MainFormWindow").label(:id => "textField").should_not exist
|
13
|
+
end
|
14
|
+
|
15
|
+
|
16
|
+
it "#label" do
|
17
|
+
window = RAutomation::Window.new(:title => "MainFormWindow")
|
18
|
+
|
19
|
+
window.label(:value => "This is a sample text").value.should == "This is a sample text"
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "WinFfi::ListBox", :if => SpecHelper.adapter == :win_ffi do
|
4
|
+
|
5
|
+
it "#exists" do
|
6
|
+
RAutomation::Window.new(:title => "MainFormWindow").list_box(:id => "FruitListBox").should exist
|
7
|
+
end
|
8
|
+
|
9
|
+
it "check for listbox class" do
|
10
|
+
RAutomation::Window.new(:title => "MainFormWindow").list_box(:id => "textField").should_not exist
|
11
|
+
end
|
12
|
+
|
13
|
+
it "counts items" do
|
14
|
+
list_box = RAutomation::Window.new(:title => "MainFormWindow").list_box(:id => "FruitListBox")
|
15
|
+
list_box.count.should == 3
|
16
|
+
end
|
17
|
+
|
18
|
+
it "lists items" do
|
19
|
+
list_box = RAutomation::Window.new(:title => "MainFormWindow").list_box(:id => "FruitListBox")
|
20
|
+
list_box.items[0].should == "Apple"
|
21
|
+
list_box.items[1].should == "Orange"
|
22
|
+
list_box.items[2].should == "Mango"
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
it "#selected?" do
|
27
|
+
list_box = RAutomation::Window.new(:title => "MainFormWindow").list_box(:id => "FruitListBox")
|
28
|
+
|
29
|
+
list_box.selected?(2).should == false
|
30
|
+
list_box.select(2)
|
31
|
+
list_box.selected?(2).should == true
|
32
|
+
end
|
33
|
+
|
34
|
+
it "#select" do
|
35
|
+
list_box = RAutomation::Window.new(:title => "MainFormWindow").list_box(:id => "FruitListBox")
|
36
|
+
|
37
|
+
list_box.select(1)
|
38
|
+
list_box.selected?(1).should == true
|
39
|
+
|
40
|
+
list_box.select(0)
|
41
|
+
list_box.selected?(0).should == true
|
42
|
+
|
43
|
+
list_box.select(2)
|
44
|
+
list_box.selected?(2).should == true
|
45
|
+
end
|
46
|
+
|
47
|
+
it "#strings" do
|
48
|
+
list_box = RAutomation::Window.new(:title => "MainFormWindow").list_box(:id => "FruitListBox")
|
49
|
+
|
50
|
+
list_box.strings.should == ["Apple", "Orange", "Mango"]
|
51
|
+
end
|
52
|
+
end
|
@@ -10,6 +10,11 @@ describe "WinFfi::RadioButton", :if => SpecHelper.adapter == :win_ffi do
|
|
10
10
|
to raise_exception(RAutomation::UnknownWindowException)
|
11
11
|
end
|
12
12
|
|
13
|
+
it "check for radio class" do
|
14
|
+
RAutomation::Window.new(:title => "MainFormWindow").radio(:id => "textField").should_not exist
|
15
|
+
end
|
16
|
+
|
17
|
+
|
13
18
|
it "#set? & #set" do
|
14
19
|
radio = RAutomation::Window.new(:title => "MainFormWindow").radio(:value => "Option 1")
|
15
20
|
radio.should_not be_set
|
@@ -18,4 +23,15 @@ describe "WinFfi::RadioButton", :if => SpecHelper.adapter == :win_ffi do
|
|
18
23
|
radio.should be_set
|
19
24
|
end
|
20
25
|
|
26
|
+
it "enabled/disabled" do
|
27
|
+
RAutomation::Window.new(:title => "MainFormWindow").radio(:value => "Option 1").should be_enabled
|
28
|
+
RAutomation::Window.new(:title => "MainFormWindow").radio(:value => "Option 1").should_not be_disabled
|
29
|
+
|
30
|
+
RAutomation::Window.new(:title => "MainFormWindow").radio(:value => "Option Disabled").should_not be_enabled
|
31
|
+
RAutomation::Window.new(:title => "MainFormWindow").radio(:value => "Option Disabled").should be_disabled
|
32
|
+
end
|
33
|
+
|
34
|
+
it "cannot set a disabled radio button" do
|
35
|
+
lambda { RAutomation::Window.new(:title => "MainFormWindow").radio(:value => "Option Disabled").set }.should raise_error
|
36
|
+
end
|
21
37
|
end
|
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe "WinFfi::SelectList", :if => SpecHelper.adapter == :win_ffi do
|
4
4
|
it "#select_list" do
|
5
|
-
RAutomation::Window.new(:title => "MainFormWindow").select_list(:
|
5
|
+
RAutomation::Window.new(:title => "MainFormWindow").select_list(:id => "FruitsComboBox").should exist
|
6
6
|
|
7
7
|
RAutomation::Window.wait_timeout = 0.1
|
8
8
|
expect {RAutomation::Window.new(:title => "non-existent-window").
|
@@ -10,8 +10,12 @@ describe "WinFfi::SelectList", :if => SpecHelper.adapter == :win_ffi do
|
|
10
10
|
to raise_exception(RAutomation::UnknownWindowException)
|
11
11
|
end
|
12
12
|
|
13
|
+
it "check for select list class" do
|
14
|
+
RAutomation::Window.new(:title => "MainFormWindow").select_list(:id => "textField").should_not exist
|
15
|
+
end
|
16
|
+
|
13
17
|
it "#options" do
|
14
|
-
select_list = RAutomation::Window.new(:title => "MainFormWindow").select_list(:
|
18
|
+
select_list = RAutomation::Window.new(:title => "MainFormWindow").select_list(:id => "FruitsComboBox")
|
15
19
|
select_list.options.size.should == 5
|
16
20
|
|
17
21
|
expected_options = ["Apple", "Caimito", "Coconut", "Orange", "Passion Fruit"]
|
@@ -19,14 +23,14 @@ describe "WinFfi::SelectList", :if => SpecHelper.adapter == :win_ffi do
|
|
19
23
|
end
|
20
24
|
|
21
25
|
it "#selected? & #select" do
|
22
|
-
select_list = RAutomation::Window.new(:title => "MainFormWindow").select_list(:
|
26
|
+
select_list = RAutomation::Window.new(:title => "MainFormWindow").select_list(:id => "FruitsComboBox")
|
23
27
|
select_list.options(:text => "Apple")[0].should_not be_selected
|
24
28
|
select_list.options(:text => "Apple")[0].select.should be_true
|
25
29
|
select_list.options(:text => "Apple")[0].should be_selected
|
26
30
|
end
|
27
31
|
|
28
32
|
it "#value" do
|
29
|
-
select_list = RAutomation::Window.new(:title => "MainFormWindow").select_list(:
|
33
|
+
select_list = RAutomation::Window.new(:title => "MainFormWindow").select_list(:id => "FruitsComboBox")
|
30
34
|
|
31
35
|
#default empty state
|
32
36
|
select_list.value.should == ""
|
@@ -38,4 +42,25 @@ describe "WinFfi::SelectList", :if => SpecHelper.adapter == :win_ffi do
|
|
38
42
|
select_list.value.should == "Caimito"
|
39
43
|
end
|
40
44
|
|
45
|
+
it "enabled/disabled" do
|
46
|
+
RAutomation::Window.new(:title => "MainFormWindow").select_list(:id => "FruitsComboBox").should be_enabled
|
47
|
+
RAutomation::Window.new(:title => "MainFormWindow").select_list(:id => "FruitsComboBox").should_not be_disabled
|
48
|
+
|
49
|
+
RAutomation::Window.new(:title => "MainFormWindow").select_list(:id => "comboBoxDisabled").should_not be_enabled
|
50
|
+
RAutomation::Window.new(:title => "MainFormWindow").select_list(:id => "comboBoxDisabled").should be_disabled
|
51
|
+
end
|
52
|
+
|
53
|
+
it "#option" do
|
54
|
+
select_list = RAutomation::Window.new(:title => "MainFormWindow").select_list(:id => "FruitsComboBox")
|
55
|
+
|
56
|
+
select_list.option(:text => "Apple").should_not be_selected
|
57
|
+
select_list.option(:text => "Apple").set
|
58
|
+
select_list.option(:text => "Apple").should be_selected
|
59
|
+
end
|
60
|
+
|
61
|
+
it "cannot select anything on a disabled select list" do
|
62
|
+
select_list = RAutomation::Window.new(:title => "MainFormWindow").select_list(:id => "comboBoxDisabled")
|
63
|
+
|
64
|
+
lambda { select_list.option(:text => "Apple").set }.should raise_error
|
65
|
+
end
|
41
66
|
end
|
@@ -7,7 +7,7 @@ describe "WinFfi::Table", :if => SpecHelper.adapter == :win_ffi do
|
|
7
7
|
end
|
8
8
|
|
9
9
|
it "#table" do
|
10
|
-
table = RAutomation::Window.new(:title => "DataEntryForm").table(:
|
10
|
+
table = RAutomation::Window.new(:title => "DataEntryForm").table(:id => "personListView")
|
11
11
|
table.should exist
|
12
12
|
|
13
13
|
RAutomation::Window.wait_timeout = 0.1
|
@@ -16,5 +16,24 @@ describe "WinFfi::Table", :if => SpecHelper.adapter == :win_ffi do
|
|
16
16
|
to raise_exception(RAutomation::UnknownWindowException)
|
17
17
|
end
|
18
18
|
|
19
|
+
it "#strings" do
|
20
|
+
table = RAutomation::Window.new(:title => "DataEntryForm").table(:id => "personListView")
|
21
|
+
|
22
|
+
table.strings.should == [
|
23
|
+
["Name", "Date of birth", "State"],
|
24
|
+
["John Doe", "12/15/1967", "FL"],
|
25
|
+
["Anna Doe", "3/4/1975", ""]
|
26
|
+
]
|
27
|
+
end
|
28
|
+
|
29
|
+
it "#select" do
|
30
|
+
table = RAutomation::Window.new(:title => "DataEntryForm").table(:id => "personListView")
|
31
|
+
|
32
|
+
table.selected?(2).should == false
|
33
|
+
|
34
|
+
table.select(2)
|
35
|
+
table.selected?(2).should == true
|
36
|
+
end
|
37
|
+
|
19
38
|
end
|
20
39
|
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "WinFfi::TextField", :if => SpecHelper.adapter == :win_ffi do
|
4
|
+
|
5
|
+
it "check for text field class" do
|
6
|
+
RAutomation::Window.new(:title => "MainFormWindow").text_field(:id => "checkBox").should_not exist
|
7
|
+
end
|
8
|
+
|
9
|
+
it "enabled/disabled" do
|
10
|
+
RAutomation::Window.new(:title => "MainFormWindow").text_field(:id => "textField").should be_enabled
|
11
|
+
RAutomation::Window.new(:title => "MainFormWindow").text_field(:id => "textField").should_not be_disabled
|
12
|
+
|
13
|
+
RAutomation::Window.new(:title => "MainFormWindow").text_field(:id => "textBoxDisabled").should_not be_enabled
|
14
|
+
RAutomation::Window.new(:title => "MainFormWindow").text_field(:id => "textBoxDisabled").should be_disabled
|
15
|
+
end
|
16
|
+
|
17
|
+
it "cannot set a value to a disabled text field" do
|
18
|
+
lambda { RAutomation::Window.new(:title => "MainFormWindow").text_field(:id => "textBoxDisabled").set "abc" }.should raise_error
|
19
|
+
|
20
|
+
lambda { RAutomation::Window.new(:title => "MainFormWindow").text_field(:id => "textBoxDisabled").clear }.should raise_error
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
@@ -11,4 +11,33 @@ describe "WinFfi::Window", :if => SpecHelper.adapter == :win_ffi do
|
|
11
11
|
child.title.should == "&About"
|
12
12
|
# child.text.should include "About"
|
13
13
|
end
|
14
|
+
|
15
|
+
it "send tab keystrokes to move focus between elements" do
|
16
|
+
window = RAutomation::Window.new(:title => /MainFormWindow/i)
|
17
|
+
window.button(:value => "&About").set_focus
|
18
|
+
window.button(:value => "&About").should have_focus
|
19
|
+
|
20
|
+
window.send_keys("{tab}{tab}{tab}")
|
21
|
+
button = window.button(:value => "Close")
|
22
|
+
button.should exist
|
23
|
+
button.should have_focus
|
24
|
+
end
|
25
|
+
|
26
|
+
it "send keystrokes to a text field" do
|
27
|
+
window = RAutomation::Window.new(:title => /MainFormWindow/i)
|
28
|
+
text_field = RAutomation::Window.new(:title => "MainFormWindow").text_field(:id => "textField")
|
29
|
+
text_field.set_focus
|
30
|
+
window.send_keys("abc123ABChiHI")
|
31
|
+
text_field.value.should == "abc123ABChiHI"
|
32
|
+
end
|
33
|
+
|
34
|
+
it "#control" do
|
35
|
+
window = RAutomation::Window.new(:title => /MainFormWindow/i)
|
36
|
+
window.control(:id => "aboutButton").should exist
|
37
|
+
end
|
38
|
+
|
39
|
+
it "has controls" do
|
40
|
+
window = RAutomation::Window.new(:title => /MainFormWindow/i)
|
41
|
+
window.controls(:class => /BUTTON/i).size.should == 12
|
42
|
+
end
|
14
43
|
end
|
data/spec/button_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -63,7 +63,7 @@ module SpecHelper
|
|
63
63
|
:window1_text => "This is a sample text",
|
64
64
|
# When sending ENTER on Window 2, then the window OK button should be pressed and Window 2 should be closed.
|
65
65
|
# "A" key
|
66
|
-
:window1_send_keys =>
|
66
|
+
:window1_send_keys => "A",
|
67
67
|
:proc_after_send_keys => lambda do
|
68
68
|
about_box = RAutomation::Window.new(:title => /About/i)
|
69
69
|
RAutomation::WaitHelper.wait_until {about_box.present?}
|
@@ -74,6 +74,9 @@ module SpecHelper
|
|
74
74
|
:window1_text_field_class => "Edit",
|
75
75
|
# Adapter internal method invocation for getting title of window2
|
76
76
|
:title_proc => lambda {|win| win.window_title(win.hwnd)}
|
77
|
+
},
|
78
|
+
:ms_ui_automation => {
|
79
|
+
:window1 => "ext\\WindowsForms\\bin\\WindowsForms.exe"
|
77
80
|
}
|
78
81
|
}[adapter]
|
79
82
|
end
|
data/spec/text_field_spec.rb
CHANGED
@@ -3,51 +3,63 @@ require 'spec_helper'
|
|
3
3
|
describe RAutomation::TextField do
|
4
4
|
it "#text_field" do
|
5
5
|
RAutomation::Window.new(:title => "MainFormWindow").
|
6
|
-
|
6
|
+
text_field(:id => "textField").should exist
|
7
7
|
|
8
8
|
RAutomation::Window.wait_timeout = 0.1
|
9
|
-
expect {RAutomation::Window.new(:title => "non-existent-window").
|
10
|
-
|
11
|
-
|
9
|
+
expect { RAutomation::Window.new(:title => "non-existent-window").
|
10
|
+
text_field(:class => "Edit") }.
|
11
|
+
to raise_exception(RAutomation::UnknownWindowException)
|
12
12
|
end
|
13
13
|
|
14
14
|
it "#set" do
|
15
15
|
window = RAutomation::Window.new(:title => "MainFormWindow")
|
16
|
-
window.text_field(:
|
16
|
+
window.text_field(:id => "textField").set "hello!"
|
17
17
|
|
18
18
|
RAutomation::Window.wait_timeout = 0.1
|
19
|
-
expect {window.text_field(:class => "non-existing-field").set "hello!"}.
|
20
|
-
|
19
|
+
expect { window.text_field(:class => "non-existing-field").set "hello!" }.
|
20
|
+
to raise_exception(RAutomation::UnknownTextFieldException)
|
21
21
|
end
|
22
22
|
|
23
|
-
it "#clear"do
|
23
|
+
it "#clear" do
|
24
24
|
window = RAutomation::Window.new(:title => "MainFormWindow")
|
25
|
-
field
|
25
|
+
field = window.text_field(:id => "textField")
|
26
26
|
field.set "hello!"
|
27
27
|
field.value.should == "hello!"
|
28
28
|
field.clear
|
29
29
|
field.value.should be_empty
|
30
30
|
|
31
31
|
RAutomation::Window.wait_timeout = 0.1
|
32
|
-
expect {window.text_field(:class => "non-existent-field").clear}.
|
33
|
-
|
32
|
+
expect { window.text_field(:class => "non-existent-field").clear }.
|
33
|
+
to raise_exception(RAutomation::UnknownTextFieldException)
|
34
34
|
end
|
35
35
|
|
36
36
|
it "#value" do
|
37
37
|
window = RAutomation::Window.new(:title => "MainFormWindow")
|
38
|
-
field
|
38
|
+
field = window.text_field(:id => "textField")
|
39
39
|
field.set "hello!"
|
40
40
|
field.value.should == "hello!"
|
41
41
|
|
42
42
|
RAutomation::Window.wait_timeout = 0.1
|
43
|
-
expect {window.text_field(:class => "non-existent-field").value}.
|
44
|
-
|
43
|
+
expect { window.text_field(:class => "non-existent-field").value }.
|
44
|
+
to raise_exception(RAutomation::UnknownTextFieldException)
|
45
45
|
end
|
46
46
|
|
47
47
|
it "#exists?" do
|
48
48
|
window = RAutomation::Window.new(:title => "MainFormWindow")
|
49
|
-
field
|
49
|
+
field = window.text_field(:id => "textField")
|
50
50
|
field.should exist
|
51
51
|
window.text_field(:class => "non-existent-field").should_not exist
|
52
52
|
end
|
53
|
+
|
54
|
+
|
55
|
+
it "#hwnd" do
|
56
|
+
window = RAutomation::Window.new(:title => "MainFormWindow")
|
57
|
+
field = window.text_field(:id => "textField")
|
58
|
+
|
59
|
+
field.hwnd.should be_a(Fixnum)
|
60
|
+
|
61
|
+
RAutomation::Window.wait_timeout = 0.1
|
62
|
+
expect { window.text_field(:class => "non-existing-window").hwnd }.
|
63
|
+
to raise_exception(RAutomation::UnknownTextFieldException)
|
64
|
+
end
|
53
65
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rautomation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 7
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 6
|
9
|
+
- 0
|
10
|
+
version: 0.6.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jarmo Pertman
|
@@ -15,8 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
19
|
-
default_executable:
|
18
|
+
date: 2011-07-03 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: rspec
|
@@ -71,10 +70,33 @@ files:
|
|
71
70
|
- ext/IAccessibleDLL/IAccessibleDLL/dllmain.cpp
|
72
71
|
- ext/IAccessibleDLL/IAccessibleDLL/stdafx.cpp
|
73
72
|
- ext/IAccessibleDLL/IAccessibleDLL/stdafx.h
|
73
|
+
- ext/IAccessibleDLL/IAccessibleDLL/table_support.cpp
|
74
74
|
- ext/IAccessibleDLL/IAccessibleDLL/targetver.h
|
75
75
|
- ext/IAccessibleDLL/Release/IAccessibleDLL.dll
|
76
|
-
- ext/
|
77
|
-
- ext/
|
76
|
+
- ext/ListViewExplorer/ListViewExplorer.sln
|
77
|
+
- ext/ListViewExplorer/ListViewExplorer.suo
|
78
|
+
- ext/ListViewExplorer/ListViewExplorer/ListViewExplorer.cpp
|
79
|
+
- ext/ListViewExplorer/ListViewExplorer/ListViewExplorer.vcxproj
|
80
|
+
- ext/ListViewExplorer/ListViewExplorer/ListViewExplorer.vcxproj.filters
|
81
|
+
- ext/ListViewExplorer/ListViewExplorer/ListViewExplorer.vcxproj.user
|
82
|
+
- ext/ListViewExplorer/ListViewExplorer/ReadMe.txt
|
83
|
+
- ext/ListViewExplorer/ListViewExplorer/stdafx.cpp
|
84
|
+
- ext/ListViewExplorer/ListViewExplorer/stdafx.h
|
85
|
+
- ext/ListViewExplorer/ListViewExplorer/table_support.cpp
|
86
|
+
- ext/ListViewExplorer/ListViewExplorer/table_support.h
|
87
|
+
- ext/ListViewExplorer/ListViewExplorer/targetver.h
|
88
|
+
- ext/UiaDll/Release/UiaDll.dll
|
89
|
+
- ext/UiaDll/UiaDll.sln
|
90
|
+
- ext/UiaDll/UiaDll.suo
|
91
|
+
- ext/UiaDll/UiaDll/ReadMe.txt
|
92
|
+
- ext/UiaDll/UiaDll/UiaDll.cpp
|
93
|
+
- ext/UiaDll/UiaDll/UiaDll.vcxproj
|
94
|
+
- ext/UiaDll/UiaDll/UiaDll.vcxproj.filters
|
95
|
+
- ext/UiaDll/UiaDll/dllmain.cpp
|
96
|
+
- ext/UiaDll/UiaDll/globals.h
|
97
|
+
- ext/UiaDll/UiaDll/stdafx.cpp
|
98
|
+
- ext/UiaDll/UiaDll/stdafx.h
|
99
|
+
- ext/UiaDll/UiaDll/targetver.h
|
78
100
|
- ext/WindowsForms/bin/WindowsForms.exe
|
79
101
|
- ext/WindowsForms/src/WindowsForms/WindowsForms.sln
|
80
102
|
- ext/WindowsForms/src/WindowsForms/WindowsForms.suo
|
@@ -100,24 +122,7 @@ files:
|
|
100
122
|
- ext/WindowsForms/src/WindowsForms/WindowsForms/SimpleElementsForm.cs
|
101
123
|
- ext/WindowsForms/src/WindowsForms/WindowsForms/SimpleElementsForm.resx
|
102
124
|
- ext/WindowsForms/src/WindowsForms/WindowsForms/WindowsForms.csproj
|
103
|
-
- ext/WindowsForms/src/WindowsForms/WindowsForms/bin/
|
104
|
-
- ext/WindowsForms/src/WindowsForms/WindowsForms/bin/Debug/WindowsForms.pdb
|
105
|
-
- ext/WindowsForms/src/WindowsForms/WindowsForms/bin/Debug/WindowsForms.vshost.exe
|
106
|
-
- ext/WindowsForms/src/WindowsForms/WindowsForms/bin/Debug/WindowsForms.vshost.exe.manifest
|
107
|
-
- ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache
|
108
|
-
- ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
|
109
|
-
- ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/GenerateResource.read.1.tlog
|
110
|
-
- ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/GenerateResource.write.1.tlog
|
111
|
-
- ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/ResolveAssemblyReference.cache
|
112
|
-
- ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.AboutBox.resources
|
113
|
-
- ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.DataEntryForm.resources
|
114
|
-
- ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.MainFormWindow.resources
|
115
|
-
- ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.PersonForm.resources
|
116
|
-
- ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.Properties.Resources.resources
|
117
|
-
- ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.SimpleElementsForm.resources
|
118
|
-
- ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.csproj.FileListAbsolute.txt
|
119
|
-
- ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.exe
|
120
|
-
- ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.pdb
|
125
|
+
- ext/WindowsForms/src/WindowsForms/WindowsForms/bin/Release/WindowsForms.exe
|
121
126
|
- lib/rautomation.rb
|
122
127
|
- lib/rautomation/adapter/autoit.rb
|
123
128
|
- lib/rautomation/adapter/autoit/button.rb
|
@@ -132,7 +137,11 @@ files:
|
|
132
137
|
- lib/rautomation/adapter/win_ffi/constants.rb
|
133
138
|
- lib/rautomation/adapter/win_ffi/control.rb
|
134
139
|
- lib/rautomation/adapter/win_ffi/functions.rb
|
140
|
+
- lib/rautomation/adapter/win_ffi/keystroke_converter.rb
|
141
|
+
- lib/rautomation/adapter/win_ffi/label.rb
|
142
|
+
- lib/rautomation/adapter/win_ffi/list_box.rb
|
135
143
|
- lib/rautomation/adapter/win_ffi/locators.rb
|
144
|
+
- lib/rautomation/adapter/win_ffi/ms_uia/uia_dll.rb
|
136
145
|
- lib/rautomation/adapter/win_ffi/radio.rb
|
137
146
|
- lib/rautomation/adapter/win_ffi/select_list.rb
|
138
147
|
- lib/rautomation/adapter/win_ffi/table.rb
|
@@ -143,10 +152,15 @@ files:
|
|
143
152
|
- lib/rautomation/text_field.rb
|
144
153
|
- lib/rautomation/wait_helper.rb
|
145
154
|
- lib/rautomation/window.rb
|
155
|
+
- spec/adapter/win_ffi/button_spec.rb
|
146
156
|
- spec/adapter/win_ffi/checkbox_spec.rb
|
157
|
+
- spec/adapter/win_ffi/keystroke_converter_spec.rb
|
158
|
+
- spec/adapter/win_ffi/label_spec.rb
|
159
|
+
- spec/adapter/win_ffi/listbox_spec.rb
|
147
160
|
- spec/adapter/win_ffi/radio_spec.rb
|
148
161
|
- spec/adapter/win_ffi/select_list_spec.rb
|
149
162
|
- spec/adapter/win_ffi/table_spec.rb
|
163
|
+
- spec/adapter/win_ffi/text_field_spec.rb
|
150
164
|
- spec/adapter/win_ffi/window_spec.rb
|
151
165
|
- spec/button_spec.rb
|
152
166
|
- spec/buttons_spec.rb
|
@@ -155,13 +169,12 @@ files:
|
|
155
169
|
- spec/text_fields_spec.rb
|
156
170
|
- spec/window_spec.rb
|
157
171
|
- spec/windows_spec.rb
|
158
|
-
has_rdoc: true
|
159
172
|
homepage: http://github.com/jarmo/RAutomation
|
160
173
|
licenses: []
|
161
174
|
|
162
175
|
post_install_message:
|
163
|
-
rdoc_options:
|
164
|
-
|
176
|
+
rdoc_options: []
|
177
|
+
|
165
178
|
require_paths:
|
166
179
|
- lib
|
167
180
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -185,20 +198,25 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
185
198
|
requirements: []
|
186
199
|
|
187
200
|
rubyforge_project:
|
188
|
-
rubygems_version: 1.
|
201
|
+
rubygems_version: 1.8.4
|
189
202
|
signing_key:
|
190
203
|
specification_version: 3
|
191
204
|
summary: Automate windows and their controls through user-friendly API with Ruby
|
192
205
|
test_files:
|
206
|
+
- spec/adapter/win_ffi/button_spec.rb
|
193
207
|
- spec/adapter/win_ffi/checkbox_spec.rb
|
208
|
+
- spec/adapter/win_ffi/keystroke_converter_spec.rb
|
209
|
+
- spec/adapter/win_ffi/label_spec.rb
|
210
|
+
- spec/adapter/win_ffi/listbox_spec.rb
|
194
211
|
- spec/adapter/win_ffi/radio_spec.rb
|
195
212
|
- spec/adapter/win_ffi/select_list_spec.rb
|
196
213
|
- spec/adapter/win_ffi/table_spec.rb
|
214
|
+
- spec/adapter/win_ffi/text_field_spec.rb
|
197
215
|
- spec/adapter/win_ffi/window_spec.rb
|
198
|
-
- spec/buttons_spec.rb
|
199
216
|
- spec/button_spec.rb
|
217
|
+
- spec/buttons_spec.rb
|
200
218
|
- spec/spec_helper.rb
|
201
|
-
- spec/text_fields_spec.rb
|
202
219
|
- spec/text_field_spec.rb
|
203
|
-
- spec/
|
220
|
+
- spec/text_fields_spec.rb
|
204
221
|
- spec/window_spec.rb
|
222
|
+
- spec/windows_spec.rb
|