operawatir 0.4.3.pre1-jruby → 0.5-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 (98) hide show
  1. data/.gitmodules +1 -1
  2. data/CHANGES +230 -0
  3. data/Gemfile +4 -0
  4. data/Rakefile +3 -2
  5. data/VERSION +1 -1
  6. data/bin/desktopwatir +1 -1
  7. data/bin/operawatir +16 -4
  8. data/lib/operadriver/guava-r09.jar +0 -0
  9. data/lib/operadriver/operadriver-v0.7.2.jar +0 -0
  10. data/lib/operadriver/selenium-nodeps-20100909.jar +0 -0
  11. data/lib/operawatir.rb +10 -3
  12. data/lib/operawatir/actions.rb +111 -0
  13. data/lib/operawatir/browser.rb +24 -20
  14. data/lib/operawatir/clickable_item.rb +68 -0
  15. data/lib/operawatir/compat.rb +4 -4
  16. data/lib/operawatir/compat/collection.rb +1 -1
  17. data/lib/operawatir/compat/element.rb +1 -1
  18. data/lib/operawatir/compat/window.rb +4 -3
  19. data/lib/operawatir/desktop_browser.rb +299 -95
  20. data/lib/operawatir/desktop_common.rb +88 -23
  21. data/lib/operawatir/desktop_container.rb +103 -34
  22. data/lib/operawatir/desktop_enums.rb +4 -4
  23. data/lib/operawatir/desktop_exceptions.rb +2 -2
  24. data/lib/operawatir/desktop_helper.rb +31 -8
  25. data/lib/operawatir/element.rb +6 -2
  26. data/lib/operawatir/exceptions.rb +4 -4
  27. data/lib/operawatir/helper.rb +6 -6
  28. data/lib/operawatir/keys.rb +4 -4
  29. data/lib/operawatir/preferences.rb +126 -155
  30. data/lib/operawatir/quickwidgets.rb +3 -3
  31. data/lib/operawatir/quickwidgets/quick_addressfield.rb +12 -5
  32. data/lib/operawatir/quickwidgets/quick_button.rb +39 -53
  33. data/lib/operawatir/quickwidgets/quick_checkbox.rb +6 -6
  34. data/lib/operawatir/quickwidgets/quick_dialogtab.rb +5 -5
  35. data/lib/operawatir/quickwidgets/quick_dropdown.rb +28 -4
  36. data/lib/operawatir/quickwidgets/quick_dropdownitem.rb +46 -0
  37. data/lib/operawatir/quickwidgets/quick_editfield.rb +16 -13
  38. data/lib/operawatir/quickwidgets/quick_label.rb +1 -1
  39. data/lib/operawatir/quickwidgets/quick_menu.rb +155 -0
  40. data/lib/operawatir/quickwidgets/quick_menuitem.rb +387 -0
  41. data/lib/operawatir/quickwidgets/quick_searchfield.rb +7 -4
  42. data/lib/operawatir/quickwidgets/quick_tab.rb +23 -12
  43. data/lib/operawatir/quickwidgets/quick_thumbnail.rb +4 -4
  44. data/lib/operawatir/quickwidgets/quick_toolbar.rb +1 -1
  45. data/lib/operawatir/quickwidgets/quick_treeitem.rb +45 -29
  46. data/lib/operawatir/quickwidgets/quick_treeview.rb +2 -2
  47. data/lib/operawatir/quickwidgets/quick_widget.rb +267 -77
  48. data/lib/operawatir/quickwidgets/quick_window.rb +64 -38
  49. data/lib/operawatir/screenshot.rb +1 -1
  50. data/lib/operawatir/utils.rb +31 -0
  51. data/lib/operawatir/window.rb +1 -1
  52. data/operawatir.gemspec +38 -132
  53. data/spec/operawatir/core/actions_spec.rb +202 -0
  54. data/spec/operawatir/core/browser_spec.rb +8 -8
  55. data/spec/operawatir/core/element_spec.rb +11 -2
  56. data/spec/operawatir/core/keys_spec.rb +50 -2
  57. data/spec/operawatir/core/preferences_spec.rb +44 -128
  58. data/spec/operawatir/core/spatnav_spec.rb +16 -16
  59. data/spec/operawatir/core/utils_spec.rb +47 -0
  60. data/spec/operawatir/core/window_spec.rb +1 -1
  61. data/spec/operawatir/desktop/desktopbrowser_spec.rb +191 -22
  62. data/spec/operawatir/desktop/quickbutton_spec.rb +197 -164
  63. data/spec/operawatir/desktop/quickcheckbox_spec.rb +12 -12
  64. data/spec/operawatir/desktop/quickdialogtab_spec.rb +11 -11
  65. data/spec/operawatir/desktop/quickdropdown_spec.rb +25 -25
  66. data/spec/operawatir/desktop/quickeditfield_spec.rb +31 -31
  67. data/spec/operawatir/desktop/quickmenu_spec.rb +57 -0
  68. data/spec/operawatir/desktop/quickmenuitem_spec.rb +168 -0
  69. data/spec/operawatir/desktop/quicktab_spec.rb +26 -15
  70. data/spec/operawatir/desktop/quickthumbnail_spec.rb +18 -4
  71. data/spec/operawatir/desktop/quicktreeitem_spec.rb +72 -72
  72. data/spec/operawatir/desktop/quicktreeview_spec.rb +13 -13
  73. data/spec/operawatir/desktop/quickwidget_spec.rb +51 -13
  74. data/spec/operawatir/desktop/quickwindow_spec.rb +4 -0
  75. data/spec/operawatir/desktop/shared/shared.rb +25 -9
  76. data/spec/operawatir/fixtures/draggableLists.html +67 -0
  77. data/spec/operawatir/fixtures/formSelectionPage.html +46 -0
  78. data/spec/operawatir/fixtures/js/jquery-1.4.4.min.js +167 -0
  79. data/spec/operawatir/fixtures/js/jquery-ui-1.8.10.custom.min.js +782 -0
  80. data/spec/operawatir/fixtures/keys.html +40 -0
  81. data/spec/operawatir/fixtures/label_submit.html +5 -0
  82. data/spec/operawatir/fixtures/mouse.html +59 -0
  83. data/spec/operawatir/fixtures/simple.html +10 -0
  84. data/spec/operawatir/matchers.rb +20 -19
  85. data/spec/operawatir/watirspec_desktophelper.rb +51 -3
  86. data/spec/operawatir/watirspec_helper.rb +0 -2
  87. metadata +91 -220
  88. data/lib/operadriver/client-combined-nodeps.jar +0 -0
  89. data/lib/operadriver/webdriver-opera.jar +0 -0
  90. data/spec/watir3/browser_spec.rb +0 -190
  91. data/spec/watir3/clipboard_spec.rb +0 -64
  92. data/spec/watir3/collection_spec.rb +0 -387
  93. data/spec/watir3/element_spec.rb +0 -474
  94. data/spec/watir3/guards.rb +0 -39
  95. data/spec/watir3/keys_spec.rb +0 -204
  96. data/spec/watir3/server.rb +0 -91
  97. data/spec/watir3/watirspec_helper.rb +0 -62
  98. data/spec/watir3/window_spec.rb +0 -295
