operawatir 0.4-jruby → 0.4.1-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/.gitmodules +3 -3
- data/AUTHORS +1 -0
- data/CHANGES +454 -0
- data/README.md +67 -50
- data/Rakefile +6 -10
- data/VERSION +1 -1
- data/bin/desktopwatir +52 -29
- data/bin/operawatir +50 -18
- data/lib/operadriver/client-combined-nodeps.jar +0 -0
- data/lib/operadriver/webdriver-opera.jar +0 -0
- data/lib/operawatir.rb +8 -1
- data/lib/operawatir/browser.rb +35 -15
- data/lib/operawatir/collection.rb +2 -2
- data/lib/operawatir/compat.rb +3 -2
- data/lib/operawatir/compat/browser.rb +0 -5
- data/lib/operawatir/compat/collection.rb +15 -0
- data/lib/operawatir/compat/element.rb +72 -21
- data/lib/operawatir/compat/element_finders.rb +6 -0
- data/lib/operawatir/compat/selector.rb +7 -0
- data/lib/operawatir/compat/window.rb +49 -0
- data/lib/operawatir/desktop_browser.rb +88 -14
- data/lib/operawatir/desktop_common.rb +0 -2
- data/lib/operawatir/desktop_container.rb +82 -29
- data/lib/operawatir/desktop_helper.rb +2 -0
- data/lib/operawatir/element.rb +49 -25
- data/lib/operawatir/helper.rb +5 -3
- data/lib/operawatir/keys.rb +19 -6
- data/lib/operawatir/preferences.rb +315 -78
- data/lib/operawatir/quickwidgets.rb +2 -1
- data/lib/operawatir/quickwidgets/quick_addressfield.rb +12 -0
- data/lib/operawatir/quickwidgets/quick_button.rb +8 -2
- data/lib/operawatir/quickwidgets/quick_checkbox.rb +5 -5
- data/lib/operawatir/quickwidgets/quick_editfield.rb +8 -5
- data/lib/operawatir/quickwidgets/quick_find.rb +11 -0
- data/lib/operawatir/quickwidgets/quick_griditem.rb +11 -0
- data/lib/operawatir/quickwidgets/quick_gridlayout.rb +11 -0
- data/lib/operawatir/quickwidgets/quick_searchfield.rb +7 -1
- data/lib/operawatir/quickwidgets/quick_tab.rb +0 -1
- data/lib/operawatir/quickwidgets/quick_treeitem.rb +22 -1
- data/lib/operawatir/quickwidgets/quick_widget.rb +62 -23
- data/lib/operawatir/quickwidgets/quick_window.rb +32 -2
- data/lib/operawatir/screenshot.rb +46 -0
- data/lib/operawatir/version.rb +6 -4
- data/lib/operawatir/window.rb +53 -67
- data/operawatir.gemspec +310 -245
- data/spec/operawatir/README.md +4 -0
- data/spec/operawatir/core/browser_spec.rb +82 -0
- data/spec/operawatir/core/element_spec.rb +88 -0
- data/spec/operawatir/core/preferences_spec.rb +438 -0
- data/spec/operawatir/core/screenshot_spec.rb +76 -0
- data/spec/{new_watirspec → operawatir/core}/spatnav_spec.rb +3 -3
- data/spec/operawatir/core/window_spec.rb +76 -0
- data/spec/operawatir/desktop/desktopbrowser_spec.rb +316 -0
- data/spec/operawatir/desktop/quickaddressfield_spec.rb +59 -0
- data/spec/operawatir/desktop/quickbutton_spec.rb +248 -0
- data/spec/operawatir/desktop/quickcheckbox_spec.rb +36 -0
- data/spec/operawatir/desktop/quickdialogtab_spec.rb +30 -0
- data/spec/operawatir/desktop/quickdropdown_spec.rb +39 -0
- data/spec/operawatir/desktop/quickeditfield_spec.rb +51 -0
- data/spec/operawatir/desktop/quickfind_spec.rb +30 -0
- data/spec/operawatir/desktop/quickgriditem_spec.rb +16 -0
- data/spec/operawatir/desktop/quickgridlayout_spec.rb +15 -0
- data/spec/operawatir/desktop/quicklabel_spec.rb +28 -0
- data/spec/operawatir/desktop/quickradiobutton_spec.rb +24 -0
- data/spec/operawatir/desktop/quicksearchfield_spec.rb +26 -0
- data/spec/operawatir/desktop/quicktab_spec.rb +86 -0
- data/spec/operawatir/desktop/quickthumbnail_spec.rb +37 -0
- data/spec/operawatir/desktop/quicktreeitem_spec.rb +135 -0
- data/spec/operawatir/desktop/quicktreeview_spec.rb +30 -0
- data/spec/operawatir/desktop/quickwidget_spec.rb +101 -0
- data/spec/operawatir/desktop/quickwindow_spec.rb +108 -0
- data/spec/operawatir/desktop/shared/shared.rb +138 -0
- data/spec/operawatir/fixtures/boxes.html +22 -0
- data/spec/operawatir/fixtures/browsers.svg +367 -0
- data/spec/operawatir/fixtures/frames.html +13 -0
- data/spec/operawatir/fixtures/grid.html +29 -0
- data/spec/operawatir/fixtures/input_fields_value.html +6 -0
- data/spec/operawatir/fixtures/onclick.html +20 -0
- data/spec/operawatir/fixtures/paragraphs.html +15 -0
- data/spec/operawatir/fixtures/two_input_fields.html +6 -0
- data/spec/{new_watirspec → operawatir}/guards.rb +0 -0
- data/spec/operawatir/matchers.rb +68 -0
- data/spec/{legacy_watirspec → operawatir}/server.rb +0 -0
- data/spec/operawatir/watirspec.rake +43 -0
- data/spec/operawatir/watirspec_desktophelper.rb +14 -0
- data/spec/operawatir/watirspec_helper.rb +62 -0
- data/spec/{legacy_watirspec → watir2}/area_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/areas_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/browser_spec.rb +2 -0
- data/spec/{legacy_watirspec → watir2}/button_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/buttons_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/checkbox_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/checkboxes_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/collections_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/dd_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/dds_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/del_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/dels_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/div_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/divs_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/dl_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/dls_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/dt_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/dts_spec.rb +0 -0
- data/spec/watir2/element_spec.rb +155 -0
- data/spec/{legacy_watirspec → watir2}/em_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/ems_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/filefield_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/filefields_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/2000_spans.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/bug_duplicate_attributes.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/bug_javascript_001.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/buttons_with_duplicate_ids.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/collections.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/definition_lists.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/euc-jp_text.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/forms_with_input_elements.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/frame_1.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/frame_2.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/frames.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/iframes.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/images.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/images/1.gif +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/images/2.gif +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/images/3.gif +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/images/button.jpg +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/images/circle.jpg +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/images/map.gif +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/images/map2.gif +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/images/minus.gif +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/images/originaltriangle.jpg +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/images/plus.gif +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/images/square.jpg +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/images/triangle.jpg +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/iso-2022-jp_text.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/javascript/helpers.js +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/jquery.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/latin1_text.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/multiple_ids.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/non_control_elements.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/parser_bug_001.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/prevent_form_submit.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/right_click.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/shift_jis_text.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/tables.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/timeout.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/timeout_window_location.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/tiny_mce.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/utf8_text.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/watirspec.css +0 -0
- data/spec/{legacy_watirspec → watir2}/form_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/forms_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/frame_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/frames_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/guards.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/hidden_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/hiddens_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/hn_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/hns_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/image_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/images_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/ins_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/inses_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/label_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/labels_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/li_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/link_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/links_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/lis_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/map_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/maps_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/meta_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/metas_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/ol_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/ols_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/option_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/p_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/pre_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/pres_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/ps_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/radio_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/radios_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/select_list_spec.rb +84 -71
- data/spec/{legacy_watirspec → watir2}/select_lists_spec.rb +0 -0
- data/spec/{new_watirspec → watir2}/server.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/span_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/spans_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/spec_helper.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/strong_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/strongs_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/table_bodies_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/table_body_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/table_cell_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/table_cells_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/table_footer_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/table_footers_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/table_header_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/table_headers_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/table_row_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/table_rows_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/table_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/tables_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/text_field_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/text_fields_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/ul_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/uls_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/watir_compatibility_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/watirspec_helper.rb +0 -0
- data/spec/{new_watirspec → watir3}/browser_spec.rb +11 -21
- data/spec/{new_watirspec → watir3}/clipboard_spec.rb +2 -2
- data/spec/{new_watirspec → watir3}/collection_spec.rb +0 -0
- data/spec/{new_watirspec → watir3}/element_spec.rb +30 -12
- data/spec/watir3/guards.rb +39 -0
- data/spec/{new_watirspec → watir3}/keys_spec.rb +0 -0
- data/spec/watir3/server.rb +91 -0
- data/spec/{new_watirspec → watir3}/watirspec_helper.rb +0 -0
- data/spec/{new_watirspec → watir3}/window_spec.rb +8 -83
- metadata +315 -280
- data/lib/operadriver/selenium-common.jar +0 -0
- data/spec/legacy_watirspec/element_spec.rb +0 -86
- data/spec/new_watirspec/preferences_spec.rb +0 -144
- data/spec/new_watirspec/screenshot_spec.rb +0 -34
@@ -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
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require File.expand_path('../../watirspec_desktophelper', __FILE__)
|
2
|
+
require File.expand_path('../shared/shared', __FILE__)
|
3
|
+
|
4
|
+
describe 'QuickTreeView' do
|
5
|
+
|
6
|
+
before(:all) do
|
7
|
+
browser.open_dialog_with_action("New Preferences Dialog", "Show preferences", 4).should > 0
|
8
|
+
end
|
9
|
+
|
10
|
+
after(:all) do
|
11
|
+
browser.close_all_dialogs
|
12
|
+
end
|
13
|
+
|
14
|
+
let(:widget) { browser.quick_treeview(:name, "Advanced_treeview") }
|
15
|
+
subject { widget }
|
16
|
+
|
17
|
+
it_behaves_like 'a widget'
|
18
|
+
|
19
|
+
its(:type) { should == :treeview }
|
20
|
+
|
21
|
+
|
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
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
end
|
@@ -0,0 +1,101 @@
|
|
1
|
+
require File.expand_path('../../watirspec_desktophelper', __FILE__)
|
2
|
+
|
3
|
+
describe 'QuickWidget' do
|
4
|
+
|
5
|
+
describe '#open_window_with_hover' do
|
6
|
+
it 'opens window on hover' do
|
7
|
+
browser.quick_window(:name, "Browser Window").quick_toolbar(:name, "Pagebar").quick_tab(:pos, 0).open_window_with_hover.should > 0
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
|
12
|
+
describe '#exists' do
|
13
|
+
context 'when widget exists' do
|
14
|
+
it 'returns true' do
|
15
|
+
browser.browser.quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").should exist
|
16
|
+
end
|
17
|
+
end
|
18
|
+
context 'when widget doesn\'t exist' do
|
19
|
+
it 'returns false' do
|
20
|
+
browser.browser.quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field2").should_not exist
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
describe '#verify_text' do
|
26
|
+
before(:all) do
|
27
|
+
browser.open_dialog_with_action("New Preferences Dialog", "Show preferences", 2).should open_dialog
|
28
|
+
browser.quick_treeview(:name, "Web_search_treeview").should be_visible
|
29
|
+
@last_row = browser.quick_treeview(:name, "Web_search_treeview").num_treeitems - 1
|
30
|
+
browser.quick_treeview(:name, "Web_search_treeview").quick_treeitem(:pos, [@last_row,0]).focus_with_click
|
31
|
+
end
|
32
|
+
|
33
|
+
after(:all) do
|
34
|
+
browser.close_dialog("New Preferences Dialog").should close_dialog
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'verifies simple string by string_id' do
|
38
|
+
browser.quick_button(:name, "button_OK").verify_text("DI_ID_OK").should be_true
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'verifies strings with string substitution'
|
42
|
+
|
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
|
47
|
+
browser.quick_treeview(:name, "Web_search_treeview").quick_treeitem(:pos, [@last_row,0]).verify_text("S_FIND_IN_PAGE").should be_true
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
#NOTE: This is deprecated
|
52
|
+
describe '#verify_includes_text' do
|
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
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
describe '#focus_with_click' do
|
61
|
+
#Not really testable until there's a way to check focus
|
62
|
+
it 'should focus the addressfield' do
|
63
|
+
browser.quick_toolbar(:name, "Document Toolbar").quick_addressfield(:name, "tba_address_field").focus_with_click
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
# Private
|
68
|
+
# Also: Test in shared.rb not here
|
69
|
+
#describe '#element' do
|
70
|
+
#end
|
71
|
+
|
72
|
+
#describe '#drag_and_drop_on' do
|
73
|
+
#end
|
74
|
+
|
75
|
+
#describe '#parent_widget' do
|
76
|
+
#end
|
77
|
+
|
78
|
+
#describe '#row' do
|
79
|
+
#end
|
80
|
+
|
81
|
+
#describe '#col' do
|
82
|
+
#end
|
83
|
+
|
84
|
+
#def window_id
|
85
|
+
#end
|
86
|
+
|
87
|
+
#describe '#click' do
|
88
|
+
#end
|
89
|
+
|
90
|
+
#describe '#right_click' do
|
91
|
+
#end
|
92
|
+
|
93
|
+
#describe '#double_click' do
|
94
|
+
#end
|
95
|
+
|
96
|
+
#describe '#set_selector' do
|
97
|
+
#end
|
98
|
+
|
99
|
+
#describe '#find' do
|
100
|
+
#end
|
101
|
+
end
|