operawatir 0.4.1.pre5-jruby → 0.4.1.pre6-jruby
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +1 -0
- data/CHANGES +170 -3
- data/README.md +30 -27
- data/VERSION +1 -1
- data/bin/desktopwatir +19 -16
- data/bin/operawatir +4 -4
- data/lib/operadriver/client-combined-nodeps.jar +0 -0
- data/lib/operadriver/webdriver-opera.jar +0 -0
- data/lib/operawatir/browser.rb +1 -2
- data/lib/operawatir/collection.rb +1 -1
- data/lib/operawatir/compat/collection.rb +13 -0
- data/lib/operawatir/compat/element.rb +57 -15
- data/lib/operawatir/compat/window.rb +41 -0
- data/lib/operawatir/desktop_browser.rb +26 -9
- data/lib/operawatir/desktop_container.rb +82 -29
- data/lib/operawatir/element.rb +48 -24
- data/lib/operawatir/keys.rb +18 -25
- data/lib/operawatir/preferences.rb +223 -6
- data/lib/operawatir/quickwidgets/quick_button.rb +8 -2
- data/lib/operawatir/quickwidgets/quick_checkbox.rb +4 -4
- data/lib/operawatir/quickwidgets/quick_editfield.rb +1 -1
- data/lib/operawatir/quickwidgets/quick_find.rb +11 -0
- data/lib/operawatir/quickwidgets/quick_griditem.rb +11 -0
- data/lib/operawatir/quickwidgets/quick_gridlayout.rb +11 -0
- data/lib/operawatir/quickwidgets/quick_searchfield.rb +5 -1
- data/lib/operawatir/quickwidgets/quick_tab.rb +0 -1
- data/lib/operawatir/quickwidgets/quick_treeitem.rb +22 -1
- data/lib/operawatir/quickwidgets/quick_widget.rb +61 -22
- data/lib/operawatir/quickwidgets/quick_window.rb +26 -0
- data/lib/operawatir/quickwidgets.rb +2 -1
- data/lib/operawatir/window.rb +36 -25
- data/lib/operawatir.rb +1 -1
- data/operawatir.gemspec +38 -5
- data/spec/operawatir/core/element_spec.rb +5 -0
- data/spec/operawatir/core/window_spec.rb +42 -0
- data/spec/operawatir/desktop/desktopbrowser_spec.rb +16 -0
- data/spec/operawatir/desktop/quickaddressfield_spec.rb +15 -3
- data/spec/operawatir/desktop/quickbutton_spec.rb +234 -20
- data/spec/operawatir/desktop/quickcheckbox_spec.rb +36 -0
- data/spec/operawatir/desktop/quickdialogtab_spec.rb +30 -0
- data/spec/operawatir/desktop/quickdropdown_spec.rb +39 -0
- data/spec/operawatir/desktop/quickeditfield_spec.rb +51 -0
- data/spec/operawatir/desktop/quickfind_spec.rb +30 -0
- data/spec/operawatir/desktop/quickgriditem_spec.rb +16 -0
- data/spec/operawatir/desktop/quickgridlayout_spec.rb +15 -0
- data/spec/operawatir/desktop/quicklabel_spec.rb +28 -0
- data/spec/operawatir/desktop/quickradiobutton_spec.rb +24 -0
- data/spec/operawatir/desktop/quicksearchfield_spec.rb +26 -0
- data/spec/operawatir/desktop/quicktab_spec.rb +86 -0
- data/spec/operawatir/desktop/quickthumbnail_spec.rb +37 -0
- data/spec/operawatir/desktop/quicktreeitem_spec.rb +135 -0
- data/spec/operawatir/desktop/quicktreeview_spec.rb +30 -0
- data/spec/operawatir/desktop/quickwidget_spec.rb +52 -11
- data/spec/operawatir/desktop/quickwindow_spec.rb +11 -0
- data/spec/operawatir/desktop/shared/shared.rb +100 -10
- data/spec/operawatir/fixtures/browsers.svg +367 -0
- data/spec/operawatir/fixtures/frames.html +13 -0
- data/spec/watir2/select_list_spec.rb +84 -71
- metadata +37 -4
- data/lib/operadriver/selenium-common.jar +0 -0
@@ -14,21 +14,18 @@ describe "SelectList" do
|
|
14
14
|
browser.select_list(:id, /new_user_country/).should exist
|
15
15
|
browser.select_list(:name, 'new_user_country').should exist
|
16
16
|
browser.select_list(:name, /new_user_country/).should exist
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
|
18
|
+
not_compliant_on :webdriver do
|
19
|
+
browser.select_list(:text, 'Norway').should exist
|
20
|
+
browser.select_list(:text, /Norway/).should exist
|
21
|
+
end
|
22
|
+
|
22
23
|
browser.select_list(:class, 'country').should exist
|
23
24
|
browser.select_list(:class, /country/).should exist
|
24
|
-
browser.select_list(:index,
|
25
|
+
browser.select_list(:index, 0).should exist
|
25
26
|
browser.select_list(:xpath, "//select[@id='new_user_country']").should exist
|
26
27
|
end
|
27
28
|
|
28
|
-
it "returns true if the element exists (default how = :name)" do
|
29
|
-
browser.select_list("new_user_country").should exist
|
30
|
-
end
|
31
|
-
|
32
29
|
it "returns the first select if given no args" do
|
33
30
|
browser.select_list.should exist
|
34
31
|
end
|
@@ -70,7 +67,7 @@ describe "SelectList" do
|
|
70
67
|
|
71
68
|
describe "#id" do
|
72
69
|
it "returns the id of the element" do
|
73
|
-
browser.select_list(:index,
|
70
|
+
browser.select_list(:index, 0).id.should == "new_user_country"
|
74
71
|
end
|
75
72
|
|
76
73
|
it "raises UnknownObjectException if the select list doesn't exist" do
|
@@ -80,7 +77,7 @@ describe "SelectList" do
|
|
80
77
|
|
81
78
|
describe "#name" do
|
82
79
|
it "returns the name of the element" do
|
83
|
-
browser.select_list(:index,
|
80
|
+
browser.select_list(:index, 0).name.should == "new_user_country"
|
84
81
|
end
|
85
82
|
|
86
83
|
it "raises UnknownObjectException if the select list doesn't exist" do
|
@@ -88,22 +85,22 @@ describe "SelectList" do
|
|
88
85
|
end
|
89
86
|
end
|
90
87
|
|
91
|
-
describe "#
|
92
|
-
it "
|
93
|
-
browser.select_list(:index,
|
94
|
-
browser.select_list(:index,
|
88
|
+
describe "#multiple?" do
|
89
|
+
it "knows whether the select list allows multiple slections" do
|
90
|
+
browser.select_list(:index, 0).should_not be_multiple
|
91
|
+
browser.select_list(:index, 1).should be_multiple
|
95
92
|
end
|
96
93
|
|
97
94
|
it "raises UnknownObjectException if the select list doesn't exist" do
|
98
|
-
lambda { browser.select_list(:index, 1337).
|
95
|
+
lambda { browser.select_list(:index, 1337).multiple? }.should raise_error(UnknownObjectException)
|
99
96
|
end
|
100
97
|
end
|
101
98
|
|
102
99
|
describe "#value" do
|
103
100
|
it "returns the value of the selected option" do
|
104
|
-
browser.select_list(:index,
|
105
|
-
browser.select_list(:index,
|
106
|
-
browser.select_list(:index,
|
101
|
+
browser.select_list(:index, 0).value.should == "2"
|
102
|
+
browser.select_list(:index, 0).select(/Sweden/)
|
103
|
+
browser.select_list(:index, 0).value.should == "3"
|
107
104
|
end
|
108
105
|
|
109
106
|
it "raises UnknownObjectException if the select list doesn't exist" do
|
@@ -113,11 +110,10 @@ describe "SelectList" do
|
|
113
110
|
|
114
111
|
describe "#respond_to?" do
|
115
112
|
it "returns true for all attribute methods" do
|
116
|
-
browser.select_list(:index,
|
117
|
-
browser.select_list(:index,
|
118
|
-
browser.select_list(:index,
|
119
|
-
browser.select_list(:index,
|
120
|
-
browser.select_list(:index, 1).should respond_to(:value)
|
113
|
+
browser.select_list(:index, 0).should respond_to(:class_name)
|
114
|
+
browser.select_list(:index, 0).should respond_to(:id)
|
115
|
+
browser.select_list(:index, 0).should respond_to(:name)
|
116
|
+
browser.select_list(:index, 0).should respond_to(:value)
|
121
117
|
end
|
122
118
|
end
|
123
119
|
|
@@ -138,14 +134,14 @@ describe "SelectList" do
|
|
138
134
|
|
139
135
|
describe "#disabled?" do
|
140
136
|
it "returns true if the select list is disabled" do
|
141
|
-
browser.select_list(:index,
|
137
|
+
browser.select_list(:index, 2).should be_disabled
|
142
138
|
end
|
143
139
|
|
144
140
|
it "returns false if the select list is enabled" do
|
145
|
-
browser.select_list(:index,
|
141
|
+
browser.select_list(:index, 0).should_not be_disabled
|
146
142
|
end
|
147
143
|
|
148
|
-
it "
|
144
|
+
it "should raise UnknownObjectException when the select list does not exist" do
|
149
145
|
lambda { browser.select_list(:index, 1337).disabled? }.should raise_error(UnknownObjectException)
|
150
146
|
end
|
151
147
|
end
|
@@ -160,19 +156,31 @@ describe "SelectList" do
|
|
160
156
|
end
|
161
157
|
|
162
158
|
describe "#options" do
|
163
|
-
it "
|
159
|
+
it "should raise UnknownObjectException if the select list doesn't exist" do
|
164
160
|
lambda { browser.select_list(:name, 'no_such_name').options }.should raise_error(UnknownObjectException)
|
165
161
|
end
|
166
162
|
|
167
|
-
|
163
|
+
#
|
164
|
+
# The correct behaviour here needs to be discussed.
|
165
|
+
#
|
166
|
+
|
167
|
+
not_compliant_on :webdriver do
|
168
168
|
it "returns all the options as an Array" do
|
169
|
-
browser.select_list(:name, "new_user_country").options.should == ["Denmark"
|
169
|
+
browser.select_list(:name, "new_user_country").options.should == ["Denmark", "Norway", "Sweden", "United Kingdom", "USA", "Germany"]
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
deviates_on :webdriver do
|
174
|
+
it "returns all the options as a collection of Options" do
|
175
|
+
options = browser.select_list(:name, "new_user_country").options
|
176
|
+
options.should be_kind_of(OptionCollection)
|
177
|
+
options.map { |opt| opt.text }.should == ["Denmark", "Norway", "Sweden", "United Kingdom", "USA", "Germany"]
|
170
178
|
end
|
171
179
|
end
|
172
180
|
end
|
173
181
|
|
174
182
|
describe "#selected_options" do
|
175
|
-
it "
|
183
|
+
it "should raise UnknownObjectException if the select list doesn't exist" do
|
176
184
|
lambda { browser.select_list(:name, 'no_such_name').selected_options }.should raise_error(UnknownObjectException)
|
177
185
|
end
|
178
186
|
|
@@ -189,7 +197,7 @@ describe "SelectList" do
|
|
189
197
|
end
|
190
198
|
|
191
199
|
it "does not clear selections when not possible" do
|
192
|
-
browser.select_list(:name
|
200
|
+
lambda { browser.select_list(:name, "new_user_country").clear }.should raise_error
|
193
201
|
browser.select_list(:name, "new_user_country").selected_options.should == ["Norway"]
|
194
202
|
end
|
195
203
|
|
@@ -198,24 +206,24 @@ describe "SelectList" do
|
|
198
206
|
end
|
199
207
|
end
|
200
208
|
|
201
|
-
describe "#
|
209
|
+
describe "#include?" do
|
202
210
|
it "returns true if the given option exists" do
|
203
|
-
browser.select_list(:name, 'new_user_country').
|
211
|
+
browser.select_list(:name, 'new_user_country').should include('Denmark')
|
204
212
|
end
|
205
213
|
|
206
214
|
it "returns false if the given option doesn't exist" do
|
207
|
-
browser.select_list(:name, 'new_user_country').
|
215
|
+
browser.select_list(:name, 'new_user_country').should_not include('Ireland')
|
208
216
|
end
|
209
217
|
end
|
210
218
|
|
211
219
|
describe "#selected?" do
|
212
220
|
it "returns true if the given option is selected" do
|
213
221
|
browser.select_list(:name, 'new_user_country').select('Denmark')
|
214
|
-
browser.select_list(:name, 'new_user_country').
|
222
|
+
browser.select_list(:name, 'new_user_country').should be_selected('Denmark')
|
215
223
|
end
|
216
224
|
|
217
225
|
it "returns false if the given option is not selected" do
|
218
|
-
browser.select_list(:name, 'new_user_country').
|
226
|
+
browser.select_list(:name, 'new_user_country').should_not be_selected('Sweden')
|
219
227
|
end
|
220
228
|
|
221
229
|
it "raises UnknonwObjectException if the option doesn't exist" do
|
@@ -251,18 +259,16 @@ describe "SelectList" do
|
|
251
259
|
browser.select_list(:name, "new_user_languages").selected_options.should == ["Danish", "Swedish"]
|
252
260
|
end
|
253
261
|
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
end
|
262
|
+
it "selects multiple items using :name and a Regexp" do
|
263
|
+
browser.select_list(:name, "new_user_languages").clear
|
264
|
+
browser.select_list(:name, "new_user_languages").select(/ish/)
|
265
|
+
browser.select_list(:name, "new_user_languages").selected_options.should == ["Danish", "English", "Swedish"]
|
266
|
+
end
|
260
267
|
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
end
|
268
|
+
it "selects multiple items using :xpath" do
|
269
|
+
browser.select_list(:xpath, "//select[@name='new_user_languages']").clear
|
270
|
+
browser.select_list(:xpath, "//select[@name='new_user_languages']").select(/ish/)
|
271
|
+
browser.select_list(:xpath, "//select[@name='new_user_languages']").selected_options.should == ["Danish", "English", "Swedish"]
|
266
272
|
end
|
267
273
|
|
268
274
|
it "selects empty options" do
|
@@ -270,14 +276,12 @@ describe "SelectList" do
|
|
270
276
|
browser.select_list(:id, "delete_user_username").selected_options.should == [""]
|
271
277
|
end
|
272
278
|
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
end
|
279
|
+
it "returns the value selected" do
|
280
|
+
browser.select_list(:name, "new_user_languages").select("Danish").should == "Danish"
|
281
|
+
end
|
277
282
|
|
278
|
-
|
279
|
-
|
280
|
-
end
|
283
|
+
it "returns the first matching value if there are multiple matches" do
|
284
|
+
browser.select_list(:name, "new_user_languages").select(/ish/).should == "Danish"
|
281
285
|
end
|
282
286
|
|
283
287
|
it "fires onchange event when selecting an item" do
|
@@ -285,23 +289,34 @@ describe "SelectList" do
|
|
285
289
|
messages.should == ['changed language']
|
286
290
|
end
|
287
291
|
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
messages.size.should == 3
|
292
|
+
it "doesn't fire onchange event when selecting an already selected item" do
|
293
|
+
browser.select_list(:id, "new_user_languages").clear # removes the two pre-selected options
|
294
|
+
browser.select_list(:id, "new_user_languages").select("English")
|
295
|
+
messages.size.should == 3
|
293
296
|
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
+
browser.select_list(:id, "new_user_languages").select("English")
|
298
|
+
messages.size.should == 3
|
299
|
+
end
|
300
|
+
|
301
|
+
it "returns the text of the selected option" do
|
302
|
+
browser.select_list(:id, "new_user_languages").select("English").should == "English"
|
303
|
+
end
|
304
|
+
|
305
|
+
it "returns an empty string when selecting an option that disappears when selected" do
|
306
|
+
browser.select_list(:id, 'obsolete').select('sweden').should == ''
|
297
307
|
end
|
298
308
|
|
299
309
|
it "raises NoValueFoundException if the option doesn't exist" do
|
300
310
|
lambda { browser.select_list(:name, "new_user_country").select("missing_option") }.should raise_error(NoValueFoundException)
|
301
311
|
lambda { browser.select_list(:name, "new_user_country").select(/missing_option/) }.should raise_error(NoValueFoundException)
|
302
312
|
end
|
303
|
-
end
|
304
313
|
|
314
|
+
it "raises a TypeError if argument is not a String, Regexp or Numeric" do
|
315
|
+
lambda { browser.select_list(:id, "new_user_languages").select([]) }.should raise_error(TypeError)
|
316
|
+
end
|
317
|
+
end
|
318
|
+
|
319
|
+
# deprecate?
|
305
320
|
describe "#select_value" do
|
306
321
|
it "selects the item by value string" do
|
307
322
|
browser.select_list(:name, "new_user_languages").clear
|
@@ -309,12 +324,10 @@ describe "SelectList" do
|
|
309
324
|
browser.select_list(:name, "new_user_languages").selected_options.should == %w[English]
|
310
325
|
end
|
311
326
|
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
browser.select_list(:name, "new_user_languages").selected_options.should == %w[Danish Norwegian]
|
317
|
-
end
|
327
|
+
it "selects the items by value regexp" do
|
328
|
+
browser.select_list(:name, "new_user_languages").clear
|
329
|
+
browser.select_list(:name, "new_user_languages").select_value(/1|3/)
|
330
|
+
browser.select_list(:name, "new_user_languages").selected_options.should == %w[Danish Norwegian]
|
318
331
|
end
|
319
332
|
|
320
333
|
it "raises NoValueFoundException if the option doesn't exist" do
|
metadata
CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
|
|
6
6
|
- 0
|
7
7
|
- 4
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.4.1.
|
9
|
+
- pre6
|
10
|
+
version: 0.4.1.pre6
|
11
11
|
platform: jruby
|
12
12
|
authors:
|
13
13
|
- Andreas Tolf Tolfsen
|
@@ -18,7 +18,7 @@ autorequire:
|
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
20
|
|
21
|
-
date: 2011-
|
21
|
+
date: 2011-05-09 00:00:00 +02:00
|
22
22
|
default_executable:
|
23
23
|
dependencies:
|
24
24
|
- !ruby/object:Gem::Dependency
|
@@ -295,10 +295,10 @@ files:
|
|
295
295
|
- bin/operawatir
|
296
296
|
- lib/operadriver/APACHE_2.0_LICENSE.txt
|
297
297
|
- lib/operadriver/NEW_BSD_LICENSE.txt
|
298
|
+
- lib/operadriver/client-combined-nodeps.jar
|
298
299
|
- lib/operadriver/commons-io-2.0.1.jar
|
299
300
|
- lib/operadriver/commons-jxpath-1.3.jar
|
300
301
|
- lib/operadriver/protobuf-java-2.3.0.jar
|
301
|
-
- lib/operadriver/selenium-common.jar
|
302
302
|
- lib/operadriver/webdriver-opera.jar
|
303
303
|
- lib/operawatir.rb
|
304
304
|
- lib/operawatir/browser.rb
|
@@ -330,6 +330,9 @@ files:
|
|
330
330
|
- lib/operawatir/quickwidgets/quick_dialogtab.rb
|
331
331
|
- lib/operawatir/quickwidgets/quick_dropdown.rb
|
332
332
|
- lib/operawatir/quickwidgets/quick_editfield.rb
|
333
|
+
- lib/operawatir/quickwidgets/quick_find.rb
|
334
|
+
- lib/operawatir/quickwidgets/quick_griditem.rb
|
335
|
+
- lib/operawatir/quickwidgets/quick_gridlayout.rb
|
333
336
|
- lib/operawatir/quickwidgets/quick_label.rb
|
334
337
|
- lib/operawatir/quickwidgets/quick_radiobutton.rb
|
335
338
|
- lib/operawatir/quickwidgets/quick_searchfield.rb
|
@@ -368,10 +371,26 @@ files:
|
|
368
371
|
- spec/operawatir/desktop/desktopbrowser_spec.rb
|
369
372
|
- spec/operawatir/desktop/quickaddressfield_spec.rb
|
370
373
|
- spec/operawatir/desktop/quickbutton_spec.rb
|
374
|
+
- spec/operawatir/desktop/quickcheckbox_spec.rb
|
375
|
+
- spec/operawatir/desktop/quickdialogtab_spec.rb
|
376
|
+
- spec/operawatir/desktop/quickdropdown_spec.rb
|
377
|
+
- spec/operawatir/desktop/quickeditfield_spec.rb
|
378
|
+
- spec/operawatir/desktop/quickfind_spec.rb
|
379
|
+
- spec/operawatir/desktop/quickgriditem_spec.rb
|
380
|
+
- spec/operawatir/desktop/quickgridlayout_spec.rb
|
381
|
+
- spec/operawatir/desktop/quicklabel_spec.rb
|
382
|
+
- spec/operawatir/desktop/quickradiobutton_spec.rb
|
383
|
+
- spec/operawatir/desktop/quicksearchfield_spec.rb
|
384
|
+
- spec/operawatir/desktop/quicktab_spec.rb
|
385
|
+
- spec/operawatir/desktop/quickthumbnail_spec.rb
|
386
|
+
- spec/operawatir/desktop/quicktreeitem_spec.rb
|
387
|
+
- spec/operawatir/desktop/quicktreeview_spec.rb
|
371
388
|
- spec/operawatir/desktop/quickwidget_spec.rb
|
372
389
|
- spec/operawatir/desktop/quickwindow_spec.rb
|
373
390
|
- spec/operawatir/desktop/shared/shared.rb
|
374
391
|
- spec/operawatir/fixtures/boxes.html
|
392
|
+
- spec/operawatir/fixtures/browsers.svg
|
393
|
+
- spec/operawatir/fixtures/frames.html
|
375
394
|
- spec/operawatir/fixtures/grid.html
|
376
395
|
- spec/operawatir/fixtures/input_fields_value.html
|
377
396
|
- spec/operawatir/fixtures/onclick.html
|
@@ -562,6 +581,20 @@ test_files:
|
|
562
581
|
- spec/operawatir/desktop/desktopbrowser_spec.rb
|
563
582
|
- spec/operawatir/desktop/quickaddressfield_spec.rb
|
564
583
|
- spec/operawatir/desktop/quickbutton_spec.rb
|
584
|
+
- spec/operawatir/desktop/quickcheckbox_spec.rb
|
585
|
+
- spec/operawatir/desktop/quickdialogtab_spec.rb
|
586
|
+
- spec/operawatir/desktop/quickdropdown_spec.rb
|
587
|
+
- spec/operawatir/desktop/quickeditfield_spec.rb
|
588
|
+
- spec/operawatir/desktop/quickfind_spec.rb
|
589
|
+
- spec/operawatir/desktop/quickgriditem_spec.rb
|
590
|
+
- spec/operawatir/desktop/quickgridlayout_spec.rb
|
591
|
+
- spec/operawatir/desktop/quicklabel_spec.rb
|
592
|
+
- spec/operawatir/desktop/quickradiobutton_spec.rb
|
593
|
+
- spec/operawatir/desktop/quicksearchfield_spec.rb
|
594
|
+
- spec/operawatir/desktop/quicktab_spec.rb
|
595
|
+
- spec/operawatir/desktop/quickthumbnail_spec.rb
|
596
|
+
- spec/operawatir/desktop/quicktreeitem_spec.rb
|
597
|
+
- spec/operawatir/desktop/quicktreeview_spec.rb
|
565
598
|
- spec/operawatir/desktop/quickwidget_spec.rb
|
566
599
|
- spec/operawatir/desktop/quickwindow_spec.rb
|
567
600
|
- spec/operawatir/desktop/shared/shared.rb
|
Binary file
|