@@ -24,14 +24,28 @@ describe 'QuickThumbnail' do
24
24
  it 'constructs thumbnail by its name' do
25
25
  browser.quick_thumbnail(:name, "Speed Dial 1").should exist
26
26
  end
27
- it 'constructs thumbnail by its text'
27
+ it 'constructs thumbnail by its text' do #it won't be language independant and will depend on existed Speed Dials
28
+ browser.quick_thumbnail(:text, "Opera Portal").should exist
29
+ end
28
30
  end
29
31
 
30
32
  describe '#move_with_drag' do
31
- it 'moves thumbnail'
33
+
34
+ it 'moves thumbnail' #do #DSK-335945 bloacks this section
35
+ # SD1 = browser.quick_window(:name, "Document Window").quick_thumbnail(:name, "Speed Dial 1").text
36
+ # SD2 = browser.quick_window(:name, "Document Window").quick_thumbnail(:name, "Speed Dial 2").text
37
+ # thumbnail_to_drop_on = browser.quick_window(:name, "Document Window").quick_thumbnail(:name, "Speed Dial 2")
38
+ # browser.browser.quick_window(:name, "Document Window").quick_thumbnail(:name, "Speed Dial 1").move_with_drag(thumbnail_to_drop_on)
39
+ # browser.quick_window(:name, "Document Window").quick_thumbnail(:name, "Speed Dial 1").text.should == SD2
40
+ # browser.quick_window(:name, "Document Window").quick_thumbnail(:name, "Speed Dial 2").text.should == SD1
41
+ #end
42
+
32
43
  context 'when target is not a thumbnail' do
