watir-classic 3.0.0 → 3.1.0
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/.gitignore +7 -0
- data/.gitmodules +3 -0
- data/.rspec +1 -0
- data/.yardopts +5 -0
- data/CHANGES +20 -10
- data/CONTRIBUTORS.txt +55 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +78 -0
- data/README.rdoc +8 -14
- data/Rakefile +32 -0
- data/VERSION +1 -1
- data/lib/watir-classic.rb +0 -1
- data/lib/watir-classic/IEDialog/IEDialog.cpp +225 -0
- data/lib/watir-classic/IEDialog/IEDialog.h +15 -0
- data/lib/watir-classic/IEDialog/IEDialog.vcproj +159 -0
- data/lib/watir-classic/IEDialog/ReadMe.txt +40 -0
- data/lib/watir-classic/IEDialog/stdafx.cpp +8 -0
- data/lib/watir-classic/IEDialog/stdafx.h +21 -0
- data/lib/watir-classic/browser.rb +1 -1
- data/lib/watir-classic/container.rb +4 -33
- data/lib/watir-classic/core.rb +1 -3
- data/lib/watir-classic/dialogs/alert.rb +46 -0
- data/lib/watir-classic/dialogs/file_field.rb +1 -0
- data/lib/watir-classic/drag_and_drop_helper.rb +18 -6
- data/lib/watir-classic/element.rb +0 -2
- data/lib/watir-classic/ext/json2.js +487 -0
- data/lib/watir-classic/ie-class.rb +10 -164
- data/lib/watir-classic/ie.rb +2 -0
- data/lib/watir-classic/input_elements.rb +1 -1
- data/lib/watir-classic/modal_dialog.rb +1 -7
- data/lib/watir-classic/module.rb +1 -10
- data/lib/watir-classic/non_control_elements.rb +11 -0
- data/lib/watir-classic/page-container.rb +22 -24
- data/lib/watir-classic/screenshot.rb +33 -0
- data/lib/watir-classic/win32ole/1.8.7/win32ole.patch +56 -0
- data/lib/watir-classic/win32ole/1.9.3/win32ole.patch +63 -0
- data/lib/watir-classic/win32ole/build_notes.txt +18 -0
- data/lib/watir-classic/win32ole/history.txt +88 -0
- data/spec/browser_spec.rb +34 -0
- data/spec/implementation.rb +18 -0
- data/watir-classic.gemspec +40 -0
- data/watir.gif +0 -0
- metadata +159 -192
- data/bin/watir-console +0 -5
- data/lib/watir-classic/assertions.rb +0 -44
- data/lib/watir-classic/dialogs/javascript.rb +0 -43
- data/lib/watir-classic/irb-history.rb +0 -31
- data/lib/watir-classic/logger.rb +0 -19
- data/lib/watir-classic/screen_capture.rb +0 -115
- data/lib/watir-classic/testcase.rb +0 -97
- data/lib/watir-classic/waiter.rb +0 -98
- data/rakefile.rb +0 -54
- data/unittests/all_tests.rb +0 -10
- data/unittests/buttons_xpath_test.rb +0 -68
- data/unittests/checkbox_test.rb +0 -163
- data/unittests/checkbox_xpath_test.rb +0 -106
- data/unittests/click_no_wait_test.rb +0 -23
- data/unittests/close_all_test.rb +0 -17
- data/unittests/core_tests.rb +0 -17
- data/unittests/css_selector_test.rb +0 -44
- data/unittests/css_test.rb +0 -38
- data/unittests/dialog_test.rb +0 -64
- data/unittests/div2_xpath_test.rb +0 -21
- data/unittests/div_test.rb +0 -170
- data/unittests/div_xpath_test.rb +0 -95
- data/unittests/document_standards.rb +0 -63
- data/unittests/element_collection_indexes_test.rb +0 -57
- data/unittests/element_collections_test.rb +0 -100
- data/unittests/element_test.rb +0 -47
- data/unittests/errorchecker_test.rb +0 -31
- data/unittests/filefield_test.rb +0 -43
- data/unittests/filefield_xpath_test.rb +0 -35
- data/unittests/form_test.rb +0 -282
- data/unittests/form_xpath_test.rb +0 -254
- data/unittests/frame_test.rb +0 -165
- data/unittests/google_form_test.rb +0 -15
- data/unittests/html/JavascriptClick.html +0 -39
- data/unittests/html/blankpage.html +0 -11
- data/unittests/html/buttons1.html +0 -40
- data/unittests/html/checkboxes1.html +0 -89
- data/unittests/html/click_no_wait.html +0 -14
- data/unittests/html/complex_table.html +0 -35
- data/unittests/html/cssTest.html +0 -42
- data/unittests/html/depot_store.html +0 -59
- data/unittests/html/div.html +0 -92
- data/unittests/html/div_xml.html +0 -21
- data/unittests/html/fileupload.html +0 -44
- data/unittests/html/formTest1.html +0 -38
- data/unittests/html/forms2.html +0 -44
- data/unittests/html/forms3.html +0 -131
- data/unittests/html/forms4.html +0 -26
- data/unittests/html/frame_buttons.html +0 -4
- data/unittests/html/frame_links.html +0 -4
- data/unittests/html/frame_multi.html +0 -5
- data/unittests/html/google_india.html +0 -119
- data/unittests/html/ie7_document_standards.html +0 -9
- data/unittests/html/ie8_document_standards.html +0 -9
- data/unittests/html/ie9_document_standards.html +0 -9
- data/unittests/html/iframe.html +0 -3
- data/unittests/html/iframeTest.html +0 -17
- data/unittests/html/iframeTest1.html +0 -7
- data/unittests/html/iframeTest2.html +0 -5
- data/unittests/html/images/1.gif +0 -0
- data/unittests/html/images/2.GIF +0 -0
- data/unittests/html/images/3.GIF +0 -0
- data/unittests/html/images/button.jpg +0 -0
- data/unittests/html/images/circle.jpg +0 -0
- data/unittests/html/images/map.GIF +0 -0
- data/unittests/html/images/map2.gif +0 -0
- data/unittests/html/images/minus.GIF +0 -0
- data/unittests/html/images/originaltriangle.jpg +0 -0
- data/unittests/html/images/plus.gif +0 -0
- data/unittests/html/images/square.jpg +0 -0
- data/unittests/html/images/triangle.jpg +0 -0
- data/unittests/html/images1.html +0 -65
- data/unittests/html/javascriptevents.html +0 -33
- data/unittests/html/link_pass.html +0 -11
- data/unittests/html/links1.html +0 -37
- data/unittests/html/links2.html +0 -11
- data/unittests/html/links_multi.html +0 -12
- data/unittests/html/list_matters.html +0 -720
- data/unittests/html/lists.html +0 -18
- data/unittests/html/map_test.html +0 -30
- data/unittests/html/modal_dialog.html +0 -10
- data/unittests/html/modal_dialog_launcher.html +0 -12
- data/unittests/html/multiple_specifiers.html +0 -64
- data/unittests/html/nestedFrames.html +0 -6
- data/unittests/html/new_browser.html +0 -17
- data/unittests/html/pass.html +0 -13
- data/unittests/html/popups1.html +0 -59
- data/unittests/html/pre.html +0 -29
- data/unittests/html/quirks_document_standards.html +0 -8
- data/unittests/html/radioButtons1.html +0 -71
- data/unittests/html/select_tealeaf.html +0 -54
- data/unittests/html/selectboxes1.html +0 -52
- data/unittests/html/simple_table.html +0 -25
- data/unittests/html/simple_table_buttons.html +0 -104
- data/unittests/html/simple_table_columns.html +0 -75
- data/unittests/html/table1.html +0 -179
- data/unittests/html/tableCell_using_xpath.html +0 -19
- data/unittests/html/table_and_tablerow_to_a.html +0 -174
- data/unittests/html/textarea.html +0 -30
- data/unittests/html/textfields1.html +0 -100
- data/unittests/html/textsearch.html +0 -44
- data/unittests/html/wallofcheckboxes.html +0 -1003
- data/unittests/html/xpath_nbsp.html +0 -11
- data/unittests/html/zeroindex.html +0 -11
- data/unittests/ie_exists_test.rb +0 -16
- data/unittests/ie_mock.rb +0 -94
- data/unittests/ie_test.rb +0 -54
- data/unittests/images_test.rb +0 -156
- data/unittests/images_xpath_test.rb +0 -90
- data/unittests/index_specifier_test.rb +0 -31
- data/unittests/js_events_test.rb +0 -31
- data/unittests/links_multi_test.rb +0 -34
- data/unittests/links_test.rb +0 -131
- data/unittests/links_xpath_test.rb +0 -38
- data/unittests/lists_test.rb +0 -23
- data/unittests/map_test.rb +0 -98
- data/unittests/minmax_test.rb +0 -37
- data/unittests/navigate_test.rb +0 -38
- data/unittests/nbsp_xpath_test.rb +0 -16
- data/unittests/no_wait_test.rb +0 -28
- data/unittests/non_core_tests.rb +0 -12
- data/unittests/other/all_tests_concurrent.rb +0 -57
- data/unittests/other/navigate_exception_test.rb +0 -24
- data/unittests/other/rexml_unit_test.rb +0 -27
- data/unittests/other/screen_capture_test.rb +0 -53
- data/unittests/other/testcase_method_order_test.rb +0 -36
- data/unittests/other/testcase_verify_test.rb +0 -25
- data/unittests/other/wait_until_test.rb +0 -102
- data/unittests/pagecontainstext_test.rb +0 -69
- data/unittests/parent_child_test.rb +0 -27
- data/unittests/perf_test.rb +0 -20
- data/unittests/pre_test.rb +0 -49
- data/unittests/radios_test.rb +0 -181
- data/unittests/radios_xpath_test.rb +0 -100
- data/unittests/security_setting_test.rb +0 -24
- data/unittests/selectbox_test.rb +0 -144
- data/unittests/selectbox_xpath_test.rb +0 -102
- data/unittests/setup.rb +0 -69
- data/unittests/speed_settings_test.rb +0 -67
- data/unittests/table_cell_using_xpath_test.rb +0 -34
- data/unittests/table_test.rb +0 -296
- data/unittests/table_xpath_test.rb +0 -109
- data/unittests/test_tests.rb +0 -9
- data/unittests/textarea_test.rb +0 -92
- data/unittests/textarea_xpath_test.rb +0 -77
- data/unittests/textfield_for_ch_char_test.rb +0 -32
- data/unittests/textfields_test.rb +0 -184
- data/unittests/textfields_xpath_test.rb +0 -110
- data/unittests/version_test.rb +0 -15
- data/unittests/win32ole_so_test.rb +0 -35
- data/unittests/window_tests.rb +0 -10
- data/unittests/windows/attach_to_existing_window_test.rb +0 -52
- data/unittests/windows/attach_to_new_window_test.rb +0 -74
- data/unittests/windows/close_window_test.rb +0 -20
- data/unittests/windows/frame_links_test.rb +0 -23
- data/unittests/windows/ie-each_test.rb +0 -46
- data/unittests/windows/modal_dialog_test.rb +0 -95
- data/unittests/windows/new_process_test.rb +0 -24
- data/unittests/windows/new_test.rb +0 -58
- data/unittests/windows/open_close_test.rb +0 -19
- data/unittests/windows/send_keys_test.rb +0 -26
- data/unittests/xpath_tests.rb +0 -11
- data/watir-rdoc.rb +0 -7
data/.gitignore
ADDED
data/.gitmodules
ADDED
data/.rspec
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
--color
|
data/.yardopts
ADDED
data/CHANGES
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
|
-
== 3.
|
|
1
|
+
== 3.1.0 - 2012/08/20
|
|
2
|
+
|
|
3
|
+
* Add Browser#name, which returns :ie.
|
|
4
|
+
* Add Dl#to_hash.
|
|
5
|
+
* Add support for Alert API (https://github.com/watir/watirspec/blob/master/alert_spec.rb).
|
|
6
|
+
* Add support for Browser#screenshot API (https://github.com/watir/watirspec/blob/master/screenshot_spec.rb).
|
|
7
|
+
* Browser#execute_script returns now correct Ruby objects instead of String.
|
|
8
|
+
* Browser#new accepts ignored parameter to make API more compatible with Watir-WebDriver.
|
|
9
|
+
* Element#drag_and_drop methods work also with elements not in the viewport.
|
|
10
|
+
* Fix TextField#set slow text entry.
|
|
11
|
+
* Remove all show_* methods. Use element collection methods with #each instead. For example browser.links.each {|link| puts link.href}.
|
|
12
|
+
* Remove already deprecated Watir::Waiter. Use Watir::Wait instead.
|
|
13
|
+
* Remove already deprecated WinClicker.
|
|
14
|
+
* Remove Browser#(javascript_)dialog. Use Browser#alert API instead.
|
|
15
|
+
* Remove ScreenCapture module. Use Browser#screenshot API instead.
|
|
16
|
+
* Remove Watir console. Use regular IRB or debugger instead.
|
|
17
|
+
* Remove Watir.log method, WatirLogger and DefaultLogger classes. Use standard Ruby Logger instead.
|
|
18
|
+
* Remove Watir.until_with_timeout. Use Watir::Wait.until instead.
|
|
19
|
+
|
|
20
|
+
== 3.0.0 - 2012/04/23
|
|
2
21
|
|
|
3
22
|
* Browser#status returns an empty string if status bar is disabled in IE9
|
|
4
23
|
* Browser#style fixed for IE9
|
|
@@ -6,9 +25,6 @@
|
|
|
6
25
|
* #execute_script returns nil instead of 'undefined'
|
|
7
26
|
* drag and drop fixed for IE9
|
|
8
27
|
* Window#current? and Window#== are more robust
|
|
9
|
-
|
|
10
|
-
== 3.0.0.rc3 - 2012/03/18
|
|
11
|
-
|
|
12
28
|
* all html elements are now supported (even html5 ones)
|
|
13
29
|
* CookieManager removed
|
|
14
30
|
* cookies API support added (https://github.com/watir/watirspec/blob/master/cookies_spec.rb)
|
|
@@ -25,17 +41,11 @@
|
|
|
25
41
|
* Table#row(s) and Table#cell(s) added which ignore inner tables - use #td/#tr for all.
|
|
26
42
|
* raise an Exception if more locators are specified with :xpath/:css
|
|
27
43
|
* searching by :xpath and :css code rewritten
|
|
28
|
-
|
|
29
|
-
== 3.0.0.rc2 - 2012/02/04
|
|
30
|
-
|
|
31
44
|
* Browser#textarea(s) method for searching <textarea> elements
|
|
32
45
|
* Element#focus works with IE9
|
|
33
46
|
* Element#focused? returns the state of focus on that element
|
|
34
47
|
* Element#to_subtype returns Element if non-supported tag found instead of crashing
|
|
35
48
|
* searching by :class will match now partially like other tools behave (e.g. jQuery)
|
|
36
|
-
|
|
37
|
-
== 3.0.0.rc1 - 2012/01/13 - more conformance with WatirSpec
|
|
38
|
-
|
|
39
49
|
* Button#text returns value if exists instead of text
|
|
40
50
|
* Browser#goto prepends url automatically with http:// if scheme is missing
|
|
41
51
|
* Browser#element(s)_by_(xpath/css) are now private methods - use #element(:css => ...) and #element(:xpath => ...) instead
|
data/CONTRIBUTORS.txt
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
This is an old, out of date list of our contributors, from an old README file.
|
|
2
|
+
Watir exists because of the help and assistance of many different people over the ages.
|
|
3
|
+
More recent contributors are acknowledged in the CHANGES file.
|
|
4
|
+
|
|
5
|
+
Contributors:
|
|
6
|
+
Bret Pettichord
|
|
7
|
+
Paul Rogers
|
|
8
|
+
Jonathan Kohl
|
|
9
|
+
Chris Morris
|
|
10
|
+
Karlin Fox
|
|
11
|
+
Lorenzo Jorquera
|
|
12
|
+
Atilla Ozgur
|
|
13
|
+
Justin McCarthy
|
|
14
|
+
Chris McMahon
|
|
15
|
+
Elisabeth Hendrickson
|
|
16
|
+
Michael Kelly
|
|
17
|
+
Peter Chau
|
|
18
|
+
Danny Faught
|
|
19
|
+
Andy Sipe
|
|
20
|
+
John Lloyd-Jones
|
|
21
|
+
Chris Hedges
|
|
22
|
+
Park Heesob
|
|
23
|
+
Shashank Date
|
|
24
|
+
Jared Luxenberg
|
|
25
|
+
Alexey Verkhovsky
|
|
26
|
+
Tuyet Cong-Ton-Nu
|
|
27
|
+
Jeff Wood
|
|
28
|
+
Angrez Singh
|
|
29
|
+
Abhishek Goliya
|
|
30
|
+
Yaxin Wang
|
|
31
|
+
Michael Bolton
|
|
32
|
+
Paul Carvalho
|
|
33
|
+
Konstantin Sobolev
|
|
34
|
+
David Schmidt
|
|
35
|
+
Dara Lillis
|
|
36
|
+
Charley Baker
|
|
37
|
+
Prema Arya
|
|
38
|
+
Xavier Noria
|
|
39
|
+
Jeff Fry
|
|
40
|
+
Zeljko Filipin
|
|
41
|
+
Paul Taylor - Bug fix 194
|
|
42
|
+
Vincent Xu - Chinese input support
|
|
43
|
+
Tomislav Car - Filefield fix (210)
|
|
44
|
+
Michael Hwee & Aidy Lewis - Multiple attribute support for FireWatir (233)
|
|
45
|
+
Alan Baird - Fix for visible? method (253)
|
|
46
|
+
Jari Bakken - Regexp support for includes? and selected? methods for select lists (261)
|
|
47
|
+
|
|
48
|
+
Acknowledgements:
|
|
49
|
+
Chris Morris
|
|
50
|
+
Brian Marick
|
|
51
|
+
Jonathan Kohl
|
|
52
|
+
Penny Tonita
|
|
53
|
+
Janet Gregory
|
|
54
|
+
Andy Tinkham
|
|
55
|
+
Jacinda Scott (logo creator)
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
watir-classic (3.0.0)
|
|
5
|
+
ffi (~> 1.0)
|
|
6
|
+
nokogiri
|
|
7
|
+
rautomation (~> 0.7.2)
|
|
8
|
+
user-choices
|
|
9
|
+
win32-process (>= 0.5.5)
|
|
10
|
+
win32screenshot
|
|
11
|
+
windows-pr (>= 0.6.6)
|
|
12
|
+
yajl-ruby
|
|
13
|
+
|
|
14
|
+
GEM
|
|
15
|
+
remote: http://rubygems.org/
|
|
16
|
+
specs:
|
|
17
|
+
builder (3.0.0)
|
|
18
|
+
childprocess (0.3.4)
|
|
19
|
+
ffi (~> 1.0, >= 1.0.6)
|
|
20
|
+
diff-lcs (1.1.3)
|
|
21
|
+
ffi (1.1.3-x86-mingw32)
|
|
22
|
+
hoe (3.0.6)
|
|
23
|
+
rake (~> 0.8)
|
|
24
|
+
mini_magick (3.2.1)
|
|
25
|
+
subexec (~> 0.0.4)
|
|
26
|
+
nokogiri (1.5.5-x86-mingw32)
|
|
27
|
+
rack (1.4.1)
|
|
28
|
+
rack-protection (1.2.0)
|
|
29
|
+
rack
|
|
30
|
+
rake (0.9.2.2)
|
|
31
|
+
rautomation (0.7.2)
|
|
32
|
+
rspec (2.11.0)
|
|
33
|
+
rspec-core (~> 2.11.0)
|
|
34
|
+
rspec-expectations (~> 2.11.0)
|
|
35
|
+
rspec-mocks (~> 2.11.0)
|
|
36
|
+
rspec-core (2.11.1)
|
|
37
|
+
rspec-expectations (2.11.2)
|
|
38
|
+
diff-lcs (~> 1.1.3)
|
|
39
|
+
rspec-mocks (2.11.1)
|
|
40
|
+
s4t-utils (1.0.4)
|
|
41
|
+
hoe (>= 1.3.0)
|
|
42
|
+
sinatra (1.3.2)
|
|
43
|
+
rack (~> 1.3, >= 1.3.6)
|
|
44
|
+
rack-protection (~> 1.2)
|
|
45
|
+
tilt (~> 1.3, >= 1.3.3)
|
|
46
|
+
subexec (0.0.4)
|
|
47
|
+
syntax (1.0.0)
|
|
48
|
+
tilt (1.3.3)
|
|
49
|
+
user-choices (1.1.6.1)
|
|
50
|
+
builder (>= 2.1.2)
|
|
51
|
+
s4t-utils (>= 1.0.3)
|
|
52
|
+
xml-simple (>= 1.0.11)
|
|
53
|
+
win32-api (1.4.8-x86-mingw32)
|
|
54
|
+
win32-process (0.6.6)
|
|
55
|
+
windows-pr (>= 1.2.2)
|
|
56
|
+
win32screenshot (1.0.7)
|
|
57
|
+
ffi (~> 1.0)
|
|
58
|
+
mini_magick (~> 3.2.1)
|
|
59
|
+
rautomation (~> 0.7.0)
|
|
60
|
+
windows-api (0.4.2)
|
|
61
|
+
win32-api (>= 1.4.5)
|
|
62
|
+
windows-pr (1.2.2)
|
|
63
|
+
win32-api (>= 1.4.5)
|
|
64
|
+
windows-api (>= 0.3.0)
|
|
65
|
+
xml-simple (1.1.1)
|
|
66
|
+
yajl-ruby (1.1.0-x86-mingw32)
|
|
67
|
+
yard (0.8.2.1)
|
|
68
|
+
|
|
69
|
+
PLATFORMS
|
|
70
|
+
x86-mingw32
|
|
71
|
+
|
|
72
|
+
DEPENDENCIES
|
|
73
|
+
childprocess
|
|
74
|
+
rspec (~> 2.3)
|
|
75
|
+
sinatra
|
|
76
|
+
syntax
|
|
77
|
+
watir-classic!
|
|
78
|
+
yard
|
data/README.rdoc
CHANGED
|
@@ -1,28 +1,22 @@
|
|
|
1
1
|
= Watir Classic
|
|
2
2
|
|
|
3
|
-
Watir, pronounced water, is an open-source (BSD) family of Ruby libraries for automating web browsers.
|
|
3
|
+
Watir, pronounced water, is an open-source (BSD) family of Ruby libraries for automating web browsers.
|
|
4
|
+
It supports your app no matter what technology it is developed in.
|
|
5
|
+
They support Internet Explorer on Windows, Firefox and Chrome on Windows, Mac and Linux and Safari on Mac.
|
|
4
6
|
|
|
5
7
|
Project Home:: http://watir.com
|
|
6
|
-
Source Code:: http://github.com/
|
|
8
|
+
Source Code:: http://github.com/watir/watir-classic
|
|
7
9
|
Support:: http://watir.com/support
|
|
8
|
-
Gem:: https://rubygems.org/gems/watir
|
|
9
|
-
Gem:: https://rubygems.org/gems/firewatir
|
|
10
|
-
Gem:: https://rubygems.org/gems/commonwatir
|
|
11
|
-
Gem:: https://rubygems.org/gems/safariwatir
|
|
12
|
-
Gem:: https://rubygems.org/gems/watir-webdriver
|
|
13
|
-
Gem:: https://rubygems.org/gems/celerity
|
|
10
|
+
Gem:: https://rubygems.org/gems/watir-classic
|
|
14
11
|
|
|
15
12
|
== Install
|
|
16
13
|
|
|
17
|
-
You have to install Ruby and RubyGems first.
|
|
18
|
-
|
|
19
|
-
=== Windows
|
|
20
|
-
|
|
21
|
-
To install Internet Explorer and Firefox driver:
|
|
22
|
-
|
|
14
|
+
You have to install Ruby and RubyGems first.
|
|
23
15
|
gem update --system
|
|
24
16
|
gem install watir-classic
|
|
25
17
|
|
|
18
|
+
Detailed installation instructions are at http://watir.com/installation
|
|
19
|
+
|
|
26
20
|
== Examples
|
|
27
21
|
|
|
28
22
|
Some examples from http://watir.com/examples
|
data/Rakefile
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
require 'rubygems'
|
|
2
|
+
require 'bundler'
|
|
3
|
+
|
|
4
|
+
Bundler::GemHelper.install_tasks
|
|
5
|
+
|
|
6
|
+
task :default => :spec
|
|
7
|
+
|
|
8
|
+
require 'rspec/core/rake_task'
|
|
9
|
+
RSpec::Core::RakeTask.new(:spec)
|
|
10
|
+
|
|
11
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
|
12
|
+
spec.rcov = true
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
require 'yard'
|
|
16
|
+
YARD::Rake::YardocTask.new
|
|
17
|
+
|
|
18
|
+
#
|
|
19
|
+
# ------------------------------ watirspec -----------------------------------
|
|
20
|
+
#
|
|
21
|
+
|
|
22
|
+
if File.exist?(path = "spec/watirspec/watirspec.rake")
|
|
23
|
+
load path
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
namespace :watirspec do
|
|
27
|
+
desc 'Initialize and fetch the watirspec submodule'
|
|
28
|
+
task :init do
|
|
29
|
+
sh "git submodule init"
|
|
30
|
+
sh "git submodule update"
|
|
31
|
+
end
|
|
32
|
+
end
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.1.0
|
data/lib/watir-classic.rb
CHANGED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
// IEDialog.cpp : Defines the entry point for the DLL application.
|
|
2
|
+
//
|
|
3
|
+
|
|
4
|
+
#include "stdafx.h"
|
|
5
|
+
#include "IEDialog.h"
|
|
6
|
+
|
|
7
|
+
BOOL APIENTRY DllMain( HANDLE hModule,
|
|
8
|
+
DWORD ul_reason_for_call,
|
|
9
|
+
LPVOID lpReserved
|
|
10
|
+
)
|
|
11
|
+
{
|
|
12
|
+
return TRUE;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
void ShowString(LPCTSTR dialogName)
|
|
16
|
+
{
|
|
17
|
+
MessageBox(NULL, dialogName, "Note", MB_OK);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
void DoElementClick(LPCTSTR windowName, LPCTSTR elementId)
|
|
21
|
+
{
|
|
22
|
+
DoClick(windowName, elementId, NULL);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
void DoButtonClick(LPCTSTR windowName, LPCTSTR buttonName)
|
|
26
|
+
{
|
|
27
|
+
DoClick(windowName, NULL, buttonName);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
void DoClick(LPCTSTR windowName, LPCTSTR elementId, LPCTSTR elementName)
|
|
31
|
+
{
|
|
32
|
+
MessageBox(NULL, "Started", "Info", MB_OK);
|
|
33
|
+
CoInitialize( NULL );
|
|
34
|
+
|
|
35
|
+
IHTMLDocument2* pDoc2 = NULL;
|
|
36
|
+
pDoc2 = GetDoc2(windowName);
|
|
37
|
+
|
|
38
|
+
if(pDoc2 != NULL)
|
|
39
|
+
{
|
|
40
|
+
IHTMLElement* pElem = FindElement(pDoc2, elementId, elementName);
|
|
41
|
+
if(pElem != NULL)
|
|
42
|
+
{
|
|
43
|
+
pElem->click();
|
|
44
|
+
pElem->Release();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
pDoc2->Release();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
CoUninitialize();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
void GetUnknown(HWND hWindow, int* pOut)
|
|
54
|
+
{
|
|
55
|
+
*pOut = 0;
|
|
56
|
+
|
|
57
|
+
HINSTANCE hInst = ::LoadLibrary( TEXT("OLEACC.DLL") );
|
|
58
|
+
if(hInst == NULL)
|
|
59
|
+
{
|
|
60
|
+
MessageBox(NULL, "Cannot load Miscrosoft Active Accessibility", "Error", MB_OK);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
HWND hWndChild=NULL;
|
|
65
|
+
// Get 1st document window
|
|
66
|
+
::EnumChildWindows(hWindow, EnumChildProc, (LPARAM)&hWndChild );
|
|
67
|
+
|
|
68
|
+
IUnknown* pUnknown = NULL;
|
|
69
|
+
|
|
70
|
+
LRESULT lRes;
|
|
71
|
+
UINT nMsg = ::RegisterWindowMessage(TEXT("WM_HTML_GETOBJECT") );
|
|
72
|
+
::SendMessageTimeout( hWndChild, nMsg, 0L, 0L, SMTO_ABORTIFHUNG, 1000, (DWORD*)&lRes );
|
|
73
|
+
LPFNOBJECTFROMLRESULT pfObjectFromLresult = (LPFNOBJECTFROMLRESULT)::GetProcAddress( hInst, TEXT("ObjectFromLresult") );
|
|
74
|
+
if ( pfObjectFromLresult != NULL )
|
|
75
|
+
{
|
|
76
|
+
HRESULT hr;
|
|
77
|
+
hr=pfObjectFromLresult(lRes,IID_IUnknown,0,(void**)&pUnknown);
|
|
78
|
+
|
|
79
|
+
if ( SUCCEEDED(hr) ){
|
|
80
|
+
*pOut = (int)pUnknown;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
IHTMLDocument2* GetDoc2(LPCTSTR windowName)
|
|
86
|
+
{
|
|
87
|
+
HWND hWindow = ::FindWindow(NULL, windowName);
|
|
88
|
+
if(hWindow == NULL)
|
|
89
|
+
{
|
|
90
|
+
MessageBox(NULL, "Cannot find window", "Error", MB_OK);
|
|
91
|
+
return NULL;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
HINSTANCE hInst = ::LoadLibrary( TEXT("OLEACC.DLL") );
|
|
95
|
+
if(hInst == NULL)
|
|
96
|
+
{
|
|
97
|
+
MessageBox(NULL, "Cannot load Miscrosoft Active Accessibility", "Error", MB_OK);
|
|
98
|
+
return NULL;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
HWND hWndChild=NULL;
|
|
102
|
+
// Get 1st document window
|
|
103
|
+
::EnumChildWindows(hWindow, EnumChildProc, (LPARAM)&hWndChild );
|
|
104
|
+
|
|
105
|
+
IHTMLDocument2* pDoc2=NULL;
|
|
106
|
+
|
|
107
|
+
CComPtr<IHTMLDocument> spDoc=NULL;
|
|
108
|
+
|
|
109
|
+
LRESULT lRes;
|
|
110
|
+
UINT nMsg = ::RegisterWindowMessage(TEXT("WM_HTML_GETOBJECT") );
|
|
111
|
+
::SendMessageTimeout( hWndChild, nMsg, 0L, 0L, SMTO_ABORTIFHUNG, 1000, (DWORD*)&lRes );
|
|
112
|
+
LPFNOBJECTFROMLRESULT pfObjectFromLresult = (LPFNOBJECTFROMLRESULT)::GetProcAddress( hInst, TEXT("ObjectFromLresult") );
|
|
113
|
+
if ( pfObjectFromLresult != NULL )
|
|
114
|
+
{
|
|
115
|
+
HRESULT hr;
|
|
116
|
+
hr=pfObjectFromLresult(lRes,IID_IHTMLDocument,0,(void**)&spDoc);
|
|
117
|
+
|
|
118
|
+
if ( SUCCEEDED(hr) ){
|
|
119
|
+
CComPtr<IDispatch> spDisp;
|
|
120
|
+
CComQIPtr<IHTMLWindow2> spWin;
|
|
121
|
+
|
|
122
|
+
hr = spDoc->get_Script( &spDisp );
|
|
123
|
+
|
|
124
|
+
spWin = spDisp;
|
|
125
|
+
spWin->get_document( &pDoc2 );
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return pDoc2;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
BOOL CALLBACK EnumChildProc(HWND hwnd,LPARAM lParam)
|
|
133
|
+
{
|
|
134
|
+
TCHAR buf[100];
|
|
135
|
+
|
|
136
|
+
::GetClassName( hwnd, (LPTSTR)&buf, 100 );
|
|
137
|
+
if ( _tcscmp( buf, _T("Internet Explorer_Server") ) == 0 )
|
|
138
|
+
{
|
|
139
|
+
*(HWND*)lParam = hwnd;
|
|
140
|
+
return FALSE;
|
|
141
|
+
}
|
|
142
|
+
else
|
|
143
|
+
return TRUE;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
IHTMLElement* FindElement(IHTMLDocument2* pDoc2, LPCTSTR elementId, LPCTSTR elementName)
|
|
147
|
+
{
|
|
148
|
+
USES_CONVERSION;
|
|
149
|
+
HRESULT hr;
|
|
150
|
+
|
|
151
|
+
//Enumerate the HTML elements
|
|
152
|
+
IHTMLElementCollection* pColl = NULL;
|
|
153
|
+
hr = pDoc2->get_all( &pColl );
|
|
154
|
+
if (hr == S_OK && pColl != NULL)
|
|
155
|
+
{
|
|
156
|
+
LONG celem;
|
|
157
|
+
pColl->get_length( &celem );
|
|
158
|
+
|
|
159
|
+
//Loop through each elment
|
|
160
|
+
for ( int i=0; i< celem; i++ )
|
|
161
|
+
{
|
|
162
|
+
VARIANT varIndex;
|
|
163
|
+
varIndex.vt = VT_UINT;
|
|
164
|
+
varIndex.lVal = i;
|
|
165
|
+
VARIANT var2;
|
|
166
|
+
VariantInit( &var2 );
|
|
167
|
+
|
|
168
|
+
IDispatch* pDisp;
|
|
169
|
+
|
|
170
|
+
hr = pColl->item( varIndex, var2, &pDisp );//Get an element
|
|
171
|
+
|
|
172
|
+
if ( hr == S_OK )
|
|
173
|
+
{
|
|
174
|
+
IHTMLElement* pElem;
|
|
175
|
+
//Ask for an HTMLElemnt interface
|
|
176
|
+
hr = pDisp->QueryInterface(IID_IHTMLElement, (void **)&pElem);
|
|
177
|
+
|
|
178
|
+
if ( hr == S_OK )
|
|
179
|
+
{
|
|
180
|
+
if(elementId != NULL) //find element by Id
|
|
181
|
+
{
|
|
182
|
+
BSTR bstr;
|
|
183
|
+
//Get the id of the element
|
|
184
|
+
pElem->get_id(&bstr);
|
|
185
|
+
|
|
186
|
+
LPCTSTR id = OLE2T(bstr);
|
|
187
|
+
|
|
188
|
+
if(_tcscmp(id, elementId))
|
|
189
|
+
{
|
|
190
|
+
return pElem;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
else if(elementName != NULL) //find element by Name
|
|
194
|
+
{
|
|
195
|
+
IHTMLInputButtonElement* pButton;
|
|
196
|
+
hr = pDisp->QueryInterface(IID_IHTMLInputButtonElement,(void **)&pButton);
|
|
197
|
+
if ( hr == S_OK )
|
|
198
|
+
{
|
|
199
|
+
BSTR bstr;
|
|
200
|
+
//Get the name of the element
|
|
201
|
+
pButton->get_name(&bstr);
|
|
202
|
+
|
|
203
|
+
LPCTSTR name = OLE2T(bstr);
|
|
204
|
+
|
|
205
|
+
if(_tcscmp(name, elementName))
|
|
206
|
+
{
|
|
207
|
+
return pElem;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
pElem->Release();
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
pColl->Release();
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
return NULL;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|