bewildr 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/bewildr.rb +3 -1
- data/lib/bewildr/application.rb +6 -2
- data/lib/bewildr/control_patterns/invoke_pattern.rb +11 -11
- data/lib/bewildr/control_type_additions/combo_box_additions.rb +0 -4
- data/lib/bewildr/control_type_additions/data_grid_additions.rb +0 -3
- data/lib/bewildr/control_type_additions/document_additions.rb +13 -3
- data/lib/bewildr/control_type_additions/list_additions.rb +0 -2
- data/lib/bewildr/control_type_additions/menu_additions.rb +0 -4
- data/lib/bewildr/control_type_additions/menu_item_additions.rb +20 -18
- data/lib/bewildr/control_type_additions/scroll_additions.rb +0 -2
- data/lib/bewildr/control_type_additions/tab_additions.rb +0 -2
- data/lib/bewildr/control_type_additions/tree_additions.rb +0 -3
- data/lib/bewildr/control_type_additions/tree_item_additions.rb +0 -3
- data/lib/bewildr/control_type_additions/window_additions.rb +0 -2
- data/lib/bewildr/element.rb +197 -225
- data/lib/bewildr/ext/BewildrClickr.dll +0 -0
- data/lib/bewildr/ext/extensions.rb +10 -0
- metadata +5 -4
data/Rakefile
CHANGED
data/lib/bewildr.rb
CHANGED
@@ -19,6 +19,9 @@ CLICKR = Bewildr::Clickr::Clickr.new
|
|
19
19
|
#load plain old ruby libraries
|
20
20
|
require 'timeout'
|
21
21
|
|
22
|
+
#require ruby extensions
|
23
|
+
require 'bewildr/ext/extensions'
|
24
|
+
|
22
25
|
#require bewildr classes
|
23
26
|
require 'bewildr/exceptions'
|
24
27
|
require 'bewildr/bewildr_helpers'
|
@@ -29,7 +32,6 @@ require 'bewildr/windows'
|
|
29
32
|
require 'bewildr/element'
|
30
33
|
|
31
34
|
require 'bewildr/control_patterns/window_pattern'
|
32
|
-
require 'bewildr/control_patterns/invoke_pattern'
|
33
35
|
require 'bewildr/control_patterns/value_pattern'
|
34
36
|
require 'bewildr/control_patterns/toggle_pattern'
|
35
37
|
require 'bewildr/control_patterns/selection_pattern'
|
data/lib/bewildr/application.rb
CHANGED
@@ -63,8 +63,12 @@ module Bewildr
|
|
63
63
|
Bewildr::Application.new(System::Diagnostics::Process.start(process_name))
|
64
64
|
end
|
65
65
|
|
66
|
-
def self.start_with_settings(settings_hash)
|
67
|
-
|
66
|
+
def self.start_with_settings(path_to_exe, settings_hash)
|
67
|
+
start_info = System::Diagnostics::ProcessStartInfo.new(path_to_exe)
|
68
|
+
unless settings_hash[:args].nil? and settings_hash[:args].size > 0
|
69
|
+
start_info.arguments = settings_hash[:args].collect {|arg| arg.to_s}.join(" ")
|
70
|
+
end
|
71
|
+
Bewildr::Application.new(System::Diagnostics::Process.start(start_info))
|
68
72
|
end
|
69
73
|
|
70
74
|
def self.attach_to_process_name(process_name)
|
@@ -1,11 +1,11 @@
|
|
1
|
-
#Copyright (c) 2010, Nathaniel Ritmeyer. All rights reserved.
|
2
|
-
|
3
|
-
module Bewildr
|
4
|
-
module ControlPatterns
|
5
|
-
module InvokePattern
|
6
|
-
def click
|
7
|
-
@automation_element.get_current_pattern(System::Windows::Automation::InvokePattern.pattern).invoke
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
1
|
+
#Copyright (c) 2010, Nathaniel Ritmeyer. All rights reserved.
|
2
|
+
|
3
|
+
#module Bewildr
|
4
|
+
# module ControlPatterns
|
5
|
+
# module InvokePattern
|
6
|
+
# def click
|
7
|
+
# @automation_element.get_current_pattern(System::Windows::Automation::InvokePattern.pattern).invoke
|
8
|
+
# end
|
9
|
+
# end
|
10
|
+
# end
|
11
|
+
#end
|
@@ -4,10 +4,6 @@ module Bewildr
|
|
4
4
|
module ControlTypeAdditions
|
5
5
|
module ComboBoxAdditions
|
6
6
|
def self.extended(base)
|
7
|
-
base.extend Bewildr::ControlPatterns::ExpandCollapsePattern
|
8
|
-
base.extend Bewildr::ControlPatterns::SelectionPattern
|
9
|
-
base.extend Bewildr::ControlPatterns::SelectionItemPattern
|
10
|
-
|
11
7
|
base.instance_eval do
|
12
8
|
def items
|
13
9
|
my_list_items = list_items
|
@@ -4,9 +4,6 @@ module Bewildr
|
|
4
4
|
module ControlTypeAdditions
|
5
5
|
module DataGridAdditions
|
6
6
|
def self.extended(base)
|
7
|
-
base.extend Bewildr::ControlPatterns::GridPattern
|
8
|
-
base.extend Bewildr::ControlPatterns::TablePattern
|
9
|
-
|
10
7
|
base.instance_eval do
|
11
8
|
def cell(row, column)
|
12
9
|
get_item(row, column)
|
@@ -4,18 +4,28 @@ module Bewildr
|
|
4
4
|
module ControlTypeAdditions
|
5
5
|
module DocumentAdditions
|
6
6
|
def self.extended(base)
|
7
|
-
base.extend Bewildr::ControlPatterns::TextPattern
|
8
|
-
|
9
7
|
base.instance_eval do
|
8
|
+
|
9
|
+
def clean_string(input)
|
10
|
+
#add special chars as necessary. Ref: http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.send.aspx
|
11
|
+
replacements = {
|
12
|
+
/\n/ => "{ENTER}"
|
13
|
+
}
|
14
|
+
cleaned_string = input
|
15
|
+
replacements.keys.each {|key| cleaned_string.gsub!(key, replacements[key])}
|
16
|
+
cleaned_string
|
17
|
+
end
|
18
|
+
|
10
19
|
def text
|
11
20
|
get_text
|
12
21
|
end
|
13
22
|
|
14
23
|
def text=(input)
|
24
|
+
cleaned_string = clean_string(input)
|
15
25
|
focus
|
16
26
|
select_all
|
17
27
|
System::Windows::Forms::SendKeys.send_wait("{DEL}")
|
18
|
-
System::Windows::Forms::SendKeys.send_wait(
|
28
|
+
System::Windows::Forms::SendKeys.send_wait(cleaned_string)
|
19
29
|
end
|
20
30
|
end
|
21
31
|
end
|
@@ -4,8 +4,6 @@ module Bewildr
|
|
4
4
|
module ControlTypeAdditions
|
5
5
|
module ListAdditions
|
6
6
|
def self.extended(base)
|
7
|
-
base.extend Bewildr::ControlPatterns::SelectionPattern
|
8
|
-
|
9
7
|
base.instance_eval do
|
10
8
|
def select(input)
|
11
9
|
selectable_elements = get(:type => :list_item, :scope => :children, :how_many => :all)
|
@@ -4,10 +4,6 @@ module Bewildr
|
|
4
4
|
module ControlTypeAdditions
|
5
5
|
module MenuAdditions
|
6
6
|
def self.extended(base)
|
7
|
-
base.extend Bewildr::ControlPatterns::ExpandCollapsePattern
|
8
|
-
base.extend Bewildr::ControlPatterns::SelectionPattern
|
9
|
-
base.extend Bewildr::ControlPatterns::SelectionItemPattern
|
10
|
-
|
11
7
|
base.instance_eval do
|
12
8
|
def root_menu_items
|
13
9
|
get(:type => :menu_item, :scope => :children, :how_many => :all)
|
@@ -1,18 +1,20 @@
|
|
1
|
-
#Copyright (c) 2010, Nathaniel Ritmeyer. All rights reserved.
|
2
|
-
|
3
|
-
module Bewildr
|
4
|
-
module ControlTypeAdditions
|
5
|
-
module MenuItemAdditions
|
6
|
-
def self.extended(base)
|
7
|
-
base.
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
end
|
1
|
+
#Copyright (c) 2010, Nathaniel Ritmeyer. All rights reserved.
|
2
|
+
|
3
|
+
module Bewildr
|
4
|
+
module ControlTypeAdditions
|
5
|
+
module MenuItemAdditions
|
6
|
+
def self.extended(base)
|
7
|
+
base.instance_eval do
|
8
|
+
def sub_menus
|
9
|
+
get(:type => :menu_item, :scope => :children, :how_many => :all)
|
10
|
+
end
|
11
|
+
|
12
|
+
#menu items like 'invoke', not a proper mouse click
|
13
|
+
def click
|
14
|
+
@automation_element.get_current_pattern(System::Windows::Automation::InvokePattern.pattern).invoke
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -4,9 +4,6 @@ module Bewildr
|
|
4
4
|
module ControlTypeAdditions
|
5
5
|
module TreeAdditions
|
6
6
|
def self.extended(base)
|
7
|
-
base.extend Bewildr::ControlPatterns::ExpandCollapsePattern
|
8
|
-
base.extend Bewildr::ControlPatterns::SelectionPattern
|
9
|
-
|
10
7
|
base.instance_eval do
|
11
8
|
def root_nodes
|
12
9
|
prepare_element
|
@@ -4,9 +4,6 @@ module Bewildr
|
|
4
4
|
module ControlTypeAdditions
|
5
5
|
module TreeItemAdditions
|
6
6
|
def self.extended(base)
|
7
|
-
base.extend Bewildr::ControlPatterns::ExpandCollapsePattern
|
8
|
-
base.extend Bewildr::ControlPatterns::SelectionItemPattern
|
9
|
-
|
10
7
|
base.instance_eval do
|
11
8
|
def child_nodes
|
12
9
|
get(:type => :tree_item, :scope => :children)
|
data/lib/bewildr/element.rb
CHANGED
@@ -1,225 +1,197 @@
|
|
1
|
-
#Copyright (c) 2010, Nathaniel Ritmeyer. All rights reserved.
|
2
|
-
|
3
|
-
module Bewildr
|
4
|
-
class Element
|
5
|
-
attr_reader :automation_element
|
6
|
-
attr_reader :control_type
|
7
|
-
|
8
|
-
def initialize(input)
|
9
|
-
@automation_element = input
|
10
|
-
case input
|
11
|
-
when System::Windows::Automation::AutomationElement
|
12
|
-
set_control_type
|
13
|
-
build_element
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
end
|
67
|
-
|
68
|
-
def
|
69
|
-
@automation_element.
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
extend
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
when :
|
178
|
-
|
179
|
-
when :
|
180
|
-
|
181
|
-
when :
|
182
|
-
when :
|
183
|
-
when :
|
184
|
-
|
185
|
-
when :
|
186
|
-
when :
|
187
|
-
when :
|
188
|
-
when :
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
when :tool_tip
|
199
|
-
when :tree
|
200
|
-
extend Bewildr::ControlTypeAdditions::TreeAdditions
|
201
|
-
when :tree_item
|
202
|
-
extend Bewildr::ControlTypeAdditions::TreeItemAdditions
|
203
|
-
when :window
|
204
|
-
extend Bewildr::ControlTypeAdditions::WindowAdditions
|
205
|
-
end
|
206
|
-
|
207
|
-
#add scrolling capability if relevant - TODO: this ugliness will be fixed later
|
208
|
-
if @automation_element.get_supported_patterns.collect {|pattern| pattern.programmatic_name.to_s }.include?("ScrollPatternIdentifiers.Pattern")
|
209
|
-
extend Bewildr::ControlTypeAdditions::ScrollAdditions
|
210
|
-
end
|
211
|
-
end
|
212
|
-
|
213
|
-
#TODO: replace build_element to use something similar to what's below, but
|
214
|
-
#make it smarter
|
215
|
-
|
216
|
-
def build_custom_control_type
|
217
|
-
@automation_element.get_supported_patterns.each do |supported_pattern|
|
218
|
-
case supported_pattern.programmatic_name.to_s
|
219
|
-
when "ValuePatternIdentifiers.Pattern" then extend Bewildr::ControlPatterns::ValuePattern
|
220
|
-
when "TableItemPatternIdentifiers.Pattern" then extend Bewildr::ControlPatterns::TableItemPattern
|
221
|
-
end
|
222
|
-
end
|
223
|
-
end
|
224
|
-
end
|
225
|
-
end
|
1
|
+
#Copyright (c) 2010, Nathaniel Ritmeyer. All rights reserved.
|
2
|
+
|
3
|
+
module Bewildr
|
4
|
+
class Element
|
5
|
+
attr_reader :automation_element
|
6
|
+
attr_reader :control_type
|
7
|
+
|
8
|
+
def initialize(input)
|
9
|
+
@automation_element = input
|
10
|
+
case input
|
11
|
+
when System::Windows::Automation::AutomationElement
|
12
|
+
set_control_type
|
13
|
+
build_element
|
14
|
+
include_additions
|
15
|
+
when nil then @control_type = :non_existent
|
16
|
+
else raise Bewildr::BewildrInternalError, "Can only initialize an element with a nil or a Sys::Win::Auto::AE[C], not a #{input.class}"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def name
|
21
|
+
existence_check
|
22
|
+
@automation_element.current.name.to_s
|
23
|
+
end
|
24
|
+
|
25
|
+
def automation_id
|
26
|
+
existence_check
|
27
|
+
@automation_element.current.automation_id.to_s
|
28
|
+
end
|
29
|
+
|
30
|
+
def exists?
|
31
|
+
return false if @control_type == :non_existent
|
32
|
+
begin
|
33
|
+
@automation_element.current.bounding_rectangle
|
34
|
+
return true
|
35
|
+
rescue System::Windows::Automation::ElementNotAvailableException, TypeError => e
|
36
|
+
return false
|
37
|
+
end
|
38
|
+
end
|
39
|
+
alias :exist? :exists?
|
40
|
+
|
41
|
+
def contains?(condition_hash)
|
42
|
+
get(condition_hash).exists?
|
43
|
+
end
|
44
|
+
alias :contain? :contains?
|
45
|
+
|
46
|
+
def enabled?
|
47
|
+
existence_check
|
48
|
+
@automation_element.current.is_enabled
|
49
|
+
end
|
50
|
+
|
51
|
+
def wait_for_existence_of(condition_hash)
|
52
|
+
Timeout.timeout(30) do
|
53
|
+
sleep 0.1 until contains?(condition_hash)
|
54
|
+
end
|
55
|
+
get(condition_hash)
|
56
|
+
end
|
57
|
+
|
58
|
+
def wait_for_non_existence_of(condition_hash)
|
59
|
+
Timeout.timeout(30) do
|
60
|
+
sleep 0.1 unless contains?(condition_hash)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def focus
|
65
|
+
@automation_element.set_focus
|
66
|
+
end
|
67
|
+
|
68
|
+
def scrollable?
|
69
|
+
return false unless @automation_element.get_supported_patterns.collect {|pattern| pattern.programmatic_name.to_s }.include?("ScrollPatternIdentifiers.Pattern")
|
70
|
+
vertically_scrollable
|
71
|
+
end
|
72
|
+
|
73
|
+
#:id => "id"
|
74
|
+
#:name => "bob"
|
75
|
+
#:type => :button
|
76
|
+
#:scope => :children / :descendants
|
77
|
+
#:how_many => :first / :all
|
78
|
+
def get(condition_hash)
|
79
|
+
existence_check
|
80
|
+
condition = Finder.condition_for(condition_hash)
|
81
|
+
scope = Finder.scope_for(condition_hash)
|
82
|
+
how_many = Finder.how_many_for(condition_hash)
|
83
|
+
|
84
|
+
result = @automation_element.send how_many, scope, condition
|
85
|
+
case result
|
86
|
+
when System::Windows::Automation::AutomationElement, nil then return Bewildr::Element.new(result)
|
87
|
+
when System::Windows::Automation::AutomationElementCollection
|
88
|
+
c_array_list = System::Collections::ArrayList.new(result)
|
89
|
+
element_array = c_array_list.to_array.to_a
|
90
|
+
case
|
91
|
+
when element_array.size == 0 then return Bewildr::Element.new(nil)
|
92
|
+
when element_array.size > 0 then return element_array.collect {|element| Bewildr::Element.new(element) }
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
#add "children/child" and "descendants/descendant" methods
|
98
|
+
|
99
|
+
def root?
|
100
|
+
@automation_element == System::Windows::Automation::AutomationElement.root_element
|
101
|
+
end
|
102
|
+
|
103
|
+
def parent
|
104
|
+
return nil if root?
|
105
|
+
walker = System::Windows::Automation::TreeWalker.RawViewWalker
|
106
|
+
potential_parent = walker.get_parent(@automation_element)
|
107
|
+
Bewildr::Element.new(potential_parent)
|
108
|
+
end
|
109
|
+
|
110
|
+
def has_children?
|
111
|
+
walker = System::Windows::Automation::TreeWalker.RawViewWalker
|
112
|
+
!walker.get_first_child(@automation_element).nil?
|
113
|
+
end
|
114
|
+
|
115
|
+
def children
|
116
|
+
return [] unless has_children?
|
117
|
+
walker = System::Windows::Automation::TreeWalker.ControlViewWalker #RawViewWalker
|
118
|
+
bewildred_children = []
|
119
|
+
child = walker.get_first_child(@automation_element)
|
120
|
+
while !child.nil? do
|
121
|
+
bewildred_children << Bewildr::Element.new(child)
|
122
|
+
child = walker.get_next_sibling(child)
|
123
|
+
end
|
124
|
+
bewildred_children
|
125
|
+
end
|
126
|
+
|
127
|
+
def click
|
128
|
+
CLICKR.click(clickable_point)
|
129
|
+
end
|
130
|
+
|
131
|
+
def double_click
|
132
|
+
CLICKR.double_click(clickable_point)
|
133
|
+
end
|
134
|
+
|
135
|
+
def right_click
|
136
|
+
CLICKR.right_click(clickable_point)
|
137
|
+
end
|
138
|
+
|
139
|
+
private
|
140
|
+
|
141
|
+
def existence_check
|
142
|
+
raise Bewildr::ElementDoesntExist unless exists?
|
143
|
+
end
|
144
|
+
|
145
|
+
def clickable_point
|
146
|
+
existence_check
|
147
|
+
Timeout.timeout(30) do
|
148
|
+
current_clickable_point = nil
|
149
|
+
begin
|
150
|
+
current_clickable_point = @automation_element.get_clickable_point
|
151
|
+
rescue System::Windows::Automation::NoClickablePointException
|
152
|
+
retry
|
153
|
+
end
|
154
|
+
return current_clickable_point
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
def prepare_element
|
159
|
+
load_all_items_hack if scrollable?
|
160
|
+
end
|
161
|
+
|
162
|
+
def set_control_type
|
163
|
+
@control_type = Bewildr::ControlType.symbol_for_enum(@automation_element.current.control_type)
|
164
|
+
end
|
165
|
+
|
166
|
+
def build_element
|
167
|
+
@automation_element.get_supported_patterns.each do |pattern|
|
168
|
+
pattern_name = pattern.programmatic_name.to_s.gsub(/Identifiers\.Pattern/, "")
|
169
|
+
potential_pattern = Bewildr::ControlPatterns.submodules.select {|mod| mod.name =~ /#{pattern_name}$/}.first
|
170
|
+
extend(potential_pattern) unless potential_pattern.nil?
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
#list of control types comes from http://msdn.microsoft.com/en-us/library/ms750574.aspx
|
175
|
+
def include_additions
|
176
|
+
case @control_type
|
177
|
+
when :combo_box then extend Bewildr::ControlTypeAdditions::ComboBoxAdditions
|
178
|
+
when :data_grid then extend Bewildr::ControlTypeAdditions::DataGridAdditions
|
179
|
+
when :document then extend Bewildr::ControlTypeAdditions::DocumentAdditions
|
180
|
+
when :hyperlink then extend Bewildr::ControlTypeAdditions::TextAdditions
|
181
|
+
when :list then extend Bewildr::ControlTypeAdditions::ListAdditions
|
182
|
+
when :menu then extend Bewildr::ControlTypeAdditions::MenuAdditions
|
183
|
+
when :menu_item then extend Bewildr::ControlTypeAdditions::MenuItemAdditions
|
184
|
+
when :tab then extend Bewildr::ControlTypeAdditions::TabAdditions
|
185
|
+
when :text then extend Bewildr::ControlTypeAdditions::TextAdditions
|
186
|
+
when :tree then extend Bewildr::ControlTypeAdditions::TreeAdditions
|
187
|
+
when :tree_item then extend Bewildr::ControlTypeAdditions::TreeItemAdditions
|
188
|
+
when :window then extend Bewildr::ControlTypeAdditions::WindowAdditions
|
189
|
+
end
|
190
|
+
|
191
|
+
#add scrolling capability if relevant - TODO: this ugliness will be fixed later
|
192
|
+
if @automation_element.get_supported_patterns.collect {|pattern| pattern.programmatic_name.to_s }.include?("ScrollPatternIdentifiers.Pattern")
|
193
|
+
extend Bewildr::ControlTypeAdditions::ScrollAdditions
|
194
|
+
end
|
195
|
+
end
|
196
|
+
end
|
197
|
+
end
|
Binary file
|
@@ -0,0 +1,10 @@
|
|
1
|
+
#Copyright (c) 2010, Nathaniel Ritmeyer. All rights reserved.
|
2
|
+
|
3
|
+
#the following taken from: http://www.natontesting.com/2010/06/30/how-to-get-the-submodules-of-a-ruby-module/
|
4
|
+
|
5
|
+
#adds the submodules method to modules - returns a list of submodules in the module's namespace
|
6
|
+
class Module
|
7
|
+
def submodules
|
8
|
+
constants.collect {|const_name| const_get(const_name)}.select {|const| const.class == Module}
|
9
|
+
end
|
10
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bewildr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 7
|
10
|
+
version: 0.1.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Nat Ritmeyer
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-11-27 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -63,6 +63,7 @@ files:
|
|
63
63
|
- lib/bewildr/element.rb
|
64
64
|
- lib/bewildr/exceptions.rb
|
65
65
|
- lib/bewildr/ext/BewildrClickr.dll
|
66
|
+
- lib/bewildr/ext/extensions.rb
|
66
67
|
- lib/bewildr/finder.rb
|
67
68
|
- lib/bewildr/windows.rb
|
68
69
|
- lib/bewildr.rb
|