33
- it 'raises UnknownObjectException'
44
+ it 'raises UnknownObjectException' do
45
+ expect { browser.quick_window(:name, "Document Window").quick_thumbnail(:name, "Speed Dial 1").move_with_drag(browser.quick_window(:name, "Browser Window")) }.to raise_error OperaWatir::DesktopExceptions::UnknownObjectException
46
+ end
34
47
  end
35
48
  end
36
49
 
37
- end
50
+ end
51
+
@@ -4,16 +4,16 @@ require File.expand_path('../shared/shared', __FILE__)
4
4
  describe 'QuickTreeItem' do
5
5
 
6
6
  describe 'a widget' do
7
- before(:all) do
8
- browser.open_window_with_key_press("Bookmarks Panel Window", "b", :ctrl, :shift)
9
- end
7
+ before(:all) do
8
+ browser.open_window_with_key_press("Bookmarks Panel Window", "b", :ctrl, :shift)
9
+ end
10
10
 
11
- after(:all) do
12
- browser.close_all_tabs
13
- end
11
+ after(:all) do
12
+ browser.close_all_tabs
13
+ end
14
14
 
15
- let(:widget) { browser.quick_window(:name, "Bookmarks Panel Window").quick_treeview(:name, "Bookmarks View").quick_treeitem(:pos, [0, 0]) }
16
- subject { widget }
15
+ let(:widget) { browser.quick_window(:name, "Bookmarks Panel Window").quick_treeview(:name, "Bookmarks View").quick_treeitem(:pos, [0, 0]) }
16
+ subject { widget }
17
17
 
18
18
  it_behaves_like 'a widget'
19
19
 
@@ -24,77 +24,77 @@ describe 'QuickTreeItem' do
24
24
 
25
25
  describe '#focus_with_click' do
26
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
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
40
  end
41
41
 
42
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
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 'expands treeitem 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
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
55
+ it 'collapses treeitem 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
64
 
65
- after(:all) do
66
- browser.close_all_dialogs
67
- end
65
+ after(:all) do
66
+ browser.close_all_dialogs
67
+ end
68
68
  end
69
69
 
70
70
  describe '#expand_with_double_click' do
71
-
71
+
72
72
  before(:each) do
73
73
  browser.open_window_with_key_press("Bookmarks Panel Window", "b", :ctrl, :shift).should > 0
74
74
  browser.quick_treeview(:name, "Bookmarks Folders View").focus_with_click
75
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
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
98
  end
99
99
  # alias_method :collapse_with_double_click, :expand_with_double_click
100
100
 
@@ -110,11 +110,11 @@ describe 'QuickTreeItem' do
110
110
  browser.quick_window(:name, "Document Window").quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").focus_with_click
