operawatir 0.3-jruby → 0.3.2-jruby
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +6 -2
- data/LICENSE +1 -1
- data/Rakefile +7 -8
- data/VERSION +1 -1
- data/bin/desktopwatir +3 -0
- data/bin/operawatir +2 -2
- data/lib/operadriver/webdriver-opera.jar +0 -0
- data/lib/operawatir.rb +14 -8
- data/lib/operawatir/browser.rb +49 -38
- data/lib/operawatir/compat/collection.rb +6 -0
- data/lib/operawatir/compat/element.rb +5 -2
- data/lib/operawatir/compat/element_finders.rb +19 -0
- data/lib/operawatir/desktop-waiter.rb +144 -0
- data/lib/operawatir/desktop_browser.rb +506 -0
- data/lib/operawatir/desktop_common.rb +111 -0
- data/lib/operawatir/desktop_container.rb +252 -0
- data/lib/operawatir/desktop_enums.rb +42 -0
- data/lib/operawatir/desktop_exceptions.rb +16 -0
- data/lib/operawatir/element.rb +6 -6
- data/lib/operawatir/exceptions.rb +3 -0
- data/lib/operawatir/keys.rb +116 -0
- data/lib/operawatir/platform.rb +59 -0
- data/lib/operawatir/quickwidgets.rb +3 -0
- data/lib/operawatir/quickwidgets/quick_addressfield.rb +23 -0
- data/lib/operawatir/quickwidgets/quick_button.rb +151 -0
- data/lib/operawatir/quickwidgets/quick_checkbox.rb +58 -0
- data/lib/operawatir/quickwidgets/quick_dialogtab.rb +23 -0
- data/lib/operawatir/quickwidgets/quick_dropdown.rb +27 -0
- data/lib/operawatir/quickwidgets/quick_editfield.rb +115 -0
- data/lib/operawatir/quickwidgets/quick_label.rb +12 -0
- data/lib/operawatir/quickwidgets/quick_radiobutton.rb +11 -0
- data/lib/operawatir/quickwidgets/quick_searchfield.rb +25 -0
- data/lib/operawatir/quickwidgets/quick_tab.rb +66 -0
- data/lib/operawatir/quickwidgets/quick_thumbnail.rb +26 -0
- data/lib/operawatir/quickwidgets/quick_toolbar.rb +11 -0
- data/lib/operawatir/quickwidgets/quick_treeitem.rb +157 -0
- data/lib/operawatir/quickwidgets/quick_treeview.rb +27 -0
- data/lib/operawatir/quickwidgets/quick_widget.rb +369 -0
- data/lib/operawatir/quickwidgets/quick_window.rb +150 -0
- data/lib/operawatir/selector.rb +1 -1
- data/lib/operawatir/version.rb +0 -1
- data/lib/operawatir/window.rb +9 -0
- data/operawatir.gemspec +382 -0
- data/spec/new_watirspec/browser_spec.rb +279 -0
- data/spec/new_watirspec/clipboard_spec.rb +79 -0
- data/spec/new_watirspec/collection_spec.rb +387 -0
- data/spec/new_watirspec/element_spec.rb +456 -0
- data/spec/new_watirspec/guards.rb +39 -0
- data/spec/new_watirspec/keys_spec.rb +206 -0
- data/spec/new_watirspec/server.rb +91 -0
- data/spec/new_watirspec/watirspec_helper.rb +62 -0
- data/spec/new_watirspec/window_spec.rb +370 -0
- data/utils/launchers/launcher-mac +0 -0
- metadata +191 -28
- data/.gitmodules +0 -3
data/lib/operawatir/selector.rb
CHANGED
data/lib/operawatir/version.rb
CHANGED
data/lib/operawatir/window.rb
CHANGED
@@ -166,6 +166,15 @@ private
|
|
166
166
|
end
|
167
167
|
end
|
168
168
|
|
169
|
+
# Locate elements by attribute @name.
|
170
|
+
#
|
171
|
+
# @return [Array] an array of found elements
|
172
|
+
def find_elements_by_name(value)
|
173
|
+
driver.findElementsByName(value).to_a.map do |node|
|
174
|
+
OperaWatir::Element.new(node)
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
169
178
|
# @private
|
170
179
|
def driver
|
171
180
|
browser.driver
|
data/operawatir.gemspec
ADDED
@@ -0,0 +1,382 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{operawatir}
|
8
|
+
s.version = "0.3.2"
|
9
|
+
s.platform = %q{jruby}
|
10
|
+
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.authors = ["Deniz Turkoglu", "Andreas Tolf Tolfsen", "Chris Lloyd", "Stuart Knightley"]
|
13
|
+
s.date = %q{2011-01-31}
|
14
|
+
s.description = %q{ OperaWatir is a part of the Watir (pronounced water) family of
|
15
|
+
free software Ruby libraries for automating web
|
16
|
+
browsers. OperaWatir provides a querying engine and Ruby bindings
|
17
|
+
for a backend Java library, OperaDriver, for driving the Opera web
|
18
|
+
browser. It aims for full compliancy with the watirspec
|
19
|
+
specification.
|
20
|
+
}
|
21
|
+
s.email = ["dturkoglu@opera.com", "andreastt@opera.com", "christopherl@opera.com", "stuartk@opera.com"]
|
22
|
+
s.executables = ["desktopwatir", "operawatir"]
|
23
|
+
s.extra_rdoc_files = [
|
24
|
+
"README.md"
|
25
|
+
]
|
26
|
+
s.files = [
|
27
|
+
".yardopts",
|
28
|
+
"AUTHORS",
|
29
|
+
"Gemfile",
|
30
|
+
"LICENSE",
|
31
|
+
"README.md",
|
32
|
+
"Rakefile",
|
33
|
+
"VERSION",
|
34
|
+
"bin/desktopwatir",
|
35
|
+
"bin/operawatir",
|
36
|
+
"lib/operadriver/APACHE_2.0_LICENSE.txt",
|
37
|
+
"lib/operadriver/NEW_BSD_LICENSE.txt",
|
38
|
+
"lib/operadriver/commons-jxpath-1.3.jar",
|
39
|
+
"lib/operadriver/protobuf-java-2.3.0.jar",
|
40
|
+
"lib/operadriver/selenium-common.jar",
|
41
|
+
"lib/operadriver/webdriver-opera.jar",
|
42
|
+
"lib/operawatir.rb",
|
43
|
+
"lib/operawatir/browser.rb",
|
44
|
+
"lib/operawatir/collection.rb",
|
45
|
+
"lib/operawatir/compat.rb",
|
46
|
+
"lib/operawatir/compat/browser.rb",
|
47
|
+
"lib/operawatir/compat/collection.rb",
|
48
|
+
"lib/operawatir/compat/deprecation.rb",
|
49
|
+
"lib/operawatir/compat/element.rb",
|
50
|
+
"lib/operawatir/compat/element_finders.rb",
|
51
|
+
"lib/operawatir/compat/window.rb",
|
52
|
+
"lib/operawatir/desktop-waiter.rb",
|
53
|
+
"lib/operawatir/desktop_browser.rb",
|
54
|
+
"lib/operawatir/desktop_common.rb",
|
55
|
+
"lib/operawatir/desktop_container.rb",
|
56
|
+
"lib/operawatir/desktop_enums.rb",
|
57
|
+
"lib/operawatir/desktop_exceptions.rb",
|
58
|
+
"lib/operawatir/element.rb",
|
59
|
+
"lib/operawatir/exceptions.rb",
|
60
|
+
"lib/operawatir/helper.rb",
|
61
|
+
"lib/operawatir/keys.rb",
|
62
|
+
"lib/operawatir/platform.rb",
|
63
|
+
"lib/operawatir/quickwidgets.rb",
|
64
|
+
"lib/operawatir/quickwidgets/quick_addressfield.rb",
|
65
|
+
"lib/operawatir/quickwidgets/quick_button.rb",
|
66
|
+
"lib/operawatir/quickwidgets/quick_checkbox.rb",
|
67
|
+
"lib/operawatir/quickwidgets/quick_dialogtab.rb",
|
68
|
+
"lib/operawatir/quickwidgets/quick_dropdown.rb",
|
69
|
+
"lib/operawatir/quickwidgets/quick_editfield.rb",
|
70
|
+
"lib/operawatir/quickwidgets/quick_label.rb",
|
71
|
+
"lib/operawatir/quickwidgets/quick_radiobutton.rb",
|
72
|
+
"lib/operawatir/quickwidgets/quick_searchfield.rb",
|
73
|
+
"lib/operawatir/quickwidgets/quick_tab.rb",
|
74
|
+
"lib/operawatir/quickwidgets/quick_thumbnail.rb",
|
75
|
+
"lib/operawatir/quickwidgets/quick_toolbar.rb",
|
76
|
+
"lib/operawatir/quickwidgets/quick_treeitem.rb",
|
77
|
+
"lib/operawatir/quickwidgets/quick_treeview.rb",
|
78
|
+
"lib/operawatir/quickwidgets/quick_widget.rb",
|
79
|
+
"lib/operawatir/quickwidgets/quick_window.rb",
|
80
|
+
"lib/operawatir/selector.rb",
|
81
|
+
"lib/operawatir/version.rb",
|
82
|
+
"lib/operawatir/window.rb",
|
83
|
+
"operawatir.gemspec",
|
84
|
+
"spec/fire_event/fire_event.rb",
|
85
|
+
"spec/fire_event/interactive/onBlur.html",
|
86
|
+
"spec/fire_event/interactive/onChange.html",
|
87
|
+
"spec/fire_event/interactive/onClick.html",
|
88
|
+
"spec/fire_event/interactive/onDblClick.html",
|
89
|
+
"spec/fire_event/interactive/onFocus.html",
|
90
|
+
"spec/fire_event/interactive/onMouseDown.html",
|
91
|
+
"spec/fire_event/interactive/onMouseMove.html",
|
92
|
+
"spec/fire_event/interactive/onMouseOut.html",
|
93
|
+
"spec/fire_event/interactive/onMouseOver.html",
|
94
|
+
"spec/fire_event/interactive/onMouseUp.html",
|
95
|
+
"spec/fire_event/interactive/onScroll.html",
|
96
|
+
"spec/legacy_watirspec/area_spec.rb",
|
97
|
+
"spec/legacy_watirspec/areas_spec.rb",
|
98
|
+
"spec/legacy_watirspec/browser_spec.rb",
|
99
|
+
"spec/legacy_watirspec/button_spec.rb",
|
100
|
+
"spec/legacy_watirspec/buttons_spec.rb",
|
101
|
+
"spec/legacy_watirspec/checkbox_spec.rb",
|
102
|
+
"spec/legacy_watirspec/checkboxes_spec.rb",
|
103
|
+
"spec/legacy_watirspec/collections_spec.rb",
|
104
|
+
"spec/legacy_watirspec/dd_spec.rb",
|
105
|
+
"spec/legacy_watirspec/dds_spec.rb",
|
106
|
+
"spec/legacy_watirspec/del_spec.rb",
|
107
|
+
"spec/legacy_watirspec/dels_spec.rb",
|
108
|
+
"spec/legacy_watirspec/div_spec.rb",
|
109
|
+
"spec/legacy_watirspec/divs_spec.rb",
|
110
|
+
"spec/legacy_watirspec/dl_spec.rb",
|
111
|
+
"spec/legacy_watirspec/dls_spec.rb",
|
112
|
+
"spec/legacy_watirspec/dt_spec.rb",
|
113
|
+
"spec/legacy_watirspec/dts_spec.rb",
|
114
|
+
"spec/legacy_watirspec/element_spec.rb",
|
115
|
+
"spec/legacy_watirspec/em_spec.rb",
|
116
|
+
"spec/legacy_watirspec/ems_spec.rb",
|
117
|
+
"spec/legacy_watirspec/filefield_spec.rb",
|
118
|
+
"spec/legacy_watirspec/filefields_spec.rb",
|
119
|
+
"spec/legacy_watirspec/fixtures/2000_spans.html",
|
120
|
+
"spec/legacy_watirspec/fixtures/bug_duplicate_attributes.html",
|
121
|
+
"spec/legacy_watirspec/fixtures/bug_javascript_001.html",
|
122
|
+
"spec/legacy_watirspec/fixtures/buttons_with_duplicate_ids.html",
|
123
|
+
"spec/legacy_watirspec/fixtures/collections.html",
|
124
|
+
"spec/legacy_watirspec/fixtures/definition_lists.html",
|
125
|
+
"spec/legacy_watirspec/fixtures/euc-jp_text.html",
|
126
|
+
"spec/legacy_watirspec/fixtures/forms_with_input_elements.html",
|
127
|
+
"spec/legacy_watirspec/fixtures/frame_1.html",
|
128
|
+
"spec/legacy_watirspec/fixtures/frame_2.html",
|
129
|
+
"spec/legacy_watirspec/fixtures/frames.html",
|
130
|
+
"spec/legacy_watirspec/fixtures/iframes.html",
|
131
|
+
"spec/legacy_watirspec/fixtures/images.html",
|
132
|
+
"spec/legacy_watirspec/fixtures/images/1.gif",
|
133
|
+
"spec/legacy_watirspec/fixtures/images/2.gif",
|
134
|
+
"spec/legacy_watirspec/fixtures/images/3.gif",
|
135
|
+
"spec/legacy_watirspec/fixtures/images/button.jpg",
|
136
|
+
"spec/legacy_watirspec/fixtures/images/circle.jpg",
|
137
|
+
"spec/legacy_watirspec/fixtures/images/map.gif",
|
138
|
+
"spec/legacy_watirspec/fixtures/images/map2.gif",
|
139
|
+
"spec/legacy_watirspec/fixtures/images/minus.gif",
|
140
|
+
"spec/legacy_watirspec/fixtures/images/originaltriangle.jpg",
|
141
|
+
"spec/legacy_watirspec/fixtures/images/plus.gif",
|
142
|
+
"spec/legacy_watirspec/fixtures/images/square.jpg",
|
143
|
+
"spec/legacy_watirspec/fixtures/images/triangle.jpg",
|
144
|
+
"spec/legacy_watirspec/fixtures/iso-2022-jp_text.html",
|
145
|
+
"spec/legacy_watirspec/fixtures/javascript/helpers.js",
|
146
|
+
"spec/legacy_watirspec/fixtures/jquery.html",
|
147
|
+
"spec/legacy_watirspec/fixtures/latin1_text.html",
|
148
|
+
"spec/legacy_watirspec/fixtures/multiple_ids.html",
|
149
|
+
"spec/legacy_watirspec/fixtures/non_control_elements.html",
|
150
|
+
"spec/legacy_watirspec/fixtures/parser_bug_001.html",
|
151
|
+
"spec/legacy_watirspec/fixtures/prevent_form_submit.html",
|
152
|
+
"spec/legacy_watirspec/fixtures/right_click.html",
|
153
|
+
"spec/legacy_watirspec/fixtures/shift_jis_text.html",
|
154
|
+
"spec/legacy_watirspec/fixtures/tables.html",
|
155
|
+
"spec/legacy_watirspec/fixtures/timeout.html",
|
156
|
+
"spec/legacy_watirspec/fixtures/timeout_window_location.html",
|
157
|
+
"spec/legacy_watirspec/fixtures/tiny_mce.html",
|
158
|
+
"spec/legacy_watirspec/fixtures/utf8_text.html",
|
159
|
+
"spec/legacy_watirspec/fixtures/watirspec.css",
|
160
|
+
"spec/legacy_watirspec/form_spec.rb",
|
161
|
+
"spec/legacy_watirspec/forms_spec.rb",
|
162
|
+
"spec/legacy_watirspec/frame_spec.rb",
|
163
|
+
"spec/legacy_watirspec/frames_spec.rb",
|
164
|
+
"spec/legacy_watirspec/guards.rb",
|
165
|
+
"spec/legacy_watirspec/hidden_spec.rb",
|
166
|
+
"spec/legacy_watirspec/hiddens_spec.rb",
|
167
|
+
"spec/legacy_watirspec/hn_spec.rb",
|
168
|
+
"spec/legacy_watirspec/hns_spec.rb",
|
169
|
+
"spec/legacy_watirspec/image_spec.rb",
|
170
|
+
"spec/legacy_watirspec/images_spec.rb",
|
171
|
+
"spec/legacy_watirspec/ins_spec.rb",
|
172
|
+
"spec/legacy_watirspec/inses_spec.rb",
|
173
|
+
"spec/legacy_watirspec/label_spec.rb",
|
174
|
+
"spec/legacy_watirspec/labels_spec.rb",
|
175
|
+
"spec/legacy_watirspec/li_spec.rb",
|
176
|
+
"spec/legacy_watirspec/link_spec.rb",
|
177
|
+
"spec/legacy_watirspec/links_spec.rb",
|
178
|
+
"spec/legacy_watirspec/lis_spec.rb",
|
179
|
+
"spec/legacy_watirspec/map_spec.rb",
|
180
|
+
"spec/legacy_watirspec/maps_spec.rb",
|
181
|
+
"spec/legacy_watirspec/meta_spec.rb",
|
182
|
+
"spec/legacy_watirspec/metas_spec.rb",
|
183
|
+
"spec/legacy_watirspec/ol_spec.rb",
|
184
|
+
"spec/legacy_watirspec/ols_spec.rb",
|
185
|
+
"spec/legacy_watirspec/option_spec.rb",
|
186
|
+
"spec/legacy_watirspec/p_spec.rb",
|
187
|
+
"spec/legacy_watirspec/pre_spec.rb",
|
188
|
+
"spec/legacy_watirspec/pres_spec.rb",
|
189
|
+
"spec/legacy_watirspec/ps_spec.rb",
|
190
|
+
"spec/legacy_watirspec/radio_spec.rb",
|
191
|
+
"spec/legacy_watirspec/radios_spec.rb",
|
192
|
+
"spec/legacy_watirspec/select_list_spec.rb",
|
193
|
+
"spec/legacy_watirspec/select_lists_spec.rb",
|
194
|
+
"spec/legacy_watirspec/server.rb",
|
195
|
+
"spec/legacy_watirspec/span_spec.rb",
|
196
|
+
"spec/legacy_watirspec/spans_spec.rb",
|
197
|
+
"spec/legacy_watirspec/spec_helper.rb",
|
198
|
+
"spec/legacy_watirspec/strong_spec.rb",
|
199
|
+
"spec/legacy_watirspec/strongs_spec.rb",
|
200
|
+
"spec/legacy_watirspec/table_bodies_spec.rb",
|
201
|
+
"spec/legacy_watirspec/table_body_spec.rb",
|
202
|
+
"spec/legacy_watirspec/table_cell_spec.rb",
|
203
|
+
"spec/legacy_watirspec/table_cells_spec.rb",
|
204
|
+
"spec/legacy_watirspec/table_footer_spec.rb",
|
205
|
+
"spec/legacy_watirspec/table_footers_spec.rb",
|
206
|
+
"spec/legacy_watirspec/table_header_spec.rb",
|
207
|
+
"spec/legacy_watirspec/table_headers_spec.rb",
|
208
|
+
"spec/legacy_watirspec/table_row_spec.rb",
|
209
|
+
"spec/legacy_watirspec/table_rows_spec.rb",
|
210
|
+
"spec/legacy_watirspec/table_spec.rb",
|
211
|
+
"spec/legacy_watirspec/tables_spec.rb",
|
212
|
+
"spec/legacy_watirspec/text_field_spec.rb",
|
213
|
+
"spec/legacy_watirspec/text_fields_spec.rb",
|
214
|
+
"spec/legacy_watirspec/ul_spec.rb",
|
215
|
+
"spec/legacy_watirspec/uls_spec.rb",
|
216
|
+
"spec/legacy_watirspec/watir_compatibility_spec.rb",
|
217
|
+
"spec/legacy_watirspec/watirspec_helper.rb",
|
218
|
+
"utils/Rakefile",
|
219
|
+
"utils/launchers/launcher-linux-i686",
|
220
|
+
"utils/launchers/launcher-linux-x86_64",
|
221
|
+
"utils/launchers/launcher-mac",
|
222
|
+
"utils/launchers/launcher-win32-i86pc.exe"
|
223
|
+
]
|
224
|
+
s.homepage = %q{http://operasoftware.github.com/operawatir}
|
225
|
+
s.require_paths = ["lib"]
|
226
|
+
s.required_ruby_version = Gem::Requirement.new(">= 1.8.7")
|
227
|
+
s.rubyforge_project = %q{operawatir}
|
228
|
+
s.rubygems_version = %q{1.3.6}
|
229
|
+
s.summary = %q{Toolkit for automating interactions with the Opera web browser.}
|
230
|
+
s.test_files = [
|
231
|
+
"spec/fire_event/fire_event.rb",
|
232
|
+
"spec/legacy_watirspec/area_spec.rb",
|
233
|
+
"spec/legacy_watirspec/areas_spec.rb",
|
234
|
+
"spec/legacy_watirspec/browser_spec.rb",
|
235
|
+
"spec/legacy_watirspec/button_spec.rb",
|
236
|
+
"spec/legacy_watirspec/buttons_spec.rb",
|
237
|
+
"spec/legacy_watirspec/checkbox_spec.rb",
|
238
|
+
"spec/legacy_watirspec/checkboxes_spec.rb",
|
239
|
+
"spec/legacy_watirspec/collections_spec.rb",
|
240
|
+
"spec/legacy_watirspec/dd_spec.rb",
|
241
|
+
"spec/legacy_watirspec/dds_spec.rb",
|
242
|
+
"spec/legacy_watirspec/del_spec.rb",
|
243
|
+
"spec/legacy_watirspec/dels_spec.rb",
|
244
|
+
"spec/legacy_watirspec/div_spec.rb",
|
245
|
+
"spec/legacy_watirspec/divs_spec.rb",
|
246
|
+
"spec/legacy_watirspec/dl_spec.rb",
|
247
|
+
"spec/legacy_watirspec/dls_spec.rb",
|
248
|
+
"spec/legacy_watirspec/dt_spec.rb",
|
249
|
+
"spec/legacy_watirspec/dts_spec.rb",
|
250
|
+
"spec/legacy_watirspec/element_spec.rb",
|
251
|
+
"spec/legacy_watirspec/em_spec.rb",
|
252
|
+
"spec/legacy_watirspec/ems_spec.rb",
|
253
|
+
"spec/legacy_watirspec/filefield_spec.rb",
|
254
|
+
"spec/legacy_watirspec/filefields_spec.rb",
|
255
|
+
"spec/legacy_watirspec/form_spec.rb",
|
256
|
+
"spec/legacy_watirspec/forms_spec.rb",
|
257
|
+
"spec/legacy_watirspec/frame_spec.rb",
|
258
|
+
"spec/legacy_watirspec/frames_spec.rb",
|
259
|
+
"spec/legacy_watirspec/guards.rb",
|
260
|
+
"spec/legacy_watirspec/hidden_spec.rb",
|
261
|
+
"spec/legacy_watirspec/hiddens_spec.rb",
|
262
|
+
"spec/legacy_watirspec/hn_spec.rb",
|
263
|
+
"spec/legacy_watirspec/hns_spec.rb",
|
264
|
+
"spec/legacy_watirspec/image_spec.rb",
|
265
|
+
"spec/legacy_watirspec/images_spec.rb",
|
266
|
+
"spec/legacy_watirspec/ins_spec.rb",
|
267
|
+
"spec/legacy_watirspec/inses_spec.rb",
|
268
|
+
"spec/legacy_watirspec/label_spec.rb",
|
269
|
+
"spec/legacy_watirspec/labels_spec.rb",
|
270
|
+
"spec/legacy_watirspec/li_spec.rb",
|
271
|
+
"spec/legacy_watirspec/link_spec.rb",
|
272
|
+
"spec/legacy_watirspec/links_spec.rb",
|
273
|
+
"spec/legacy_watirspec/lis_spec.rb",
|
274
|
+
"spec/legacy_watirspec/map_spec.rb",
|
275
|
+
"spec/legacy_watirspec/maps_spec.rb",
|
276
|
+
"spec/legacy_watirspec/meta_spec.rb",
|
277
|
+
"spec/legacy_watirspec/metas_spec.rb",
|
278
|
+
"spec/legacy_watirspec/ol_spec.rb",
|
279
|
+
"spec/legacy_watirspec/ols_spec.rb",
|
280
|
+
"spec/legacy_watirspec/option_spec.rb",
|
281
|
+
"spec/legacy_watirspec/p_spec.rb",
|
282
|
+
"spec/legacy_watirspec/pre_spec.rb",
|
283
|
+
"spec/legacy_watirspec/pres_spec.rb",
|
284
|
+
"spec/legacy_watirspec/ps_spec.rb",
|
285
|
+
"spec/legacy_watirspec/radio_spec.rb",
|
286
|
+
"spec/legacy_watirspec/radios_spec.rb",
|
287
|
+
"spec/legacy_watirspec/select_list_spec.rb",
|
288
|
+
"spec/legacy_watirspec/select_lists_spec.rb",
|
289
|
+
"spec/legacy_watirspec/server.rb",
|
290
|
+
"spec/legacy_watirspec/span_spec.rb",
|
291
|
+
"spec/legacy_watirspec/spans_spec.rb",
|
292
|
+
"spec/legacy_watirspec/spec_helper.rb",
|
293
|
+
"spec/legacy_watirspec/strong_spec.rb",
|
294
|
+
"spec/legacy_watirspec/strongs_spec.rb",
|
295
|
+
"spec/legacy_watirspec/table_bodies_spec.rb",
|
296
|
+
"spec/legacy_watirspec/table_body_spec.rb",
|
297
|
+
"spec/legacy_watirspec/table_cell_spec.rb",
|
298
|
+
"spec/legacy_watirspec/table_cells_spec.rb",
|
299
|
+
"spec/legacy_watirspec/table_footer_spec.rb",
|
300
|
+
"spec/legacy_watirspec/table_footers_spec.rb",
|
301
|
+
"spec/legacy_watirspec/table_header_spec.rb",
|
302
|
+
"spec/legacy_watirspec/table_headers_spec.rb",
|
303
|
+
"spec/legacy_watirspec/table_row_spec.rb",
|
304
|
+
"spec/legacy_watirspec/table_rows_spec.rb",
|
305
|
+
"spec/legacy_watirspec/table_spec.rb",
|
306
|
+
"spec/legacy_watirspec/tables_spec.rb",
|
307
|
+
"spec/legacy_watirspec/text_field_spec.rb",
|
308
|
+
"spec/legacy_watirspec/text_fields_spec.rb",
|
309
|
+
"spec/legacy_watirspec/ul_spec.rb",
|
310
|
+
"spec/legacy_watirspec/uls_spec.rb",
|
311
|
+
"spec/legacy_watirspec/watir_compatibility_spec.rb",
|
312
|
+
"spec/legacy_watirspec/watirspec_helper.rb",
|
313
|
+
"spec/new_watirspec/browser_spec.rb",
|
314
|
+
"spec/new_watirspec/clipboard_spec.rb",
|
315
|
+
"spec/new_watirspec/collection_spec.rb",
|
316
|
+
"spec/new_watirspec/element_spec.rb",
|
317
|
+
"spec/new_watirspec/guards.rb",
|
318
|
+
"spec/new_watirspec/keys_spec.rb",
|
319
|
+
"spec/new_watirspec/server.rb",
|
320
|
+
"spec/new_watirspec/watirspec_helper.rb",
|
321
|
+
"spec/new_watirspec/window_spec.rb"
|
322
|
+
]
|
323
|
+
|
324
|
+
if s.respond_to? :specification_version then
|
325
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
326
|
+
s.specification_version = 3
|
327
|
+
|
328
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
329
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
330
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.5.1"])
|
331
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
332
|
+
s.add_development_dependency(%q<yard>, [">= 0.6.3"])
|
333
|
+
s.add_development_dependency(%q<bluecloth>, ["= 1.0.1"])
|
334
|
+
s.add_development_dependency(%q<rspec>, [">= 2.4"])
|
335
|
+
s.add_development_dependency(%q<sinatra>, [">= 1.0.0"])
|
336
|
+
s.add_development_dependency(%q<mongrel>, [">= 1.1.5"])
|
337
|
+
s.add_development_dependency(%q<rr>, [">= 1.0.2"])
|
338
|
+
s.add_runtime_dependency(%q<rspec>, [">= 2.4"])
|
339
|
+
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
340
|
+
s.add_development_dependency(%q<rake>, [">= 0"])
|
341
|
+
s.add_development_dependency(%q<yard>, [">= 0"])
|
342
|
+
s.add_development_dependency(%q<mongrel>, [">= 1.1.5"])
|
343
|
+
s.add_development_dependency(%q<sinatra>, [">= 1.1"])
|
344
|
+
s.add_development_dependency(%q<rr>, [">= 0"])
|
345
|
+
else
|
346
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
347
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
|
348
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
349
|
+
s.add_dependency(%q<yard>, [">= 0.6.3"])
|
350
|
+
s.add_dependency(%q<bluecloth>, ["= 1.0.1"])
|
351
|
+
s.add_dependency(%q<rspec>, [">= 2.4"])
|
352
|
+
s.add_dependency(%q<sinatra>, [">= 1.0.0"])
|
353
|
+
s.add_dependency(%q<mongrel>, [">= 1.1.5"])
|
354
|
+
s.add_dependency(%q<rr>, [">= 1.0.2"])
|
355
|
+
s.add_dependency(%q<rspec>, [">= 2.4"])
|
356
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
357
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
358
|
+
s.add_dependency(%q<yard>, [">= 0"])
|
359
|
+
s.add_dependency(%q<mongrel>, [">= 1.1.5"])
|
360
|
+
s.add_dependency(%q<sinatra>, [">= 1.1"])
|
361
|
+
s.add_dependency(%q<rr>, [">= 0"])
|
362
|
+
end
|
363
|
+
else
|
364
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
365
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
|
366
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
367
|
+
s.add_dependency(%q<yard>, [">= 0.6.3"])
|
368
|
+
s.add_dependency(%q<bluecloth>, ["= 1.0.1"])
|
369
|
+
s.add_dependency(%q<rspec>, [">= 2.4"])
|
370
|
+
s.add_dependency(%q<sinatra>, [">= 1.0.0"])
|
371
|
+
s.add_dependency(%q<mongrel>, [">= 1.1.5"])
|
372
|
+
s.add_dependency(%q<rr>, [">= 1.0.2"])
|
373
|
+
s.add_dependency(%q<rspec>, [">= 2.4"])
|
374
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
375
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
376
|
+
s.add_dependency(%q<yard>, [">= 0"])
|
377
|
+
s.add_dependency(%q<mongrel>, [">= 1.1.5"])
|
378
|
+
s.add_dependency(%q<sinatra>, [">= 1.1"])
|
379
|
+
s.add_dependency(%q<rr>, [">= 0"])
|
380
|
+
end
|
381
|
+
end
|
382
|
+
|
@@ -0,0 +1,279 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require File.expand_path('../watirspec_helper', __FILE__)
|
3
|
+
|
4
|
+
describe 'Browser' do
|
5
|
+
|
6
|
+
before :all do
|
7
|
+
browser.url = fixture('simple.html')
|
8
|
+
end
|
9
|
+
|
10
|
+
describe '#new' do
|
11
|
+
it 'constructs a new instance' do
|
12
|
+
browser.exists?.should be_true
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
describe '#driver' do
|
17
|
+
it 'returns driver object' do
|
18
|
+
browser.driver.instance_of?(Java::ComOperaCoreSystems::OperaDriver).should be_true
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'can access native driver methods' do
|
22
|
+
browser.driver.getCurrentUrl.should_not be_empty
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe '#name' do
|
27
|
+
# FIXME
|
28
|
+
it 'is the name of a Watir implementation' do
|
29
|
+
browser.name.should_not be_empty
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
describe '#url=' do # goto() is an alias
|
34
|
+
it 'opens a new window' do
|
35
|
+
new_window = browser.url fixture('simple.html')
|
36
|
+
new_window.exists?.should be_true
|
37
|
+
new_window.close
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'navigates to a url' do
|
41
|
+
window.url = fixture('simple.html')
|
42
|
+
window.url.should == fixture('simple.html')
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'navigates to a url using goto alias' do
|
46
|
+
browser.goto fixture('simple.html')
|
47
|
+
browser.active_window.url.should == fixture('simple.html')
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
describe '#quit!' do
|
52
|
+
before :each do
|
53
|
+
browser.quit!
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'quits the browser' do
|
57
|
+
browser.connected?.should be_false
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'window is closed upon quit' do
|
61
|
+
browser.active_window.exists?.should be_false
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'windows are closed upon quit' do
|
65
|
+
browser.windows.all? do |window|
|
66
|
+
window.exists? == false
|
67
|
+
end.should be_true
|
68
|
+
end
|
69
|
+
|
70
|
+
it 'is not possible to access window properties after quit' do
|
71
|
+
# FIXME
|
72
|
+
browser.active_window.url.should raise_error NativeException
|
73
|
+
browser.active_window.title.should raise_error NativeException
|
74
|
+
end
|
75
|
+
|
76
|
+
after :all do
|
77
|
+
# OperaWatir::Helper.reconnect
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
describe '#windows' do
|
82
|
+
before :all do
|
83
|
+
puts 'AFTER QUIT!'
|
84
|
+
# browser = OperaWatir::Browser.new
|
85
|
+
puts "URL IS NOW: #{browser.active_window.url}"
|
86
|
+
end
|
87
|
+
|
88
|
+
|
89
|
+
it 'is not empty' do
|
90
|
+
browser.windows.should_not be_empty
|
91
|
+
end
|
92
|
+
|
93
|
+
it 'is a list of open windows' do
|
94
|
+
browser.windows.all? do |window|
|
95
|
+
window.respond_to? :find_elements_by_id
|
96
|
+
end.should be_true
|
97
|
+
end
|
98
|
+
|
99
|
+
it 'will close all open windows' do
|
100
|
+
open_windows = browser.windows.length
|
101
|
+
browser.windows.close_all
|
102
|
+
browser.windows.length.should < open_windows
|
103
|
+
browser.windows.length.should_not be_zero
|
104
|
+
end
|
105
|
+
|
106
|
+
# TODO: Window selectors
|
107
|
+
|
108
|
+
end
|
109
|
+
|
110
|
+
describe '#version' do
|
111
|
+
it 'fetches the version number of the driver' do
|
112
|
+
browser.version.should match /\d{1,}\.\d{1,}\.\d{1,}/
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
describe '#pid' do
|
117
|
+
it 'fetches the PID from the attached browser instance' do
|
118
|
+
browser.pid.should be_integer
|
119
|
+
browser.pid.should_not be_zero
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
describe '#platform' do
|
124
|
+
it 'fetches the platform the browser is running on' do
|
125
|
+
# TODO: Improve regexp
|
126
|
+
browser.platform.should match /linux|windows|mac os x|bsd/i
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
describe '#build' do
|
131
|
+
it 'fetches the build number of the attached browser instance' do
|
132
|
+
browser.build.should be_integer
|
133
|
+
browser.build.should_not be_zero
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
describe '#path' do
|
138
|
+
it 'fetches the full path to the binary of the attached browser' do
|
139
|
+
# TODO: Improve regexp
|
140
|
+
browser.path.should match /(\/|\\){2,}/
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
describe '#ua_string' do
|
145
|
+
it 'fetches the UA string of the browser' do
|
146
|
+
browser.ua_string.should_not be_empty
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
describe '#connected?' do
|
151
|
+
it 'is attached to a browser instance' do
|
152
|
+
browser.connected?.should be_true
|
153
|
+
end
|
154
|
+
|
155
|
+
it 'is not attached to a browser instance' do
|
156
|
+
browser.quit!
|
157
|
+
browser.connected?.should be_false
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
describe '#desktop?' do
|
162
|
+
it 'responds with boolean' do
|
163
|
+
(!!browser.desktop? == browser.desktop?).should be_true
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
# configuration
|
168
|
+
describe '#speed' do
|
169
|
+
it 'is one of :fast, :medium or :slow' do
|
170
|
+
[:fast, :medium, :slow].any? do |speed|
|
171
|
+
browser.speed == speed
|
172
|
+
end.should be_true
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
describe '#speed=' do
|
177
|
+
it 'can be set to :fast' do
|
178
|
+
browser.speed = :fast
|
179
|
+
browser.speed.should == :fast
|
180
|
+
end
|
181
|
+
|
182
|
+
it 'can be set to :medium' do
|
183
|
+
browser.speed = :medium
|
184
|
+
browser.speed.should == :medium
|
185
|
+
end
|
186
|
+
|
187
|
+
it 'can be set to :slow' do
|
188
|
+
browser.speed = :slow
|
189
|
+
browser.speed.should == :slow
|
190
|
+
end
|
191
|
+
|
192
|
+
it 'cannot be set to other values' do
|
193
|
+
browser.speed = :hoobaflooba
|
194
|
+
browser.speed.should_not == :hoobaflooba
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
describe '#preferences' do
|
199
|
+
it 'is a list of all preferences' do
|
200
|
+
browser.preferences.length.should > 10
|
201
|
+
end
|
202
|
+
|
203
|
+
it 'contains options' do
|
204
|
+
browser.preferences('Developer Tools', 'Proxy Auto Connect').should_not be_empty
|
205
|
+
end
|
206
|
+
|
207
|
+
it 'gets a value of an option' do
|
208
|
+
browser.preferences('Cache', 'SVG Cache Size').should be_numeric
|
209
|
+
browser.preferences('Cache', 'SVG Cache Size').should_not be_zero
|
210
|
+
end
|
211
|
+
|
212
|
+
it 'returns a top block of preferences' do
|
213
|
+
browser.preferences.each do |section, option, value|
|
214
|
+
section.should_not be_empty
|
215
|
+
option.should_not be_empty
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
it 'returns a sub block of preferences' do
|
220
|
+
browser.preferences('Cache').each do |option, value|
|
221
|
+
option.should_not be_empty
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
# I'm not sure if this works, we'll have to extend all returned values
|
226
|
+
# (see 'gets a value of an option') with a .default and .reset! property
|
227
|
+
describe '#default' do
|
228
|
+
it 'fetches default value of an option' do
|
229
|
+
browser.preferences('Cache', 'SVG Cache Size').default.should > 2000
|
230
|
+
end
|
231
|
+
end
|
232
|
+
|
233
|
+
describe '#reset!' do
|
234
|
+
it 'resets an option to default' do
|
235
|
+
browser.preferences('Cache', 'SVG Cache Size').reset!
|
236
|
+
browser.preferences('Cache', 'SVG Cache Size').should == browser.preferences('Cache', 'SVG Cache Size').default
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
end
|
241
|
+
|
242
|
+
describe '#preferences=' do
|
243
|
+
before :all do
|
244
|
+
# Caches options that we will tamper with.
|
245
|
+
@preferences = browser.preferences
|
246
|
+
end
|
247
|
+
|
248
|
+
it 'sets an option' do
|
249
|
+
browser.preferences('Cache', 'Application Cache Quota').value = 0
|
250
|
+
browser.preferences('Cache', 'Application Cache Quota').should == 0
|
251
|
+
end
|
252
|
+
|
253
|
+
it 'sets options by a given block' do
|
254
|
+
preferences = {
|
255
|
+
'Cache' => {
|
256
|
+
'Always Check Never-Expiring GET queries' => false,
|
257
|
+
'Application Cache Quota' => -5000,
|
258
|
+
'SVG Cache Size' => 2000
|
259
|
+
}
|
260
|
+
}
|
261
|
+
|
262
|
+
browser.preferences = preferences
|
263
|
+
|
264
|
+
browser.preferences('Cache', 'Always Check Never-Expiring GET queries').should_not be_true
|
265
|
+
browser.preferences('Cache', 'Application Cache Quota').should == -5000
|
266
|
+
browser.preferences('Cache', 'SVG Cache Size').should == 2000
|
267
|
+
|
268
|
+
# Making sure setting block didn't affect any other blocks.
|
269
|
+
browser.preferences('Colors', 'Background').should == @preferences['Colors']['Background']
|
270
|
+
browser.preferences('Fonts', 'Dialog').should == @preferences['Fonts']['Dialog']
|
271
|
+
end
|
272
|
+
|
273
|
+
after :all do
|
274
|
+
# Resets options that we've tampered with.
|
275
|
+
browser.preferences = @preferences
|
276
|
+
end
|
277
|
+
end
|
278
|
+
|
279
|
+
end
|