operawatir 0.4.1.pre5-jruby → 0.4.1.pre6-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.
Files changed (60) hide show
  1. data/AUTHORS +1 -0
  2. data/CHANGES +170 -3
  3. data/README.md +30 -27
  4. data/VERSION +1 -1
  5. data/bin/desktopwatir +19 -16
  6. data/bin/operawatir +4 -4
  7. data/lib/operadriver/client-combined-nodeps.jar +0 -0
  8. data/lib/operadriver/webdriver-opera.jar +0 -0
  9. data/lib/operawatir/browser.rb +1 -2
  10. data/lib/operawatir/collection.rb +1 -1
  11. data/lib/operawatir/compat/collection.rb +13 -0
  12. data/lib/operawatir/compat/element.rb +57 -15
  13. data/lib/operawatir/compat/window.rb +41 -0
  14. data/lib/operawatir/desktop_browser.rb +26 -9
  15. data/lib/operawatir/desktop_container.rb +82 -29
  16. data/lib/operawatir/element.rb +48 -24
  17. data/lib/operawatir/keys.rb +18 -25
  18. data/lib/operawatir/preferences.rb +223 -6
  19. data/lib/operawatir/quickwidgets/quick_button.rb +8 -2
  20. data/lib/operawatir/quickwidgets/quick_checkbox.rb +4 -4
  21. data/lib/operawatir/quickwidgets/quick_editfield.rb +1 -1
  22. data/lib/operawatir/quickwidgets/quick_find.rb +11 -0
  23. data/lib/operawatir/quickwidgets/quick_griditem.rb +11 -0
  24. data/lib/operawatir/quickwidgets/quick_gridlayout.rb +11 -0
  25. data/lib/operawatir/quickwidgets/quick_searchfield.rb +5 -1
  26. data/lib/operawatir/quickwidgets/quick_tab.rb +0 -1
  27. data/lib/operawatir/quickwidgets/quick_treeitem.rb +22 -1
  28. data/lib/operawatir/quickwidgets/quick_widget.rb +61 -22
  29. data/lib/operawatir/quickwidgets/quick_window.rb +26 -0
  30. data/lib/operawatir/quickwidgets.rb +2 -1
  31. data/lib/operawatir/window.rb +36 -25
  32. data/lib/operawatir.rb +1 -1
  33. data/operawatir.gemspec +38 -5
  34. data/spec/operawatir/core/element_spec.rb +5 -0
  35. data/spec/operawatir/core/window_spec.rb +42 -0
  36. data/spec/operawatir/desktop/desktopbrowser_spec.rb +16 -0
  37. data/spec/operawatir/desktop/quickaddressfield_spec.rb +15 -3
  38. data/spec/operawatir/desktop/quickbutton_spec.rb +234 -20
  39. data/spec/operawatir/desktop/quickcheckbox_spec.rb +36 -0
  40. data/spec/operawatir/desktop/quickdialogtab_spec.rb +30 -0
  41. data/spec/operawatir/desktop/quickdropdown_spec.rb +39 -0
  42. data/spec/operawatir/desktop/quickeditfield_spec.rb +51 -0
  43. data/spec/operawatir/desktop/quickfind_spec.rb +30 -0
  44. data/spec/operawatir/desktop/quickgriditem_spec.rb +16 -0
  45. data/spec/operawatir/desktop/quickgridlayout_spec.rb +15 -0
  46. data/spec/operawatir/desktop/quicklabel_spec.rb +28 -0
  47. data/spec/operawatir/desktop/quickradiobutton_spec.rb +24 -0
  48. data/spec/operawatir/desktop/quicksearchfield_spec.rb +26 -0
  49. data/spec/operawatir/desktop/quicktab_spec.rb +86 -0
  50. data/spec/operawatir/desktop/quickthumbnail_spec.rb +37 -0
  51. data/spec/operawatir/desktop/quicktreeitem_spec.rb +135 -0
  52. data/spec/operawatir/desktop/quicktreeview_spec.rb +30 -0
  53. data/spec/operawatir/desktop/quickwidget_spec.rb +52 -11
  54. data/spec/operawatir/desktop/quickwindow_spec.rb +11 -0
  55. data/spec/operawatir/desktop/shared/shared.rb +100 -10
  56. data/spec/operawatir/fixtures/browsers.svg +367 -0
  57. data/spec/operawatir/fixtures/frames.html +13 -0
  58. data/spec/watir2/select_list_spec.rb +84 -71
  59. metadata +37 -4
  60. data/lib/operadriver/selenium-common.jar +0 -0