111
111
  browser.quick_window(:name, "Document Window").quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").key_press("v", :ctrl)
112
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
113
+ end
114
+
115
+ after(:all) do
116
+ browser.close_all_tabs
117
+ end
118
118
  end
119
119
 
120
120
  describe '#selected?' do
@@ -3,26 +3,26 @@ require File.expand_path('../shared/shared', __FILE__)
3
3
 
4
4
  describe 'QuickTreeView' do
5
5
 
6
- before(:all) do
7
- browser.open_dialog_with_action("New Preferences Dialog", "Show preferences", 4).should > 0
8
- end
6
+ before(:all) do
7
+ browser.open_dialog_with_action("New Preferences Dialog", "Show preferences", 4).should > 0
8
+ end
9
9
 
10
- after(:all) do
11
- browser.close_all_dialogs
12
- end
10
+ after(:all) do
11
+ browser.close_all_dialogs
12
+ end
13
13
 
14
- let(:widget) { browser.quick_treeview(:name, "Advanced_treeview") }
15
- subject { widget }
14
+ let(:widget) { browser.quick_treeview(:name, "Advanced_treeview") }
15
+ subject { widget }
16
16
 
17
- it_behaves_like 'a widget'
17
+ it_behaves_like 'a widget'
18
18
 
19
- its(:type) { should == :treeview }
19
+ its(:type) { should == :treeview }
20
20
 
21
21
 
22
22
  describe '#num_treeitems' do
23
- it "returns numbers of treeitems in the treeview" do
24
- browser.quick_treeview(:name, "Advanced_treeview").num_treeitems.should > 0
25
- end
23
+ it "returns numbers of treeitems in the treeview" do
24
+ browser.quick_treeview(:name, "Advanced_treeview").num_treeitems.should > 0
25
+ end
26
26
 
27
27
  end
28
28
 
@@ -1,7 +1,7 @@
1
1
  require File.expand_path('../../watirspec_desktophelper', __FILE__)
2
2
 
3
3
  describe 'QuickWidget' do
4
-
4
+ let(:home) { browser.quick_window(:name, "Document Window").quick_toolbar(:name, "Document Toolbar").quick_button(:name, "tbb_Stop_Reload")}
5
5
  describe '#open_window_with_hover' do
6
6
  it 'opens window on hover' do
7
7
  browser.quick_window(:name, "Browser Window").quick_toolbar(:name, "Pagebar").quick_tab(:pos, 0).open_window_with_hover.should > 0
@@ -35,15 +35,15 @@ describe 'QuickWidget' do
35
35
  end
36
36
 
37
37
  it 'verifies simple string by string_id' do
38
- browser.quick_button(:name, "button_OK").verify_text("DI_ID_OK").should be_true
38
+ browser.quick_button(:name, "button_OK").verify_text("DI_ID_OK").should be_true
39
39
  end
40
40
 
41
41
  it 'verifies strings with string substitution'
42
42
 
43
43
  it 'verifies strings with ampersand' do
44
- puts "click on item in row #{@last_row}"
45
- puts browser.string("S_FIND_IN_PAGE")
46
- puts browser.quick_treeview(:name, "Web_search_treeview").quick_treeitem(:pos, [@last_row,0]).text
44
+ #puts "click on item in row #{@last_row}"
45
+ #puts browser.string("S_FIND_IN_PAGE")
46
+ #puts browser.quick_treeview(:name, "Web_search_treeview").quick_treeitem(:pos, [@last_row,0]).text
47
47
  browser.quick_treeview(:name, "Web_search_treeview").quick_treeitem(:pos, [@last_row,0]).verify_text("S_FIND_IN_PAGE").should be_true
48
48
  end
49
49
  end
@@ -51,21 +51,59 @@ describe 'QuickWidget' do
51
51
  #NOTE: This is deprecated
52
52
  describe '#verify_includes_text' do
53
53
  it 'verifies the include text id' do
