mohawk 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog +17 -0
- data/Gemfile +1 -5
- data/README.md +29 -0
- data/features/label.feature +4 -0
- data/features/menu.feature +5 -0
- data/features/mohawk.feature +14 -0
- data/features/step_definitions/label_steps.rb +3 -0
- data/features/step_definitions/menu_steps.rb +5 -0
- data/features/step_definitions/mohawk_steps.rb +15 -0
- data/features/step_definitions/table_steps.rb +23 -0
- data/features/step_definitions/text_steps.rb +4 -0
- data/features/step_definitions/tree_view_steps.rb +31 -0
- data/features/support/WindowsForms.exe +0 -0
- data/features/support/screens/data_entry_form.rb +6 -0
- data/features/support/screens/main_screen.rb +4 -0
- data/features/support/string.rb +4 -0
- data/features/table.feature +19 -0
- data/features/text.feature +4 -0
- data/features/tree_view.feature +49 -0
- data/lib/mohawk.rb +41 -0
- data/lib/mohawk/accessors.rb +182 -1
- data/lib/mohawk/accessors/label.rb +13 -0
- data/lib/mohawk/accessors/menu_item.rb +21 -0
- data/lib/mohawk/accessors/table.rb +50 -0
- data/lib/mohawk/accessors/text.rb +6 -0
- data/lib/mohawk/accessors/tree_view.rb +30 -0
- data/lib/mohawk/adapters/uia_adapter.rb +16 -0
- data/lib/mohawk/navigation.rb +4 -3
- data/lib/mohawk/version.rb +1 -1
- data/mohawk.gemspec +4 -2
- data/spec/lib/mohawk/accessors/combo_spec.rb +28 -1
- data/spec/lib/mohawk/accessors/label_spec.rb +25 -0
- data/spec/lib/mohawk/accessors/menu_spec.rb +32 -0
- data/spec/lib/mohawk/accessors/table_spec.rb +96 -0
- data/spec/lib/mohawk/accessors/text_spec.rb +9 -0
- data/spec/lib/mohawk/accessors/tree_view_spec.rb +86 -0
- data/spec/lib/mohawk_spec.rb +26 -0
- data/spec/lib/navigation_spec.rb +34 -0
- metadata +74 -9
- data/features/fado.feature +0 -5
- data/features/step_definitions/fado_steps.rb +0 -7
data/spec/lib/mohawk_spec.rb
CHANGED
@@ -19,12 +19,38 @@ describe Mohawk do
|
|
19
19
|
context "using the UI Automation adapter" do
|
20
20
|
before(:each) do
|
21
21
|
RAutomation::Window.stub(:new).and_return(window)
|
22
|
+
RAutomation::WaitHelper.stub(:sleep)
|
22
23
|
end
|
23
24
|
|
24
25
|
it "knows if a window exists" do
|
25
26
|
window.should_receive(:exist?)
|
26
27
|
screen.exist?
|
27
28
|
end
|
29
|
+
|
30
|
+
it "knows if a window is active or not" do
|
31
|
+
window.should_receive(:active?)
|
32
|
+
screen.active?
|
33
|
+
end
|
34
|
+
|
35
|
+
it "knows if the window is present" do
|
36
|
+
window.should_receive(:present?)
|
37
|
+
screen.present?
|
38
|
+
end
|
39
|
+
|
40
|
+
it "can hold off until the window is present" do
|
41
|
+
window.should_receive(:wait_until_present)
|
42
|
+
screen.wait_until_present
|
43
|
+
end
|
44
|
+
|
45
|
+
it "can hold off until I say so" do
|
46
|
+
window.should_receive(:present?).twice.and_return(false, true)
|
47
|
+
screen.wait_until {screen.present?}
|
48
|
+
end
|
49
|
+
|
50
|
+
it "knows if a window has text" do
|
51
|
+
window.should_receive(:text).and_return("lots of text but I wanted to find blardy blar blar")
|
52
|
+
screen.should have_text "blardy blar"
|
53
|
+
end
|
28
54
|
|
29
55
|
end
|
30
56
|
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
class NavigationTestScreen
|
4
|
+
end
|
5
|
+
|
6
|
+
include Mohawk::Navigation
|
7
|
+
|
8
|
+
describe Mohawk::Navigation do
|
9
|
+
let(:screen) { double("Mohawk Screen").as_null_object }
|
10
|
+
|
11
|
+
before(:each) do
|
12
|
+
NavigationTestScreen.stub(:new).and_return(screen)
|
13
|
+
RAutomation::WaitHelper.stub(:sleep)
|
14
|
+
end
|
15
|
+
|
16
|
+
it "can create screen objects" do
|
17
|
+
on(NavigationTestScreen).should eq screen
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should give the screen to a block if desired" do
|
21
|
+
screen.should_receive(:expected_method)
|
22
|
+
on(NavigationTestScreen) do |screen|
|
23
|
+
screen.expected_method
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
it "waits for the screen to be present before proceeding" do
|
28
|
+
screen.should_receive(:wait_until_present)
|
29
|
+
screen.should_receive(:was_used)
|
30
|
+
on(NavigationTestScreen) do |screen|
|
31
|
+
screen.was_used
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mohawk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-12-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rautomation
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 0.8.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,9 +26,9 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 0.8.0
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
|
-
name:
|
31
|
+
name: cucumber
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
none: false
|
34
34
|
requirements:
|
@@ -59,6 +59,38 @@ dependencies:
|
|
59
59
|
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rake
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: childprocess
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
62
94
|
description: High level wrapper around windows applications
|
63
95
|
email:
|
64
96
|
- levi@leviwilson.com
|
@@ -77,26 +109,39 @@ files:
|
|
77
109
|
- features/button.feature
|
78
110
|
- features/checkbox.feature
|
79
111
|
- features/combo_box.feature
|
80
|
-
- features/
|
112
|
+
- features/label.feature
|
113
|
+
- features/menu.feature
|
114
|
+
- features/mohawk.feature
|
81
115
|
- features/radio.feature
|
82
116
|
- features/step_definitions/button_steps.rb
|
83
117
|
- features/step_definitions/checkbox_steps.rb
|
84
118
|
- features/step_definitions/combo_box_steps.rb
|
85
|
-
- features/step_definitions/
|
119
|
+
- features/step_definitions/label_steps.rb
|
120
|
+
- features/step_definitions/menu_steps.rb
|
121
|
+
- features/step_definitions/mohawk_steps.rb
|
86
122
|
- features/step_definitions/radio_steps.rb
|
123
|
+
- features/step_definitions/table_steps.rb
|
87
124
|
- features/step_definitions/text_steps.rb
|
125
|
+
- features/step_definitions/tree_view_steps.rb
|
88
126
|
- features/support/WindowsForms.exe
|
89
127
|
- features/support/env.rb
|
128
|
+
- features/support/screens/data_entry_form.rb
|
90
129
|
- features/support/screens/main_screen.rb
|
91
130
|
- features/support/string.rb
|
131
|
+
- features/table.feature
|
92
132
|
- features/text.feature
|
133
|
+
- features/tree_view.feature
|
93
134
|
- lib/mohawk.rb
|
94
135
|
- lib/mohawk/accessors.rb
|
95
136
|
- lib/mohawk/accessors/button.rb
|
96
137
|
- lib/mohawk/accessors/checkbox.rb
|
97
138
|
- lib/mohawk/accessors/combo.rb
|
139
|
+
- lib/mohawk/accessors/label.rb
|
140
|
+
- lib/mohawk/accessors/menu_item.rb
|
98
141
|
- lib/mohawk/accessors/radio.rb
|
142
|
+
- lib/mohawk/accessors/table.rb
|
99
143
|
- lib/mohawk/accessors/text.rb
|
144
|
+
- lib/mohawk/accessors/tree_view.rb
|
100
145
|
- lib/mohawk/adapters/uia_adapter.rb
|
101
146
|
- lib/mohawk/navigation.rb
|
102
147
|
- lib/mohawk/version.rb
|
@@ -104,9 +149,14 @@ files:
|
|
104
149
|
- spec/lib/mohawk/accessors/button_spec.rb
|
105
150
|
- spec/lib/mohawk/accessors/checkbox_spec.rb
|
106
151
|
- spec/lib/mohawk/accessors/combo_spec.rb
|
152
|
+
- spec/lib/mohawk/accessors/label_spec.rb
|
153
|
+
- spec/lib/mohawk/accessors/menu_spec.rb
|
107
154
|
- spec/lib/mohawk/accessors/radio_spec.rb
|
155
|
+
- spec/lib/mohawk/accessors/table_spec.rb
|
108
156
|
- spec/lib/mohawk/accessors/text_spec.rb
|
157
|
+
- spec/lib/mohawk/accessors/tree_view_spec.rb
|
109
158
|
- spec/lib/mohawk_spec.rb
|
159
|
+
- spec/lib/navigation_spec.rb
|
110
160
|
- spec/spec_helper.rb
|
111
161
|
homepage: http://github.com/leviwilson/mohawk
|
112
162
|
licenses: []
|
@@ -136,23 +186,38 @@ test_files:
|
|
136
186
|
- features/button.feature
|
137
187
|
- features/checkbox.feature
|
138
188
|
- features/combo_box.feature
|
139
|
-
- features/
|
189
|
+
- features/label.feature
|
190
|
+
- features/menu.feature
|
191
|
+
- features/mohawk.feature
|
140
192
|
- features/radio.feature
|
141
193
|
- features/step_definitions/button_steps.rb
|
142
194
|
- features/step_definitions/checkbox_steps.rb
|
143
195
|
- features/step_definitions/combo_box_steps.rb
|
144
|
-
- features/step_definitions/
|
196
|
+
- features/step_definitions/label_steps.rb
|
197
|
+
- features/step_definitions/menu_steps.rb
|
198
|
+
- features/step_definitions/mohawk_steps.rb
|
145
199
|
- features/step_definitions/radio_steps.rb
|
200
|
+
- features/step_definitions/table_steps.rb
|
146
201
|
- features/step_definitions/text_steps.rb
|
202
|
+
- features/step_definitions/tree_view_steps.rb
|
147
203
|
- features/support/WindowsForms.exe
|
148
204
|
- features/support/env.rb
|
205
|
+
- features/support/screens/data_entry_form.rb
|
149
206
|
- features/support/screens/main_screen.rb
|
150
207
|
- features/support/string.rb
|
208
|
+
- features/table.feature
|
151
209
|
- features/text.feature
|
210
|
+
- features/tree_view.feature
|
152
211
|
- spec/lib/mohawk/accessors/button_spec.rb
|
153
212
|
- spec/lib/mohawk/accessors/checkbox_spec.rb
|
154
213
|
- spec/lib/mohawk/accessors/combo_spec.rb
|
214
|
+
- spec/lib/mohawk/accessors/label_spec.rb
|
215
|
+
- spec/lib/mohawk/accessors/menu_spec.rb
|
155
216
|
- spec/lib/mohawk/accessors/radio_spec.rb
|
217
|
+
- spec/lib/mohawk/accessors/table_spec.rb
|
156
218
|
- spec/lib/mohawk/accessors/text_spec.rb
|
219
|
+
- spec/lib/mohawk/accessors/tree_view_spec.rb
|
157
220
|
- spec/lib/mohawk_spec.rb
|
221
|
+
- spec/lib/navigation_spec.rb
|
158
222
|
- spec/spec_helper.rb
|
223
|
+
has_rdoc:
|
data/features/fado.feature
DELETED