@@ -0,0 +1,36 @@
1
+ require File.expand_path('../../watirspec_desktophelper', __FILE__)
2
+ require File.expand_path('../shared/shared', __FILE__)
3
+
4
+ describe 'QuickCheckbox' do
5
+
6
+ before(:each) do
7
+ browser.open_dialog_with_action("New Preferences Dialog", "Show preferences", 4)
8
+ browser.quick_treeview(:name, "Advanced_treeview").quick_treeitem(:string_id, "D_NEW_PREFS_SECURITY").activate_tab_with_click
9
+ end
10
+
11
+ after(:each) do
12
+ browser.close_all_dialogs
13
+ end
14
+
15
+ let(:widget) { browser.quick_checkbox(:name, "Trust_info_checkbox") }
16
+ subject { widget }
17
+
18
+ it_behaves_like 'a checkbox'
19
+
20
+ its(:type) { should == :checkbox }
21
+
22
+ describe '#open_dialog_with_click' do
23
+ it 'returns window id' do
24
+ browser.quick_button(:name, "Set_password_button").open_dialog_with_click("Change Masterpassword Dialog").should > 0
25
+ browser.quick_editfield(:name, "Password_edit").focus_with_click
26
+ browser.quick_editfield(:name, "Password_edit").type_text("masterpass1").should == "masterpass1"
27
+ browser.quick_editfield(:name, "Confirm_password_edit").focus_with_click
28
+ browser.quick_editfield(:name, "Confirm_password_edit").type_text("masterpass1").should == "masterpass1"
29
+ browser.quick_button(:name, "button_OK").close_dialog_with_click("Change Masterpassword Dialog").should close_dialog
30
+ browser.quick_checkbox(:name, "Master_password_checkbox").open_dialog_with_click("Security Password Dialog").should > 0
31
+ end
32
+ end
33
+
34
+ end
35
+
36
+
@@ -0,0 +1,30 @@
1
+ require File.expand_path('../../watirspec_desktophelper', __FILE__)
2
+ require File.expand_path('../shared/shared', __FILE__)
3
+
4
+ describe 'QuickDialogTab' do
5
+ before(:all) do
6
+ browser.open_dialog_with_action("New Preferences Dialog", "Show preferences").should > 0
7
+ end
8
+
9
+ after(:all) do
10
+ browser.close_all_dialogs
11
+ end
12
+
13
+ let(:widget) { browser.quick_dialogtab(:name, "tab_prefs_advanced") }
14
+ subject { widget }
15
+
16
+ it_behaves_like 'a widget'
17
+
18
+ its(:type) { should == :dialogtab }
19
+
20
+ describe '#activate_tab_with_click' do
21
+ it 'activates a tab with click' do
22
+ browser.quick_dialogtab(:name, "tab_prefs_advanced").activate_tab_with_click
23
+ browser.quick_checkbox(:name, "Thumbnails_in_tab_cycle").should be_visible
24
+ end
25
+ end
26
+
27
+ end
28
+
29
+
30
+
@@ -0,0 +1,39 @@
1
+ require File.expand_path('../../watirspec_desktophelper', __FILE__)
2
+ require File.expand_path('../shared/shared', __FILE__)
3
+
4
+ describe 'QuickDropdown' do
5
+
6
+ before(:all) do
7
+ browser.open_dialog_with_action("New Preferences Dialog", "Show preferences", 0).should > 0
8
+ end
9
+
10
+ after(:all) do
11
+ browser.close_all_tabs
12
+ browser.close_all_dialogs
13
+ end
14
+
15
+ let(:widget) { browser.quick_dropdown(:name, "Startup_mode_dropdown") }
16
+ subject { widget }
17
+
18
+ it_behaves_like 'a widget'
19
+
20
+
21
+ describe '#selected?'do
22
+ it 'returns true for selected item' do
23
+ browser.quick_dropdown(:name, "Startup_mode_dropdown").selected?("D_STARTUP_LAST_TIME").should be_true
24
+ end
25
+
26
+ it 'returns false for not selected item' do
27
+ browser.quick_dropdown(:name, "Startup_mode_dropdown").selected?("D_STARTUP_SAVED_SESSIONS").should be_false
28
+ end
29
+
30
+ it 'raises an exception' do
31
+ browser.close_all_dialogs
32
+ lambda { browser.quick_dropdown(:name, "Startup_mode_dropdown").selected?("D_STARTUP_SAVED_SESSIONS") }.should raise_error OperaWatir::DesktopExceptions::UnknownObjectException
33
+ end
34
+
35
+ end
36
+
37
+
38
+ end
39
+
@@ -0,0 +1,51 @@
1
+ require File.expand_path('../../watirspec_desktophelper', __FILE__)
2
+ require File.expand_path('../shared/shared', __FILE__)
3
+
4
+
5
+ describe 'QuickEditField' do
6
+
7
+ before(:all) do
8
+ browser.open_dialog_with_action("New Preferences Dialog", "Show preferences", 1).should open_dialog
9
+ end
10
+
11
+ after(:all) do
12
+ browser.close_all_tabs
13
+ browser.close_all_dialogs
14
+ end
15
+
16
+ let(:url1) { "http://t/platforms/desktop/automated/resources/documents/page1.html" }
17
+ let(:url2) { "http://t/platforms/desktop/automated/resources/documents/page2.html" }
18
+
19
+ let(:widget) { browser.quick_editfield(:name, "Firstname_edit") }
20
+ subject { widget }
21
+
22
+ it_behaves_like 'a widget'
23
+ it_behaves_like 'an editfield'
24
+
25
+ its(:type) { should == :editfield }
26
+
27
+ describe '#load_page_with_key_press(key, *modifiers)' do
28
+ it 'loads page' do
29
+ browser.close_all_dialogs
30
+ browser.quick_window(:name, "Document Window").quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").focus_with_click
31
+ browser.quick_window(:name, "Document Window").quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").clear
32
+ browser.quick_window(:name, "Document Window").quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").type_text(url1).should == url1
33
+ browser.load_page_with_key_press("Enter").should > 0
34
+ browser.quick_window(:name, "Document Window").quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").text.should == url1
35
+ browser.quick_window(:name, "Browser Window").quick_toolbar(:name, "Pagebar").quick_tab(:name, "Tab 0").text.should == "Test Page 1"
36
+ end
37
+ end
38
+
39
+ =begin # it is a private method
40
+ describe '#enter_text_and_hit_enter(text)' do
41
+ it "type text and press enter in the same method" do
42
+ browser.quick_window(:name, "Document Window").quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").focus_with_click
43
+ browser.quick_window(:name, "Document Window").quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").clear
44
+ browser.quick_window(:name, "Document Window").quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").enter_text_and_hit_enter(url2).should == url2
45
+ browser.quick_window(:name, "Document Window").quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").text.should == url2
46
+ browser.quick_window(:name, "Browser Window").quick_toolbar(:name, "Pagebar").quick_tab(:name, "Tab 0").text.should == "Test Page 2"
47
+ end
48
+ end
49
+ =end
50
+
51
+ end
@@ -0,0 +1,30 @@
1
+ require File.expand_path('../../watirspec_desktophelper', __FILE__)
2
+ require File.expand_path('../shared/shared', __FILE__)
3
+
4
+ describe 'QuickFind' do
5
+
6
+ before(:all) do
7
+ browser.open_dialog_with_action("New Preferences Dialog", "Show preferences", 4).should > 0
8
+ browser.quick_treeview(:name, "Advanced_treeview").quick_treeitem(:text, "Downloads").activate_tab_with_click
9
+ end
10
+
11
+ after(:all) do
12
+ browser.close_all_dialogs
13
+ end
14
+
15
+ let(:widget) { browser.quick_find(:name, "Filetypes_quickfind") }
16
+
17
+ subject { widget }
18
+
19
+ it_behaves_like 'an editfield'
20
+ it_behaves_like 'a widget'
21
+
22
+ its(:type) { should == :quickfind }
23
+
24
+ describe '#quick_find' do
25
+ it 'constructs quickfind by its name' do
26
+ browser.quick_find(:name, "Filetypes_quickfind").should exist
27
+ end
28
+ end
29
+
30
+ end
@@ -0,0 +1,16 @@
1
+ require File.expand_path('../../watirspec_desktophelper', __FILE__)
2
+
3
+ describe 'QuickItem' do
4
+
5
+ #let(:widget) { browser.quick_label(:name, "label_for_Name_edit") }
6
+ #subject { widget }
7
+ #it_behaves_like "a widget"
8
+ #its(:type) { should == :griditem }
9
+
10
+ describe '#quick_griditem' do
11
+ it 'constructs grid_item by its name' do
12
+ browser.quick_griditem(:name, "some_name")
13
+ end
14
+ end
15
+
16
+ end
@@ -0,0 +1,15 @@
1
+ require File.expand_path('../../watirspec_desktophelper', __FILE__)
2
+
3
+ describe 'QuickLayout' do
4
+
5
+ #let(:widget) { browser.quick_label(:name, "label_for_Name_edit") }
6
+ #subject { widget }
7
+ #it_behaves_like "a widget"
8
+ #its(:type) { should == :gridlayout }
9
+
10
+ describe '#quick_gridlayout' do
11
+ it 'constructs grid_layout by its name' do
12
+ browser.quick_gridlayout(:name, "some_name")
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,28 @@
1
+ require File.expand_path('../../watirspec_desktophelper', __FILE__)
2
+ require File.expand_path('../shared/shared', __FILE__)
3
+
4
+ describe 'QuickLabel' do
5
+
6
+ before(:all) do
7
+ browser.open_dialog_with_key_press("Add Bookmark Dialog", 'd', :ctrl)
8
+ end
9
+
10
+ after(:all) do
11
+ browser.close_all_dialogs
12
+ end
13
+
14
+ let(:widget) { browser.quick_label(:name, "label_for_Name_edit") }
15
+
16
+ subject { widget }
17
+
18
+ it_behaves_like "a widget"
19
+
20
+ its(:type) { should == :label }
21
+
22
+ describe '#quick_label' do
23
+ it 'constructs label by its name' do
24
+ browser.quick_label(:name, "label_for_Name_edit").should exist
25
+ end
26
+ end
27
+
28
+ end
@@ -0,0 +1,24 @@
1
+ require File.expand_path('../../watirspec_desktophelper', __FILE__)
2
+ require File.expand_path('../shared/shared', __FILE__)
3
+
4
+ describe 'QuickRadiobox' do
5
+
6
+ before(:all) do
7
+ browser.open_dialog_with_action("New Preferences Dialog", "Show preferences", 4)
8
+ browser.quick_treeview(:name, "Advanced_treeview").quick_treeitem(:string_id, "D_NEW_PREFS_COOKIES").activate_tab_with_click
9
+ end
10
+
11
+ after(:all) do
12
+ browser.close_all_dialogs
13
+ end
14
+
15
+ let(:widget) { browser.quick_radiobutton(:name, "Accept_cookies_radio") }
16
+ subject { widget }
17
+
18
+ it_behaves_like 'a widget'
19
+ it_behaves_like 'a checkbox'
20
+
21
+ its(:type) { should == :radiobutton }
22
+
23
+
24
+ end
@@ -0,0 +1,26 @@
1
+ require File.expand_path('../../watirspec_desktophelper', __FILE__)
2
+ require File.expand_path('../shared/shared', __FILE__)
3
+
4
+ describe 'QuickSearchField' do
5
+
6
+ let(:widget) { browser.quick_window(:name, "Document Window").quick_toolbar(:name, "Document Toolbar").quick_searchfield(:name, "tbs_MainSearch") }
7
+ subject { widget }
8
+
9
+ it_behaves_like "a widget"
10
+ it_behaves_like "an editfield"
11
+
12
+ its(:type) { should == :search }
13
+
14
+ describe '#quick_searchfield' do
15
+ it 'constructs searchfield by its name' do
16
+ browser.quick_window(:name, "Document Window").quick_toolbar(:name, "Document Toolbar").quick_searchfield(:name, "tbs_MainSearch").should exist
17
+ end
18
+ end
19
+
20
+ describe '#search_with_text' do
21
+ it 'returns text in address field after loading of page' do
22
+ browser.quick_window(:name, "Document Window").quick_toolbar(:name, "Document Toolbar").quick_searchfield(:name, "tbs_MainSearch").search_with_text("old cars").should include "http://www.google.no/search"
23
+ end
24
+ end
25
+
26
+ end
@@ -0,0 +1,86 @@
1
+ require File.expand_path('../../watirspec_desktophelper', __FILE__)
2
+ require File.expand_path('../shared/shared', __FILE__)
3
+
4
+ describe 'QuickTab' do
5
+
6
+ let(:url1) { "http://t/platforms/desktop/automated/resources/documents/page1.html" }
7
+ let(:url2) { "http://t/platforms/desktop/automated/resources/documents/page2.html" }
8
+
9
+ let(:widget) { browser.quick_window(:name, "Browser Window").quick_toolbar(:name, "Pagebar").quick_tab(:name, "Tab 0") }
10
+
11
+ subject { widget }
12
+
13
+ it_behaves_like "a widget"
14
+ it_behaves_like "a button"
15
+
16
+ its(:type) { should == :tabbutton }
17
+
18
+ describe '#quick_tab' do
19
+ before(:all) do
20
+ browser.quick_window(:name, "Document Window").quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").load_page_with_url(url1).should == url1
21
+ browser.load_window_with_action("Document Window", "Open url in new page", url2).should > 0
22
+ end
23
+
24
+ it 'constructs tabbutton by its position' do
25
+ browser.quick_window(:name, "Browser Window").quick_toolbar(:name, "Pagebar").quick_tab(:pos, 0).should exist
26
+ end
27
+ it 'constructs tabbutton by its name' do
28
+ browser.quick_window(:name, "Browser Window").quick_toolbar(:name, "Pagebar").quick_tab(:name, "Tab 0").should exist
29
+ end
30
+ it 'constructs tabbutton by its text' do
31
+ browser.quick_window(:name, "Browser Window").quick_toolbar(:name, "Pagebar").quick_tab(:text, "Test Page 1").should exist
32
+ end
33
+
34
+ after(:all) do
35
+ browser.close_all_tabs
36
+ end
37
+ end
38
+
39
+ describe '#move_with_drag' do
40
+ describe 'when target is not a tab' do
41
+ it 'raises UnknownObjectException'
42
+ end
43
+ end
44
+
45
+ describe '#activate_tab_with_click' do
46
+ before(:all) do
47
+ browser.quick_window(:name, "Document Window").quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").load_page_with_url(url1).should == url1
48
+ browser.load_window_with_action("Document Window", "Open url in new page", url2).should > 0
49
+ end
50
+
51
+ it 'returns windowid of window activated' do
52
+ browser.quick_window(:name, "Browser Window").quick_toolbar(:name, "Pagebar").quick_tab(:name, "Tab 0").activate_tab_with_click.should > 0
53
+ end
54
+
55
+ context 'when the window is already active' do
56
+ it 'returns 0' do
57
+ browser.quick_window(:name, "Browser Window").quick_toolbar(:name, "Pagebar").quick_tab(:name, "Tab 0").activate_tab_with_click.should == 0
58
+ end
59
+ end
60
+
61
+ context 'when the tab button does not exist' do
62
+ it 'raises UnknownObjectException' #do
63
+ #expect { browser.quick_window(:name, "Browser Window").quick_toolbar(:name, "Pagebar").quick_tab(:name, "Tab 2").activate_tab_with_click }.to raise(OperaWatir::Exceptions::UnknownObjectException)
64
+ #end
65
+ end
66
+
67
+ context 'when the tab button is not visible' do
68
+ it 'raises WidgetNotVisibleException'
69
+ end
70
+
71
+ it 'activates a tab with click' do
72
+ browser.quick_window(:name, "Browser Window").quick_toolbar(:name, "Pagebar").quick_tab(:name, "Tab 0").activate_tab_with_click
73
+ browser.quick_window(:name, "Browser Window").quick_toolbar(:name, "Pagebar").quick_tab(:name, "Tab 0").text.should == "Test Page 1"
74
+ browser.quick_window(:name, "Browser Window").quick_toolbar(:name, "Pagebar").quick_tab(:name, "Tab 1").activate_tab_with_click
75
+ browser.quick_window(:name, "Browser Window").quick_toolbar(:name, "Pagebar").quick_tab(:name, "Tab 1").text.should == "Test Page 2"
76
+ end
77
+ end
78
+
79
+ #Note this part of api will probably change when new tab grouping is handled
80
+ describe '#group_with_drag' do
81
+ it 'raises UnknownObjectException if target is not a tab'
82
+ it 'returns the number of tabs in the tab group'
83
+ it 'returns 1 if not a group'
84
+ end
85
+
86
+ end
@@ -0,0 +1,37 @@
1
+ require File.expand_path('../../watirspec_desktophelper', __FILE__)
2
+ require File.expand_path('../shared/shared', __FILE__)
3
+
4
+ describe 'QuickThumbnail' do
5
+
6
+ before(:all) do
7
+ browser.open_window_with_key_press("Document Window", "t", :ctrl)
8
+ end
9
+
10
+ let(:widget) { browser.quick_thumbnail(:name, "Speed Dial 1") }
11
+
12
+ subject { widget }
13
+
14
+ it_behaves_like 'a widget'
15
+ it_behaves_like 'a button'
16
+
17
+ its(:type) { should == :thumbnail }
18
+
19
+ #This is really on browser, widgets, and window
20
+ describe '#quick_thumbnail' do
21
+ it 'constructs thumbnail by its position' do
22
+ browser.quick_thumbnail(:pos, 1).should exist
23
+ end
24
+ it 'constructs thumbnail by its name' do
25
+ browser.quick_thumbnail(:name, "Speed Dial 1").should exist
26
+ end
27
+ it 'constructs thumbnail by its text'
28
+ end
29
+
30
+ describe '#move_with_drag' do
31
+ it 'moves thumbnail'
32
+ context 'when target is not a thumbnail' do
33
+ it 'raises UnknownObjectException'
34
+ end
35
+ end
36
+
37
+ end
@@ -0,0 +1,135 @@
1
+ require File.expand_path('../../watirspec_desktophelper', __FILE__)
2
+ require File.expand_path('../shared/shared', __FILE__)
3
+
4
+ describe 'QuickTreeItem' do
5
+
6
+ describe 'a widget' do
7
+ before(:all) do
8
+ browser.open_window_with_key_press("Bookmarks Panel Window", "b", :ctrl, :shift)
9
+ end
10
+
11
+ after(:all) do
12
+ browser.close_all_tabs
13
+ end
14
+
15
+ let(:widget) { browser.quick_window(:name, "Bookmarks Panel Window").quick_treeview(:name, "Bookmarks View").quick_treeitem(:pos, [0, 0]) }
16
+ subject { widget }
17
+
18
+ it_behaves_like 'a widget'
19
+
20
+ its(:type) { should == :treeitem }
21
+ end
22
+ #describe '#correct_type?' do
23
+ #end
24
+
25
+ describe '#focus_with_click' do
26
+
27
+ before(:all) do
28
+ browser.open_dialog_with_action("New Preferences Dialog", "Show preferences").should > 0
29
+ browser.quick_dialogtab(:name, "tab_prefs_advanced").activate_tab_with_click
30
+ end
31
+
32
+ it 'focus a treeitem' do
33
+ browser.quick_treeview(:name, "Advanced_treeview").quick_treeitem(:string_id, "D_NEW_PREFS_SHORTCUTS").focus_with_click
34
+ browser.quick_checkbox(:name, "Mouse_gestures_checkbox").should be_visible
35
+ end
36
+
37
+ after(:all) do
38
+ browser.close_all_dialogs
39
+ end
40
+ end
41
+
42
+ describe '#expand_with_click' do
43
+ before(:all) do
44
+ browser.open_dialog_with_action("New Preferences Dialog", "Show preferences").should > 0
45
+ browser.quick_dialogtab(:name, "tab_prefs_advanced").activate_tab_with_click
46
+ browser.quick_treeview(:name, "Advanced_treeview").quick_treeitem(:string_id, "D_NEW_PREFS_SHORTCUTS").activate_tab_with_click
47
+ browser.quick_button(:name, "button_keyboard_Edit").open_dialog_with_click("Input Manager Dialog").should > 0
48
+ end
49
+
50
+ it 'expand with click' do
51
+ browser.quick_treeview(:name, "Input_treeview").quick_treeitem(:text, "Application (defaults)").expand_with_click
52
+ browser.quick_treeview(:name, "Input_treeview").quick_treeitem(:text, "Copy").should be_visible
53
+ end
54
+
55
+ it 'collapse with click ' do
56
+ browser.quick_treeview(:name, "Input_treeview").quick_treeitem(:text, "Application (defaults)").collapse_with_click
57
+ browser.quick_treeview(:name, "Input_treeview").quick_treeitem(:text, "Copy").should_not be_visible
58
+ end
59
+
60
+ it 'raises exception' do
61
+ #browser.close_dialog("Input Manager Dialog").should close_dialog
62
+ lambda { browser.quick_treeview(:name, "Input_treeview").quick_treeitem(:text, "Copy").expand_with_click }.should raise_error OperaWatir::DesktopExceptions::WidgetNotVisibleException
63
+ end
64
+
65
+ after(:all) do
66
+ browser.close_all_dialogs
67
+ end
68
+ end
69
+
70
+ describe '#expand_with_double_click' do
71
+
72
+ before(:each) do
73
+ browser.open_window_with_key_press("Bookmarks Panel Window", "b", :ctrl, :shift).should > 0
74
+ browser.quick_treeview(:name, "Bookmarks Folders View").focus_with_click
75
+ browser.quick_window(:name, "Bookmarks Panel Window").quick_treeview(:name, "Bookmarks View").quick_treeitem(:text, "Opera").focus_with_click
76
+ end
77
+
78
+ it 'expand with double click' do
79
+ browser.quick_window(:name, "Bookmarks Panel Window").quick_treeview(:name, "Bookmarks View").quick_treeitem(:text, "Opera").expand_with_double_click
80
+ browser.quick_window(:name, "Bookmarks Panel Window").quick_treeview(:name, "Bookmarks View").quick_treeitem(:text, "http://www.opera.com/download/").should be_visible
81
+ end
82
+
83
+ it 'collapse with double click' do
84
+ browser.quick_window(:name, "Bookmarks Panel Window").quick_treeview(:name, "Bookmarks View").quick_treeitem(:text, "Opera").expand_with_double_click
85
+ browser.quick_window(:name, "Bookmarks Panel Window").quick_treeview(:name, "Bookmarks View").quick_treeitem(:text, "Opera").collapse_with_double_click
86
+ #browser.quick_window(:name, "Bookmarks Panel Window").quick_treeview(:name, "Bookmarks View").quick_treeitem(:text, "http://my.opera.com/").visible?.should == false
87
+ end
88
+
89
+ it 'Raises Exceptions' do
90
+ #browser.quick_window(:name, "Bookmarks Panel Window").quick_treeview(:name, "Bookmarks View").quick_treeitem(:text, "Opera").key_press("Del")
91
+ #lambda { browser.quick_window(:name, "Bookmarks Panel Window").quick_treeview(:name, "Bookmarks View").quick_treeitem(:text, "Opera").expand_with_double_click }.should raise_error OperaWatir::DesktopExceptions::WidgetNotVisibleException
92
+ end
93
+
94
+ after(:each) do
95
+ browser.close_all_tabs
96
+ browser.close_all_dialogs
97
+ end
98
+ end
99
+ # alias_method :collapse_with_double_click, :expand_with_double_click
100
+
101
+ describe '#key_press' do
102
+ it "key press with modifiers" do
103
+ browser.quick_window(:name, "Document Window").quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").focus_with_click
104
+ browser.quick_window(:name, "Document Window").quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").clear
105
+ browser.quick_window(:name, "Document Window").quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").type_text("opera:config").should == "opera:config"
106
+ #browser.quick_window(:name, "Document Window").quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").key_press("Enter")
107
+ browser.quick_window(:name, "Document Window").quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").key_press("a", :ctrl)
108
+ browser.quick_window(:name, "Document Window").quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").key_press("c", :ctrl)
109
+ browser.open_window_with_key_press("Document Window", "t", :ctrl).should > 0
110
+ browser.quick_window(:name, "Document Window").quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").focus_with_click
111
+ browser.quick_window(:name, "Document Window").quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").key_press("v", :ctrl)
112
+ browser.quick_window(:name, "Document Window").quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").text.should == "opera:config"
113
+ end
114
+
115
+ after(:all) do
116
+ browser.close_all_tabs
117
+ end
118
+ end
119
+
120
+ describe '#selected?' do
121
+ end
122
+
123
+ describe '#activate_tab_with_click' do
124
+ end
125
+
126
+ describe '#open_window_with_double_click(win_name)' do
127
+ end
128
+
129
+ # alias_method :open_dialog_with_double_click, :open_window_with_double_click
130
+
131
+ #private
132
+ describe '#scroll_item_into_view' do
133
+ end
134
+ end
135
+