54
- browser.open_dialog_with_action("New Preferences Dialog", "Show preferences").should > 0
55
- browser.quick_button(:name, "button_OK").verify_includes_text("DI_ID_OK").should be_true
56
- browser.close_dialog("New Preferences Dialog").should > 0
54
+ browser.open_dialog_with_action("New Preferences Dialog", "Show preferences").should > 0
55
+ browser.quick_button(:name, "button_OK").verify_includes_text("DI_ID_OK").should be_true
56
+ browser.close_dialog("New Preferences Dialog").should > 0
57
57
  end
58
58
  end
59
59
 
60
60
  describe '#focus_with_click' do
61
- #Not really testable until there's a way to check focus
61
+ #Not really testable until there's a way to check focus
62
62
  it 'should focus the addressfield' do
63
- browser.quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").focus_with_click
63
+ browser.quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").focus_with_click
64
+ end
65
+ end
66
+
67
+ describe '#focus_with_hover' do
68
+
69
+ it 'should hover widget' do
70
+ home.focus_with_hover
71
+ browser.quick_window(:name, "Browser Window").quick_toolbar(:name, "Status Toolbar Head").quick_label(:name, "tbb_Status").text.should_not be_empty
72
+ end
73
+ end
74
+
75
+ describe '#click_with_condition' do
76
+
77
+ it 'should fail without condition' do
78
+ browser.quick_toolbar(:name, "Document Toolbar").click_with_condition.should be_false
64
79
  end
65
- end
80
+
81
+ it 'should not throw exception for nonexisting widget' do
82
+ home.click_with_condition do
83
+ browser.quick_button(:name, "tbb_nonexisting").visible?
84
+ end.should be_false
85
+ end
86
+ it 'should fail if exception thrown' do
87
+ home.click_with_condition {
88
+ browser.quick_button(:name, "tbb_nonexisting").visible?
89
+ }.should be_false
90
+ end
91
+
92
+ it 'should return result of condition' do
93
+ home.click_with_condition { true }.should be_true
94
+ end
95
+
96
+ it 'should return result of condition' do
97
+ home.click_with_condition { false }.should be_false
98
+ end
99
+
100
+ end
66
101
 
67
- # Private
68
- # Also: Test in shared.rb not here
102
+ #Those are really the same as click..
103
+ #describe '#double_click_with_condition'
104
+ #describe '#right_click_with_condition'
105
+ # Private
106
+ # Also: Test in shared.rb not here
69
107
  #describe '#element' do
70
108
  #end
71
109
 
@@ -98,6 +98,10 @@ describe 'QuickWindow' do
98
98
  expect { nonexisting_window.window_info_string }.to raise_error OperaWatir::Exceptions::UnknownObjectException
99
99
  end
100
100
  end
101
+
102
+ describe '#quick_buttons' do
103
+ its(:quick_buttons) { should be_kind_of Array }
104
+ end
101
105
 
102
106
  its(:driver) { should be_instance_of Java::ComOperaCoreSystems::OperaDesktopDriver }
103
107
 
@@ -52,15 +52,15 @@ shared_examples_for 'an editfield' do
52
52
 
53
53
  =begin
54
54
  describe '#key_press' do
55
- it "presses keys with modifiers" do
56
- widget.type_text "some other text"
57
- widget.focus_with_click
58
- widget.key_press("a", :ctrl)
59
- widget.key_press("c", :ctrl)
60
- widget.clear
61
- widget.key_press("v", :ctrl)
62
- widget.text.should include "some other text"
63
- end
55
+ it "presses keys with modifiers" do
56
+ widget.type_text "some other text"
57
+ widget.focus_with_click
58
+ widget.key_press("a", :ctrl)
59
+ widget.key_press("c", :ctrl)
60
+ widget.clear
61
+ widget.key_press("v", :ctrl)
62
+ widget.text.should include "some other text"
63
+ end
64
64
  end
