operawatir 0.4.3.pre1-jruby → 0.5-jruby
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitmodules +1 -1
- data/CHANGES +230 -0
- data/Gemfile +4 -0
- data/Rakefile +3 -2
- data/VERSION +1 -1
- data/bin/desktopwatir +1 -1
- data/bin/operawatir +16 -4
- data/lib/operadriver/guava-r09.jar +0 -0
- data/lib/operadriver/operadriver-v0.7.2.jar +0 -0
- data/lib/operadriver/selenium-nodeps-20100909.jar +0 -0
- data/lib/operawatir.rb +10 -3
- data/lib/operawatir/actions.rb +111 -0
- data/lib/operawatir/browser.rb +24 -20
- data/lib/operawatir/clickable_item.rb +68 -0
- data/lib/operawatir/compat.rb +4 -4
- data/lib/operawatir/compat/collection.rb +1 -1
- data/lib/operawatir/compat/element.rb +1 -1
- data/lib/operawatir/compat/window.rb +4 -3
- data/lib/operawatir/desktop_browser.rb +299 -95
- data/lib/operawatir/desktop_common.rb +88 -23
- data/lib/operawatir/desktop_container.rb +103 -34
- data/lib/operawatir/desktop_enums.rb +4 -4
- data/lib/operawatir/desktop_exceptions.rb +2 -2
- data/lib/operawatir/desktop_helper.rb +31 -8
- data/lib/operawatir/element.rb +6 -2
- data/lib/operawatir/exceptions.rb +4 -4
- data/lib/operawatir/helper.rb +6 -6
- data/lib/operawatir/keys.rb +4 -4
- data/lib/operawatir/preferences.rb +126 -155
- data/lib/operawatir/quickwidgets.rb +3 -3
- data/lib/operawatir/quickwidgets/quick_addressfield.rb +12 -5
- data/lib/operawatir/quickwidgets/quick_button.rb +39 -53
- data/lib/operawatir/quickwidgets/quick_checkbox.rb +6 -6
- data/lib/operawatir/quickwidgets/quick_dialogtab.rb +5 -5
- data/lib/operawatir/quickwidgets/quick_dropdown.rb +28 -4
- data/lib/operawatir/quickwidgets/quick_dropdownitem.rb +46 -0
- data/lib/operawatir/quickwidgets/quick_editfield.rb +16 -13
- data/lib/operawatir/quickwidgets/quick_label.rb +1 -1
- data/lib/operawatir/quickwidgets/quick_menu.rb +155 -0
- data/lib/operawatir/quickwidgets/quick_menuitem.rb +387 -0
- data/lib/operawatir/quickwidgets/quick_searchfield.rb +7 -4
- data/lib/operawatir/quickwidgets/quick_tab.rb +23 -12
- data/lib/operawatir/quickwidgets/quick_thumbnail.rb +4 -4
- data/lib/operawatir/quickwidgets/quick_toolbar.rb +1 -1
- data/lib/operawatir/quickwidgets/quick_treeitem.rb +45 -29
- data/lib/operawatir/quickwidgets/quick_treeview.rb +2 -2
- data/lib/operawatir/quickwidgets/quick_widget.rb +267 -77
- data/lib/operawatir/quickwidgets/quick_window.rb +64 -38
- data/lib/operawatir/screenshot.rb +1 -1
- data/lib/operawatir/utils.rb +31 -0
- data/lib/operawatir/window.rb +1 -1
- data/operawatir.gemspec +38 -132
- data/spec/operawatir/core/actions_spec.rb +202 -0
- data/spec/operawatir/core/browser_spec.rb +8 -8
- data/spec/operawatir/core/element_spec.rb +11 -2
- data/spec/operawatir/core/keys_spec.rb +50 -2
- data/spec/operawatir/core/preferences_spec.rb +44 -128
- data/spec/operawatir/core/spatnav_spec.rb +16 -16
- data/spec/operawatir/core/utils_spec.rb +47 -0
- data/spec/operawatir/core/window_spec.rb +1 -1
- data/spec/operawatir/desktop/desktopbrowser_spec.rb +191 -22
- data/spec/operawatir/desktop/quickbutton_spec.rb +197 -164
- data/spec/operawatir/desktop/quickcheckbox_spec.rb +12 -12
- data/spec/operawatir/desktop/quickdialogtab_spec.rb +11 -11
- data/spec/operawatir/desktop/quickdropdown_spec.rb +25 -25
- data/spec/operawatir/desktop/quickeditfield_spec.rb +31 -31
- data/spec/operawatir/desktop/quickmenu_spec.rb +57 -0
- data/spec/operawatir/desktop/quickmenuitem_spec.rb +168 -0
- data/spec/operawatir/desktop/quicktab_spec.rb +26 -15
- data/spec/operawatir/desktop/quickthumbnail_spec.rb +18 -4
- data/spec/operawatir/desktop/quicktreeitem_spec.rb +72 -72
- data/spec/operawatir/desktop/quicktreeview_spec.rb +13 -13
- data/spec/operawatir/desktop/quickwidget_spec.rb +51 -13
- data/spec/operawatir/desktop/quickwindow_spec.rb +4 -0
- data/spec/operawatir/desktop/shared/shared.rb +25 -9
- data/spec/operawatir/fixtures/draggableLists.html +67 -0
- data/spec/operawatir/fixtures/formSelectionPage.html +46 -0
- data/spec/operawatir/fixtures/js/jquery-1.4.4.min.js +167 -0
- data/spec/operawatir/fixtures/js/jquery-ui-1.8.10.custom.min.js +782 -0
- data/spec/operawatir/fixtures/keys.html +40 -0
- data/spec/operawatir/fixtures/label_submit.html +5 -0
- data/spec/operawatir/fixtures/mouse.html +59 -0
- data/spec/operawatir/fixtures/simple.html +10 -0
- data/spec/operawatir/matchers.rb +20 -19
- data/spec/operawatir/watirspec_desktophelper.rb +51 -3
- data/spec/operawatir/watirspec_helper.rb +0 -2
- metadata +91 -220
- data/lib/operadriver/client-combined-nodeps.jar +0 -0
- data/lib/operadriver/webdriver-opera.jar +0 -0
- data/spec/watir3/browser_spec.rb +0 -190
- data/spec/watir3/clipboard_spec.rb +0 -64
- data/spec/watir3/collection_spec.rb +0 -387
- data/spec/watir3/element_spec.rb +0 -474
- data/spec/watir3/guards.rb +0 -39
- data/spec/watir3/keys_spec.rb +0 -204
- data/spec/watir3/server.rb +0 -91
- data/spec/watir3/watirspec_helper.rb +0 -62
- data/spec/watir3/window_spec.rb +0 -295
@@ -1,62 +1,62 @@
|
|
1
1
|
require File.expand_path('../../watirspec_helper', __FILE__)
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe OperaWatir::Spatnav do
|
4
4
|
|
5
5
|
before :each do
|
6
6
|
browser.url = fixture('grid.html')
|
7
|
+
@spatnav = browser.spatnav
|
7
8
|
end
|
8
9
|
|
9
10
|
describe '#up' do
|
10
11
|
it 'selects the correct links when navigating up' do
|
11
|
-
|
12
|
+
@spatnav.up
|
12
13
|
window.execute_script("document.activeElement.text;").to_s.should == 'C1'
|
13
|
-
|
14
|
+
@spatnav.up
|
14
15
|
window.execute_script("document.activeElement.text;").to_s.should == 'C2'
|
15
|
-
|
16
|
+
@spatnav.up
|
16
17
|
window.execute_script("document.activeElement.text;").to_s.should == 'C3'
|
17
18
|
end
|
18
19
|
end
|
19
20
|
|
20
21
|
describe '#down' do
|
21
22
|
it 'selects the correct links when navigating down' do
|
22
|
-
|
23
|
+
@spatnav.down
|
23
24
|
window.execute_script("document.activeElement.text;").to_s.should == 'C3'
|
24
|
-
|
25
|
+
@spatnav.down
|
25
26
|
window.execute_script("document.activeElement.text;").to_s.should == 'C2'
|
26
|
-
|
27
|
+
@spatnav.down
|
27
28
|
window.execute_script("document.activeElement.text;").to_s.should == 'C1'
|
28
29
|
end
|
29
30
|
end
|
30
31
|
|
31
32
|
describe '#left' do
|
32
33
|
it 'selects the correct links when navigating left' do
|
33
|
-
|
34
|
+
@spatnav.left
|
34
35
|
window.execute_script("document.activeElement.text;").to_s.should == 'C1'
|
35
|
-
|
36
|
+
@spatnav.left
|
36
37
|
window.execute_script("document.activeElement.text;").to_s.should == 'B1'
|
37
|
-
|
38
|
+
@spatnav.left
|
38
39
|
window.execute_script("document.activeElement.text;").to_s.should == 'A1'
|
39
40
|
end
|
40
41
|
end
|
41
42
|
|
42
43
|
describe '#right' do
|
43
44
|
it 'selects the correct links when navigating right' do
|
44
|
-
|
45
|
+
@spatnav.right
|
45
46
|
window.execute_script("document.activeElement.text;").to_s.should == 'A1'
|
46
|
-
|
47
|
+
@spatnav.right
|
47
48
|
window.execute_script("document.activeElement.text;").to_s.should == 'B1'
|
48
|
-
|
49
|
+
@spatnav.right
|
49
50
|
window.execute_script("document.activeElement.text;").to_s.should == 'C1'
|
50
51
|
end
|
51
52
|
end
|
52
53
|
|
53
54
|
describe '#activate!' do
|
54
55
|
it 'activates the focused link' do
|
55
|
-
|
56
|
-
|
56
|
+
@spatnav.down
|
57
|
+
@spatnav.activate
|
57
58
|
window.url.should include 'C3'
|
58
59
|
end
|
59
60
|
end
|
60
61
|
|
61
|
-
|
62
62
|
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require File.expand_path('../../watirspec_helper', __FILE__)
|
2
|
+
|
3
|
+
describe OperaWatir::Utils do
|
4
|
+
|
5
|
+
before(:all) { @utils = browser.utils }
|
6
|
+
|
7
|
+
describe '#core_version' do
|
8
|
+
it 'it matches a core version number' do
|
9
|
+
@utils.core_version.should match /\d+\.\d+\.\d+/
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
describe '#os' do
|
14
|
+
it 'is not empty' do
|
15
|
+
@utils.os.should_not be_empty
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe '#product' do
|
20
|
+
it 'is not unknown' do
|
21
|
+
@utils.product.should_not include 'unknown'
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'is known' do
|
25
|
+
@utils.product.should match /core-gogi|desktop/
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe '#binary_path' do
|
30
|
+
it 'is not empty' do
|
31
|
+
@utils.binary_path.should_not be_empty
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe '#user_agent' do
|
36
|
+
it 'is a User-Agent string' do
|
37
|
+
@utils.user_agent.should match /Opera\/\d+\.\d+.+/
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe '#pid' do
|
42
|
+
it 'is greater than zero' do
|
43
|
+
@utils.pid.should > 0
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
@@ -2,13 +2,60 @@
|
|
2
2
|
require File.expand_path('../../watirspec_desktophelper', __FILE__)
|
3
3
|
|
4
4
|
describe 'DesktopBrowser' do
|
5
|
+
|
6
|
+
let(:addressfield) { browser.quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field") }
|
7
|
+
|
5
8
|
before :all do
|
6
|
-
browser.url = fixture('
|
9
|
+
browser.url = fixture('onclick.html') # simple
|
7
10
|
#@window = browser.quick_window(:name, "Tab 0")
|
8
11
|
end
|
12
|
+
|
13
|
+
describe '#open_menu_with_rightclick' do
|
14
|
+
it 'opens a menu' do
|
15
|
+
elem = window.find_by_tag('button')
|
16
|
+
browser.open_menu_with_rightclick(elem, "").should open_menu
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '#close_all_menus' do
|
21
|
+
it 'closes all menus'
|
22
|
+
end
|
23
|
+
|
24
|
+
describe '#close_active_menu' do
|
25
|
+
it 'closes active menu'
|
26
|
+
end
|
27
|
+
|
28
|
+
describe '#key_press_with_condition' do
|
29
|
+
it 'should fail without condition' do
|
30
|
+
browser.key_press_with_condition("c", :ctrl).should be_false
|
31
|
+
end
|
32
|
+
it 'should return result of condition' do
|
33
|
+
browser.key_press_with_condition("c)") { true }.should be_true
|
34
|
+
end
|
35
|
+
it 'should return result of condition' do
|
36
|
+
browser.key_press_with_condition("c") { false }.should be_false
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe '#action_with_condition' do
|
41
|
+
it 'should fail without condition' do
|
42
|
+
browser.action_with_condition("Copy link").should be_false
|
43
|
+
end
|
44
|
+
it 'should return result of condition' do
|
45
|
+
browser.action_with_condition("Copy link") { true }.should be_true
|
46
|
+
end
|
47
|
+
it 'should return result of condition' do
|
48
|
+
browser.action_with_condition("Copy link") { false }.should be_false
|
49
|
+
end
|
50
|
+
it 'should throw exception for nonexisting action' do
|
51
|
+
expect { browser.action_with_condition("Make dinner and do the laundry") { true } }.to raise_error(NativeException)
|
52
|
+
end
|
53
|
+
end
|
9
54
|
|
10
55
|
describe '#goto' do
|
11
|
-
it 'loads page'
|
56
|
+
it 'loads page' do
|
57
|
+
browser.goto("http://t/platforms/desktop/automated/resources/documents/page1.html").should > 0
|
58
|
+
end
|
12
59
|
end
|
13
60
|
|
14
61
|
|
@@ -48,14 +95,16 @@ describe 'DesktopBrowser' do
|
|
48
95
|
browser.open_window_with_action("Document Window", "New page", "1").should open_window
|
49
96
|
end
|
50
97
|
|
51
|
-
it 'fails for actions not opening a new window'
|
98
|
+
it 'fails for actions not opening a new window' # do #is blocked by DSK-335495
|
99
|
+
# browser.open_window_with_action("Document Window", "Close page", "1").should_not open_window
|
100
|
+
#end
|
52
101
|
end
|
53
102
|
|
54
103
|
describe '#load_window_with_action' do
|
55
104
|
it 'loads window' do
|
56
105
|
browser.load_window_with_action("Document Window", "Open url in new page", WatirSpec.files + "/boxes.html").should > 0
|
57
106
|
end
|
58
|
-
it 'fails for actions not loading'
|
107
|
+
it 'fails for actions not loading' # no supported actions for not loading window
|
59
108
|
end
|
60
109
|
|
61
110
|
describe '#open_window_with_key_press' do
|
@@ -64,7 +113,7 @@ describe 'DesktopBrowser' do
|
|
64
113
|
end
|
65
114
|
end
|
66
115
|
end
|
67
|
-
|
116
|
+
|
68
117
|
describe 'close window' do
|
69
118
|
before(:each) do
|
70
119
|
browser.open_window_with_key_press("Document Window", "t", :ctrl).should > 0
|
@@ -87,12 +136,15 @@ describe 'DesktopBrowser' do
|
|
87
136
|
after(:each) do
|
88
137
|
browser.close_all_dialogs
|
89
138
|
end
|
139
|
+
|
90
140
|
describe '#open_dialog_with_url' do
|
91
|
-
|
141
|
+
it 'opens dialog' do
|
142
|
+
browser.open_dialog_with_url("Download Dialog", WatirSpec.files + "/d_file.ini").should > 0
|
143
|
+
end
|
92
144
|
end
|
93
145
|
|
94
|
-
describe '#open_dialog_with_click' do
|
95
|
-
it 'opens dialog'
|
146
|
+
describe '#open_dialog_with_click' do
|
147
|
+
it 'opens dialog' #needs to be changed due to changes in the core methods
|
96
148
|
end
|
97
149
|
|
98
150
|
end
|
@@ -118,25 +170,56 @@ describe 'DesktopBrowser' do
|
|
118
170
|
end
|
119
171
|
|
120
172
|
describe '#activate_tab_with_key_press' do
|
121
|
-
|
173
|
+
before(:each) do
|
174
|
+
url = WatirSpec.files + "/two_input_fields.html"
|
175
|
+
browser.open_window_with_key_press("Document Window", "t", :ctrl).should > 0
|
176
|
+
browser.quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").load_page_with_url(url)
|
177
|
+
end
|
178
|
+
after(:each) do
|
179
|
+
browser.close_all_tabs
|
180
|
+
end
|
181
|
+
it 'activates the next tab' do
|
182
|
+
|
183
|
+
text = browser.quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").text
|
184
|
+
if browser.mac?
|
185
|
+
browser.activate_tab_with_key_press("tab", :meta).should > 0
|
186
|
+
elsif
|
187
|
+
browser.activate_tab_with_key_press("F6", :ctrl).should > 0
|
188
|
+
end
|
189
|
+
#Check we switched pages
|
190
|
+
browser.quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").text.should_not == text
|
191
|
+
end
|
122
192
|
end
|
123
193
|
|
124
194
|
describe '#set_alignment_with_action' do
|
125
|
-
it 'sets alignment'
|
195
|
+
it 'sets alignment' do
|
196
|
+
browser.set_alignment_with_action("pagebar", 2)
|
197
|
+
browser.set_alignment_with_action("pagebar", 3)
|
198
|
+
browser.set_alignment_with_action("pagebar", 4)
|
199
|
+
browser.set_alignment_with_action("pagebar", 1)
|
200
|
+
end
|
126
201
|
end
|
127
202
|
|
128
203
|
describe '#widgets' do
|
129
204
|
it 'retrieves all widgets' do
|
130
205
|
browser.widgets("Browser Window").should_not be_empty
|
131
206
|
end
|
132
|
-
it 'retrieves only
|
207
|
+
it 'retrieves only widgets' do
|
208
|
+
browser.widgets("Browser Window").select { |w| w.kind_of? OperaWatir::QuickWindow }.should be_empty
|
209
|
+
end
|
210
|
+
it 'retrieves widgets in correct window' do
|
211
|
+
docwins = browser.quick_windows.select { | w | w.name == "Document Window" }
|
212
|
+
browser.widgets("Browser Window").select { | w | docwins.include?(w.send :window_id) }.should be_empty
|
213
|
+
end
|
133
214
|
end
|
134
215
|
|
135
216
|
describe '#quick_windows' do
|
136
217
|
it 'retrieves all windows' do
|
137
218
|
browser.quick_windows.should_not be_empty
|
138
219
|
end
|
139
|
-
it 'retrieves only windows'
|
220
|
+
it 'retrieves only windows' do
|
221
|
+
browser.quick_windows.select { | win | win.kind_of? QuickWidget }.should be_empty
|
222
|
+
end
|
140
223
|
end
|
141
224
|
|
142
225
|
describe '#open_pages' do
|
@@ -196,10 +279,14 @@ describe 'DesktopBrowser' do
|
|
196
279
|
browser.window_name(valid_id).should == "Document Window"
|
197
280
|
end
|
198
281
|
end
|
199
|
-
|
282
|
+
|
200
283
|
describe '#load_page_with_key_press' do
|
201
|
-
it 'load page'
|
284
|
+
it 'load page' do
|
285
|
+
browser.quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").focus_with_click
|
286
|
+
browser.quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").type_text(WatirSpec.files + "/boxes.html").should include "/boxes.html"
|
287
|
+
browser.load_page_with_key_press("Enter").should > 0
|
202
288
|
end
|
289
|
+
end
|
203
290
|
|
204
291
|
describe '#path' do
|
205
292
|
it 'is not be empty' do
|
@@ -242,10 +329,16 @@ describe 'DesktopBrowser' do
|
|
242
329
|
end
|
243
330
|
|
244
331
|
describe '#mac?' do
|
332
|
+
it 'returns boolean value' do
|
333
|
+
[true, false].should include browser.mac?
|
334
|
+
end
|
245
335
|
end
|
246
336
|
|
247
337
|
describe '#linux?' do
|
338
|
+
it 'returns true or false' do
|
339
|
+
[true, false].should include browser.linux?
|
248
340
|
end
|
341
|
+
end
|
249
342
|
|
250
343
|
describe '#driver' do
|
251
344
|
end
|
@@ -255,15 +348,38 @@ describe 'DesktopBrowser' do
|
|
255
348
|
#attr_reader :driver
|
256
349
|
|
257
350
|
describe '#clear_all_private_data' do
|
258
|
-
it 'clears private data'
|
351
|
+
it 'clears private data' do
|
352
|
+
browser.load_window_with_action("Document Window", "Open url in new page", WatirSpec.files + "/boxes.html").should > 0
|
353
|
+
browser.clear_all_private_data.should > 0
|
354
|
+
|
355
|
+
if browser.mac?
|
356
|
+
browser.open_window_with_key_press("Document Window", "n", :ctrl).should > 0
|
357
|
+
end
|
358
|
+
|
359
|
+
browser.open_pages.length.should == 1
|
360
|
+
browser.quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").text.should == ""
|
361
|
+
end
|
259
362
|
end
|
260
363
|
|
261
364
|
describe '#clear_history' do
|
262
|
-
it 'clears history'
|
365
|
+
it 'clears history' #blocked due to DSK-327327
|
263
366
|
end
|
264
367
|
|
265
368
|
describe '#clear_cache' do
|
266
|
-
it 'clears cache'
|
369
|
+
it 'clears cache' do
|
370
|
+
browser.load_window_with_action("Document Window", "Open url in new page", "http://elg.no/").should > 0
|
371
|
+
browser.close_all_tabs
|
372
|
+
|
373
|
+
browser.load_window_with_action("Document Window", "Open url in current page", "opera:cache").should > 0
|
374
|
+
browser.text.include?("elg.no").should==true
|
375
|
+
|
376
|
+
browser.close_all_tabs
|
377
|
+
|
378
|
+
browser.clear_cache
|
379
|
+
|
380
|
+
browser.load_window_with_action("Document Window", "Open url in current page", "opera:cache").should > 0
|
381
|
+
browser.text.include?("elg.no").should==false
|
382
|
+
end
|
267
383
|
end
|
268
384
|
|
269
385
|
describe '#close_all_tabs' do
|
@@ -274,14 +390,27 @@ describe 'DesktopBrowser' do
|
|
274
390
|
end
|
275
391
|
|
276
392
|
describe '#reset_prefs' do
|
277
|
-
it 'resets prefs'
|
393
|
+
it 'resets prefs' do
|
394
|
+
browser.set_preference("User Prefs", "Speed Dial State", 5)
|
395
|
+
browser.get_preference("User Prefs", "Speed Dial State").should == "5"
|
396
|
+
browser.reset_prefs("Speed Dial State")
|
397
|
+
browser.get_preference("User Prefs", "Speed Dial State").should_not == "5"
|
278
398
|
end
|
279
|
-
|
399
|
+
end
|
400
|
+
|
280
401
|
describe '#delete_profile' do
|
281
402
|
it 'deletes profile' do
|
282
|
-
|
403
|
+
browser.quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").load_page_with_url(WatirSpec.files + "/boxes.html").should include "/boxes.html"
|
404
|
+
browser.open_window_with_key_press("Document Window", "t", :ctrl).should > 0
|
405
|
+
browser.open_window_with_key_press("Document Window", "t", :ctrl).should > 0
|
406
|
+
browser.quick_tabbuttons("Browser Window").length.should == 3
|
407
|
+
browser.quit_opera
|
408
|
+
browser.delete_profile
|
409
|
+
browser.start_opera
|
410
|
+
browser.quick_tabbuttons("Browser Window").length.should == 1
|
411
|
+
browser.quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").text.should == "opera:debug"
|
283
412
|
end
|
284
|
-
it 'doesn\'t delete main profile'
|
413
|
+
it 'doesn\'t delete main profile'
|
285
414
|
end
|
286
415
|
|
287
416
|
describe '#set_preference' do
|
@@ -297,7 +426,46 @@ describe 'DesktopBrowser' do
|
|
297
426
|
end
|
298
427
|
|
299
428
|
describe '#get_default_preference' do
|
300
|
-
it 'gets default value of preference'
|
429
|
+
it 'gets default value of preference' do
|
430
|
+
def_pref = browser.get_default_preference("User Prefs", "Speed Dial State")
|
431
|
+
browser.set_preference("User Prefs", "Speed Dial State", 7)
|
432
|
+
browser.get_preference("User Prefs", "Speed Dial State").should == "7"
|
433
|
+
browser.get_default_preference("User Prefs", "Speed Dial State").should == def_pref
|
434
|
+
end
|
435
|
+
end
|
436
|
+
|
437
|
+
describe 'open_menu_with_key_press' do
|
438
|
+
let(:menubutton) { browser.quick_window(:name, "Browser Window").quick_toolbar(:name, "Pagebar Head").quick_button(:name, "tbb_MenuButton")}
|
439
|
+
let(:mainmenu) { browser.quick_menu(:name, "Browser Button Menu Bar")}
|
440
|
+
before(:all) do #enable main menu
|
441
|
+
#let(:menubutton) { browser.quick_window(:name, "Browser Window").quick_toolbar(:name, "Pagebar Head").quick_button(:name, "tbb_MenuButton")}
|
442
|
+
if menubutton.exists?
|
443
|
+
menubutton.open_menu_with_click("Browser Button Menu Bar").should open_menu
|
444
|
+
mainmenu.quick_menuitem(:action, "Enable menu bar").toggle_with_click
|
445
|
+
end
|
446
|
+
end
|
447
|
+
it 'opens a menu' do
|
448
|
+
browser.open_menu_with_key_press("Browser File Menu", "F", :alt).should open_menu
|
449
|
+
end
|
450
|
+
end
|
451
|
+
|
452
|
+
describe 'open_menu_with_right_click' do
|
453
|
+
before :all do
|
454
|
+
browser.url = fixture('onclick.html')
|
455
|
+
#browser.goto 'file://localhost/home/karianne/ui_test/opera-watir/spec/operawatir/fixtures/onclick.html'
|
456
|
+
end
|
457
|
+
after(:all) do
|
458
|
+
#addressfield.click
|
459
|
+
#browser.close_all_menus
|
460
|
+
end
|
461
|
+
it 'opens a menu' do
|
462
|
+
elem = window.find_by_tag('button')
|
463
|
+
browser.open_menu_with_rightclick(elem, "").should open_menu
|
464
|
+
end
|
465
|
+
end
|
466
|
+
|
467
|
+
describe 'close_menu_with_key_press' do
|
468
|
+
it 'closes menu'
|
301
469
|
end
|
302
470
|
|
303
471
|
# Gets the parent widget name of which there is none here
|
@@ -312,5 +480,6 @@ describe 'DesktopBrowser' do
|
|
312
480
|
# browser.window_id.should be_nil
|
313
481
|
# end
|
314
482
|
#end
|
483
|
+
|
315
484
|
end
|
316
485
|
|