65
65
  =end
66
66
  end
@@ -127,6 +127,22 @@ shared_examples_for 'a widget' do
127
127
  end
128
128
  end
129
129
 
130
+ #there's one of these for each type
131
+ describe '#quick_buttons' do
132
+ it 'retrieves buttons' do
133
+ widget.quick_buttons.should be_kind_of Array
134
+ end
135
+ it 'retrieves only buttons' do
136
+ widget.quick_buttons.select { |w| w.type != :button }.should be_empty
137
+ end
138
+ end
139
+
140
+ describe '#quick_widgets' do
141
+ it 'retrieves only widgets in this widget' do
142
+ widget.quick_widgets.select { |w| w.parent_name != widget.name }.should be_empty
143
+ end
144
+ end
145
+
130
146
  #describe 'print_row' do
131
147
  #end
132
148
 
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <title>jQuery UI Sortable - Connect lists</title>
6
+ <!--link type="text/css" href="development-bundle/themes/base/jquery.ui.all.css" rel="stylesheet" /-->
7
+ <!--link type="text/css" href="development-bundle/demos/demos.css" rel="stylesheet" /-->
8
+ <link type="text/css" href="css/ui-lightness/jquery-ui-1.8.10.custom.css" rel="stylesheet" />
9
+ <script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
10
+ <script type="text/javascript" src="js/jquery-ui-1.8.10.custom.min.js"></script>
11
+ <style type="text/css">
12
+ #sortable1, #sortable2 { list-style-type: none; margin: 0; padding: 0; float: left; margin-right: 10px; }
13
+ #sortable1 li, #sortable2 li { margin: 0 5px 5px 5px; padding: 5px; font-size: 1.2em; width: 120px; }
14
+ </style>
15
+ <script type="text/javascript">
16
+ $(function() {
17
+ $("#sortable1, #sortable2").sortable({
18
+ connectWith: '.connectedSortable'
19
+ }).disableSelection();
20
+
21
+ var report_event = function(report_text) {
22
+ var reportElement = $("#dragging_reports");
23
+ var origText = reportElement.text();
24
+ reportElement.text(origText + " " + report_text);
25
+ }
26
+
27
+ $("#sortable2").droppable({
28
+ out: function(event, ui) {
29
+ report_event("DragOut");
30
+ }
31
+ });
32
+
33
+ $("#sortable1").droppable({
34
+ drop: function(event, ui) {
35
+ report_event("DropIn " + ui.draggable.text());
36
+ }
37
+ });
38
+ });
39
+ </script>
40
+ </head>
41
+ <body>
42
+ <div class="demo">
43
+ <ul id="sortable1" class="connectedSortable">
44
+ <li id="leftitem-1" class="ui-state-default">LeftItem 1</li>
45
+ <li id="leftitem-2" class="ui-state-default">LeftItem 2</li>
46
+ <li id="leftitem-3" class="ui-state-default">LeftItem 3</li>
47
+ <li id="leftitem-4" class="ui-state-default">LeftItem 4</li>
48
+ <li id="leftitem-5" class="ui-state-default">LeftItem 5</li>
49
+ </ul>
50
+
51
+ <ul id="sortable2" class="connectedSortable">
52
+ <li id="rightitem-1" class="ui-state-highlight">RightItem 1</li>
53
+ <li id="rightitem-2" class="ui-state-highlight">RightItem 2</li>
54
+ <li id="rightitem-3" class="ui-state-highlight">RightItem 3</li>
55
+ <li id="rightitem-4" class="ui-state-highlight">RightItem 4</li>
56
+ <li id="rightitem-5" class="ui-state-highlight">RightItem 5</li>
57
+ </ul>
58
+
59
+ </div>
60
+
61
+ <br/>
62
+ <div class="test-data">
63
+ <p id="dragging_reports">Nothing happened.</p>
64
+ </div>
65
+
66
+ </body>
67
+ </html>