watir 3.0.0.rc3 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (204) hide show
  1. data/Rakefile +5 -0
  2. data/lib/watir.rb +1 -0
  3. data/lib/watir/loader.rb +2 -0
  4. data/lib/watir/version.rb +3 -0
  5. data/watir.gemspec +18 -54
  6. metadata +32 -278
  7. data/CHANGES +0 -712
  8. data/LICENSE +0 -34
  9. data/README.rdoc +0 -101
  10. data/VERSION +0 -1
  11. data/bin/watir-console +0 -7
  12. data/lib/watir/IEDialog/Release/IEDialog.dll +0 -0
  13. data/lib/watir/close_all.rb +0 -31
  14. data/lib/watir/container.rb +0 -110
  15. data/lib/watir/contrib/enabled_popup.rb +0 -21
  16. data/lib/watir/contrib/ie-new-process.rb +0 -27
  17. data/lib/watir/contrib/page_checker.rb +0 -29
  18. data/lib/watir/cookies.rb +0 -80
  19. data/lib/watir/core.rb +0 -43
  20. data/lib/watir/dialogs/file_field.rb +0 -34
  21. data/lib/watir/dialogs/javascript.rb +0 -43
  22. data/lib/watir/drag_and_drop_helper.rb +0 -68
  23. data/lib/watir/element.rb +0 -441
  24. data/lib/watir/element_collection.rb +0 -109
  25. data/lib/watir/form.rb +0 -96
  26. data/lib/watir/frame.rb +0 -47
  27. data/lib/watir/ie-class.rb +0 -765
  28. data/lib/watir/ie-process.rb +0 -47
  29. data/lib/watir/ie.rb +0 -20
  30. data/lib/watir/image.rb +0 -111
  31. data/lib/watir/input_elements.rb +0 -480
  32. data/lib/watir/irb-history.rb +0 -31
  33. data/lib/watir/link.rb +0 -46
  34. data/lib/watir/locator.rb +0 -243
  35. data/lib/watir/logger.rb +0 -19
  36. data/lib/watir/modal_dialog.rb +0 -72
  37. data/lib/watir/module.rb +0 -12
  38. data/lib/watir/non_control_elements.rb +0 -114
  39. data/lib/watir/page-container.rb +0 -108
  40. data/lib/watir/process.rb +0 -20
  41. data/lib/watir/screen_capture.rb +0 -115
  42. data/lib/watir/supported_elements.rb +0 -172
  43. data/lib/watir/table.rb +0 -224
  44. data/lib/watir/win32.rb +0 -40
  45. data/lib/watir/win32ole.rb +0 -16
  46. data/lib/watir/win32ole/1.8.7/win32ole.so +0 -0
  47. data/lib/watir/win32ole/1.9.3/win32ole.so +0 -0
  48. data/lib/watir/window.rb +0 -68
  49. data/lib/watir/xpath_locator.rb +0 -52
  50. data/rakefile.rb +0 -54
  51. data/unittests/all_tests.rb +0 -10
  52. data/unittests/buttons_xpath_test.rb +0 -68
  53. data/unittests/checkbox_test.rb +0 -163
  54. data/unittests/checkbox_xpath_test.rb +0 -106
  55. data/unittests/click_no_wait_test.rb +0 -23
  56. data/unittests/close_all_test.rb +0 -17
  57. data/unittests/core_tests.rb +0 -17
  58. data/unittests/css_selector_test.rb +0 -44
  59. data/unittests/css_test.rb +0 -38
  60. data/unittests/dialog_test.rb +0 -64
  61. data/unittests/div2_xpath_test.rb +0 -21
  62. data/unittests/div_test.rb +0 -170
  63. data/unittests/div_xpath_test.rb +0 -95
  64. data/unittests/document_standards.rb +0 -63
  65. data/unittests/element_collection_indexes_test.rb +0 -57
  66. data/unittests/element_collections_test.rb +0 -100
  67. data/unittests/element_test.rb +0 -47
  68. data/unittests/errorchecker_test.rb +0 -31
  69. data/unittests/filefield_test.rb +0 -43
  70. data/unittests/filefield_xpath_test.rb +0 -35
  71. data/unittests/form_test.rb +0 -282
  72. data/unittests/form_xpath_test.rb +0 -254
  73. data/unittests/frame_test.rb +0 -165
  74. data/unittests/google_form_test.rb +0 -15
  75. data/unittests/html/JavascriptClick.html +0 -39
  76. data/unittests/html/blankpage.html +0 -11
  77. data/unittests/html/buttons1.html +0 -40
  78. data/unittests/html/checkboxes1.html +0 -89
  79. data/unittests/html/click_no_wait.html +0 -14
  80. data/unittests/html/complex_table.html +0 -35
  81. data/unittests/html/cssTest.html +0 -42
  82. data/unittests/html/depot_store.html +0 -59
  83. data/unittests/html/div.html +0 -92
  84. data/unittests/html/div_xml.html +0 -21
  85. data/unittests/html/fileupload.html +0 -44
  86. data/unittests/html/formTest1.html +0 -38
  87. data/unittests/html/forms2.html +0 -44
  88. data/unittests/html/forms3.html +0 -131
  89. data/unittests/html/forms4.html +0 -26
  90. data/unittests/html/frame_buttons.html +0 -4
  91. data/unittests/html/frame_links.html +0 -4
  92. data/unittests/html/frame_multi.html +0 -5
  93. data/unittests/html/google_india.html +0 -119
  94. data/unittests/html/ie7_document_standards.html +0 -9
  95. data/unittests/html/ie8_document_standards.html +0 -9
  96. data/unittests/html/ie9_document_standards.html +0 -9
  97. data/unittests/html/iframe.html +0 -3
  98. data/unittests/html/iframeTest.html +0 -17
  99. data/unittests/html/iframeTest1.html +0 -7
  100. data/unittests/html/iframeTest2.html +0 -5
  101. data/unittests/html/images/1.gif +0 -0
  102. data/unittests/html/images/2.GIF +0 -0
  103. data/unittests/html/images/3.GIF +0 -0
  104. data/unittests/html/images/button.jpg +0 -0
  105. data/unittests/html/images/circle.jpg +0 -0
  106. data/unittests/html/images/map.GIF +0 -0
  107. data/unittests/html/images/map2.gif +0 -0
  108. data/unittests/html/images/minus.GIF +0 -0
  109. data/unittests/html/images/originaltriangle.jpg +0 -0
  110. data/unittests/html/images/plus.gif +0 -0
  111. data/unittests/html/images/square.jpg +0 -0
  112. data/unittests/html/images/triangle.jpg +0 -0
  113. data/unittests/html/images1.html +0 -65
  114. data/unittests/html/javascriptevents.html +0 -33
  115. data/unittests/html/link_pass.html +0 -11
  116. data/unittests/html/links1.html +0 -37
  117. data/unittests/html/links2.html +0 -11
  118. data/unittests/html/links_multi.html +0 -12
  119. data/unittests/html/list_matters.html +0 -720
  120. data/unittests/html/lists.html +0 -18
  121. data/unittests/html/map_test.html +0 -30
  122. data/unittests/html/modal_dialog.html +0 -10
  123. data/unittests/html/modal_dialog_launcher.html +0 -12
  124. data/unittests/html/multiple_specifiers.html +0 -64
  125. data/unittests/html/nestedFrames.html +0 -6
  126. data/unittests/html/new_browser.html +0 -17
  127. data/unittests/html/pass.html +0 -13
  128. data/unittests/html/popups1.html +0 -59
  129. data/unittests/html/pre.html +0 -29
  130. data/unittests/html/quirks_document_standards.html +0 -8
  131. data/unittests/html/radioButtons1.html +0 -71
  132. data/unittests/html/select_tealeaf.html +0 -54
  133. data/unittests/html/selectboxes1.html +0 -52
  134. data/unittests/html/simple_table.html +0 -25
  135. data/unittests/html/simple_table_buttons.html +0 -104
  136. data/unittests/html/simple_table_columns.html +0 -75
  137. data/unittests/html/table1.html +0 -179
  138. data/unittests/html/tableCell_using_xpath.html +0 -19
  139. data/unittests/html/table_and_tablerow_to_a.html +0 -174
  140. data/unittests/html/textarea.html +0 -30
  141. data/unittests/html/textfields1.html +0 -100
  142. data/unittests/html/textsearch.html +0 -44
  143. data/unittests/html/wallofcheckboxes.html +0 -1003
  144. data/unittests/html/xpath_nbsp.html +0 -11
  145. data/unittests/html/zeroindex.html +0 -11
  146. data/unittests/ie_exists_test.rb +0 -16
  147. data/unittests/ie_mock.rb +0 -94
  148. data/unittests/ie_test.rb +0 -54
  149. data/unittests/images_test.rb +0 -156
  150. data/unittests/images_xpath_test.rb +0 -90
  151. data/unittests/index_specifier_test.rb +0 -31
  152. data/unittests/js_events_test.rb +0 -31
  153. data/unittests/links_multi_test.rb +0 -34
  154. data/unittests/links_test.rb +0 -131
  155. data/unittests/links_xpath_test.rb +0 -38
  156. data/unittests/lists_test.rb +0 -23
  157. data/unittests/map_test.rb +0 -98
  158. data/unittests/minmax_test.rb +0 -37
  159. data/unittests/navigate_test.rb +0 -38
  160. data/unittests/nbsp_xpath_test.rb +0 -16
  161. data/unittests/no_wait_test.rb +0 -28
  162. data/unittests/non_core_tests.rb +0 -12
  163. data/unittests/other/all_tests_concurrent.rb +0 -57
  164. data/unittests/other/navigate_exception_test.rb +0 -24
  165. data/unittests/other/rexml_unit_test.rb +0 -27
  166. data/unittests/other/screen_capture_test.rb +0 -53
  167. data/unittests/other/testcase_method_order_test.rb +0 -36
  168. data/unittests/other/testcase_verify_test.rb +0 -25
  169. data/unittests/other/wait_until_test.rb +0 -102
  170. data/unittests/pagecontainstext_test.rb +0 -69
  171. data/unittests/parent_child_test.rb +0 -27
  172. data/unittests/perf_test.rb +0 -20
  173. data/unittests/pre_test.rb +0 -49
  174. data/unittests/radios_test.rb +0 -181
  175. data/unittests/radios_xpath_test.rb +0 -100
  176. data/unittests/security_setting_test.rb +0 -24
  177. data/unittests/selectbox_test.rb +0 -144
  178. data/unittests/selectbox_xpath_test.rb +0 -102
  179. data/unittests/setup.rb +0 -70
  180. data/unittests/speed_settings_test.rb +0 -67
  181. data/unittests/table_cell_using_xpath_test.rb +0 -34
  182. data/unittests/table_test.rb +0 -296
  183. data/unittests/table_xpath_test.rb +0 -109
  184. data/unittests/test_tests.rb +0 -9
  185. data/unittests/textarea_test.rb +0 -92
  186. data/unittests/textarea_xpath_test.rb +0 -77
  187. data/unittests/textfield_for_ch_char_test.rb +0 -32
  188. data/unittests/textfields_test.rb +0 -184
  189. data/unittests/textfields_xpath_test.rb +0 -110
  190. data/unittests/version_test.rb +0 -15
  191. data/unittests/win32ole_so_test.rb +0 -35
  192. data/unittests/window_tests.rb +0 -10
  193. data/unittests/windows/attach_to_existing_window_test.rb +0 -52
  194. data/unittests/windows/attach_to_new_window_test.rb +0 -74
  195. data/unittests/windows/close_window_test.rb +0 -20
  196. data/unittests/windows/frame_links_test.rb +0 -23
  197. data/unittests/windows/ie-each_test.rb +0 -46
  198. data/unittests/windows/modal_dialog_test.rb +0 -95
  199. data/unittests/windows/new_process_test.rb +0 -24
  200. data/unittests/windows/new_test.rb +0 -58
  201. data/unittests/windows/open_close_test.rb +0 -19
  202. data/unittests/windows/send_keys_test.rb +0 -26
  203. data/unittests/xpath_tests.rb +0 -11
  204. data/watir-rdoc.rb +0 -7
@@ -1,28 +0,0 @@
1
- $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
2
- require 'unittests/setup'
3
-
4
- class TC_No_Wait_Commands < Test::Unit::TestCase
5
- def test_fire_event_no_wait
6
- goto_page "javascriptevents.html"
7
- browser.text_field(:index, 0).fire_event_no_wait("onkeyup")
8
- assert_nothing_raised{
9
- Watir::Wait.until {browser.div(:id, 'event_name').text == 'onkeyup'}
10
- }
11
- end
12
-
13
- def test_set_no_wait_text_field
14
- goto_page "textfields1.html"
15
- browser.text_field(:name, "text1").set_no_wait("watir IE Controller")
16
- assert_nothing_raised{
17
- Watir::Wait.until {browser.text_field(:name, "text1").value == "watir IE Controller"}
18
- }
19
- end
20
-
21
- def test_select_no_wait_text_select_list
22
- goto_page "selectboxes1.html"
23
- browser.select_list(:name,'sel1').select_no_wait(/Option 1/)
24
- assert_nothing_raised{
25
- Watir::Wait.until {browser.select_list(:name , 'sel1').selected_options.first.text == 'Option 1'}
26
- }
27
- end
28
- end
@@ -1,12 +0,0 @@
1
- TOPDIR = File.join(File.dirname(__FILE__), '..')
2
- $LOAD_PATH.unshift TOPDIR
3
-
4
- require 'unittests/setup.rb'
5
-
6
- Dir.chdir TOPDIR
7
- $all_tests.each {|x| require x}
8
-
9
- Watir::UnitTest.filter = proc do |test|
10
- test.class.to_s !~ /xpath/i &&
11
- test.class.tags.include?(:must_be_visible)
12
- end
@@ -1,57 +0,0 @@
1
- # This is an UNFINISHED attempt to run the unit tests currently.
2
- # The work on the harness is complete.
3
- # The problem remaining is that the tests are not thread-safe.
4
- # It's an open question whether getting this to work would actually save any execution time.
5
-
6
- TOPDIR = File.join(File.dirname(__FILE__), '..')
7
- $LOAD_PATH.unshift TOPDIR
8
- Dir.chdir TOPDIR
9
- #(Dir["unittests/*_test.rb"] - ["unittests/popups_test.rb"]).each {|x| require x}
10
-
11
- require 'unittests/buttons_test'
12
- require 'unittests/checkbox_test'
13
-
14
- require 'test/unit/testsuite'
15
- require 'thread'
16
- class ConcurrentTestSuite < Test::Unit::TestSuite
17
-
18
- # Runs the tests and/or suites contained in this TestSuite.
19
- def run(result, &progress_block)
20
- yield(STARTED, name)
21
- threads = []
22
- @tests.each do |test|
23
- threads << Thread.new do
24
- test.run(result, &progress_block)
25
- end
26
- end
27
- threads.each {|t| t.join}
28
- yield(FINISHED, name)
29
- end
30
- end
31
-
32
- # create a suite
33
- require 'test/unit/collector/objectspace'
34
-
35
- require 'test/unit/collector'
36
- include Test::Unit::Collector
37
-
38
-
39
- @filters = []
40
- suite = ConcurrentTestSuite.new('super suite')
41
- sub_suites = []
42
- ::ObjectSpace.each_object(Class) do |klass|
43
- if(Test::Unit::TestCase > klass)
44
- puts sub_suites, klass.suite
45
- add_suite(sub_suites, klass.suite)
46
- end
47
- end
48
- sort(sub_suites).each{|s| suite << s}
49
-
50
-
51
-
52
- # select a runner
53
- require 'test/unit/ui/console/testrunner'
54
- Test::Unit::UI::Console::TestRunner.run(suite)
55
-
56
-
57
- # then subclass Test::Unit::TestSuite and override the run method to be multithreaded
@@ -1,24 +0,0 @@
1
- # feature tests for navigation errors
2
-
3
- $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..') unless $SETUP_LOADED
4
- require 'unittests/setup'
5
- require 'watir/contrib/page_checker'
6
- # To add checkers, call the ie.add_checker method
7
- #
8
- # ie.
9
-
10
- class TC_NavigateException < Test::Unit::TestCase
11
- include Watir
12
-
13
- def setup
14
- browser.add_checker(PageCheckers::NAVIGATION_CHECKER)
15
- end
16
- def teardown
17
- browser.disable_checker(PageCheckers::NAVIGATION_CHECKER)
18
- end
19
-
20
- def test_http_errors
21
- assert_raises(NavigationException) { browser.goto('http://localhost:3001') } # Cannot find server or DNS Error
22
- assert_raises(NavigationException) { browser.goto('http://www.fxruby.org/dfdf' ) } # HTTP 404 - File not found
23
- end
24
- end
@@ -1,27 +0,0 @@
1
- require 'test/unit'
2
- require 'nokogiri'
3
-
4
- class XPathTest < Test::Unit::TestCase
5
- def setup
6
- file = File.open( "xpath_bug.xml" )
7
- @doc = Nokogiri::HTML::Document.read_io(file, nil, nil, 2145)
8
- end
9
- def fixture xpath
10
- matches = []
11
-
12
- @doc.xpath(xpath).each() do |node|
13
- matches << node
14
- assert_equal('Add', node.text)
15
- assert_equal('ButtonText', node['class'])
16
- end
17
-
18
- assert_equal(1, matches.length)
19
- end
20
- def test_text
21
- fixture "//div[text()='Add' and @class='ButtonText']"
22
- end
23
- def test_contains
24
- fixture "//div[contains(.,'Add') and @class='ButtonText']"
25
- end
26
- end
27
-
@@ -1,53 +0,0 @@
1
- # feature tests for screen capture
2
-
3
- $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
4
- require 'unittests/setup'
5
- require 'watir/screen_capture'
6
-
7
- class TC_Capture< Test::Unit::TestCase
8
- tags :must_be_visible
9
- include Watir
10
- include Watir::ScreenCapture
11
-
12
- def setup
13
- delete_captured_files( [ 'jpeg1.jpg' , 'jpeg2.jpg' , 'bmp1.bmp', 'bmp2.bmp' ] )
14
- browser.goto($htmlRoot + 'buttons1.html' )
15
- @file_list = []
16
- end
17
-
18
- def teardown
19
- delete_captured_files
20
- end
21
-
22
- def delete_captured_files(files=nil )
23
- files = @file_list unless files
24
- files.each do |f|
25
- File.delete( f) if FileTest.exists?( f)
26
- end
27
- end
28
-
29
- def test_jpeg
30
- file_name= 'jpeg1.jpg'
31
- @file_list << file_name
32
- screen_capture( file_name )
33
- assert(FileTest.exist?( file_name) )
34
-
35
- file_name= 'jpeg2.jpg'
36
- @file_list << file_name
37
- screen_capture( file_name , true ) # just the active window
38
- assert(FileTest.exist?( file_name) )
39
- end
40
-
41
- def test_bmp
42
- file_name= 'bmp1.bmp'
43
- @file_list << file_name
44
- screen_capture( file_name , false, true )
45
- assert(FileTest.exist?( file_name ) )
46
-
47
- file_name= 'bmp2.bmp'
48
- @file_list << file_name
49
- screen_capture( file_name , true , true ) # just the active window
50
- assert(FileTest.exist?( file_name) )
51
- end
52
- end
53
-
@@ -1,36 +0,0 @@
1
- # the default behavior of Test::Unit::TestCase should be to execute test
2
- # methods in alphabetical order.
3
- # When executed, should print "A.B.C.D.E.F.G.H.I.J.K.L.F"
4
- # The final F is actually an expected failure:
5
- # 1) Failure:
6
- # default_test(TC4_No_Test_Methods)
7
-
8
- $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..') unless $SETUP_LOADED
9
-
10
- require 'watir/testcase'
11
-
12
- class TC1_Alphabetical_Default < Watir::TestCase
13
- execute :alphabetically
14
- def test_b; print 'B'; end
15
- def test_a; print 'A'; end
16
- def test_d; print 'D'; end
17
- def test_c; print 'C'; end
18
- end
19
-
20
- class TC2_Sequential < Watir::TestCase
21
- def test_b; print 'E'; end
22
- def test_a; print 'F'; end
23
- def test_d; print 'G'; end
24
- def test_c; print 'H'; end
25
- end
26
-
27
- class TC3_Alphabetical_Specified < Watir::TestCase
28
- execute :alphabetically
29
- def test_b; print 'J'; end
30
- def test_a; print 'I'; end
31
- def test_d; print 'L'; end
32
- def test_c; print 'K'; end
33
- end
34
-
35
- class TC4_No_Test_Methods < Watir::TestCase
36
- end
@@ -1,25 +0,0 @@
1
- # 3 tests, 10 assertions, 4 failures, 0 errors
2
-
3
- require 'watir/testcase'
4
-
5
- class VerifyTests < Watir::TestCase
6
-
7
- def test_verify
8
- verify true
9
- assert true
10
- verify false
11
- assert true
12
- end
13
-
14
- def test_verify_equal
15
- verify_equal 1, 1
16
- verify_equal 1, 2
17
- verify_equal 3, 4
18
- end
19
-
20
- def test_verify_match
21
- verify_match /\d*/, '123'
22
- verify_match 'foo', 'foobar'
23
- verify_match '...', 'A'
24
- end
25
- end
@@ -1,102 +0,0 @@
1
- # feature tests for wait_until
2
- #
3
- # Watir::Waiter is DEPRECATED! Use methods from Watir::Wait and Watir::ElementExtensions instead!
4
- #
5
-
6
- require 'watir/testcase'
7
- require 'watir/waiter'
8
- require 'watir'
9
- require 'spec' # gem install rspec
10
-
11
- # used for unit testing
12
- class MockTimeKeeper < Watir::TimeKeeper
13
- def sleep seconds
14
- @sleep_time += seconds
15
- end
16
- def now
17
- Time.now + @sleep_time
18
- end
19
- end
20
-
21
- class WaitUntilInstanceTest < Watir::TestCase
22
-
23
- def setup
24
- @waiter = Watir::Waiter.new
25
- @waiter.timeout = 10.0
26
- @mock_checkee = Spec::Mocks::Mock.new "mock_checkee"
27
-
28
- # remove this line to test with actual TimeKeeper intead of the Mock
29
- # (slower, but more accurate)
30
- @waiter.timer = MockTimeKeeper.new
31
- end
32
-
33
- def teardown
34
- @mock_checkee.__verify if @test_passed
35
- end
36
-
37
- # Instance Method
38
-
39
- def test_no_time_passes_if_true
40
- @waiter.wait_until {true}
41
- @waiter.timer.sleep_time.should_equal 0.0
42
- end
43
-
44
- def test_three_tries_before_true
45
- @mock_checkee.should_receive(:check).exactly(3).times.and_return [false, false, true]
46
- @waiter.wait_until {@mock_checkee.check}
47
- @waiter.timer.sleep_time.should_equal 1.0
48
- end
49
-
50
- def test_timeout
51
- @mock_checkee.should_receive(:check).any_number_of_times.and_return false
52
- lambda{@waiter.wait_until {@mock_checkee.check}}.should_raise Watir::Exception::TimeOutException
53
- @waiter.timer.sleep_time.should_be_close 10.25, 0.26
54
- @waiter.timer.sleep_time.should_satisfy {|x| [10.0, 10.5].include? x}
55
- end
56
-
57
- def test_polling_interval
58
- @waiter.polling_interval = 0.1
59
- @mock_checkee.should_receive(:check).any_number_of_times.and_return false
60
- lambda{@waiter.wait_until {@mock_checkee.check}}.should_raise Watir::Exception::TimeOutException
61
- @waiter.timer.sleep_time.should_be_close 10.05, 0.07
62
- end
63
-
64
- def test_timeout_duration
65
- @mock_checkee.should_receive(:check).any_number_of_times.and_return false
66
- begin
67
- @waiter.wait_until {@mock_checkee.check}
68
- flunk
69
- rescue Watir::Exception::TimeOutException => e
70
- e.duration.should_be_close 10.25, 0.26
71
- e.timeout.should_equal 10.0
72
- end
73
- end
74
- end
75
-
76
- class WaitUntilClassTest < Watir::TestCase
77
-
78
- def setup
79
- @mock_checkee = Spec::Mocks::Mock.new "mock_checkee"
80
- @mock_checkee.should_receive(:check).exactly(3).times.and_return [false, false, true]
81
- end
82
-
83
- def teardown
84
- @mock_checkee.__verify if @test_passed
85
- end
86
- # Class method
87
-
88
- def test_class_method_with_args
89
- Watir::Waiter.wait_until(5, 0.1) {@mock_checkee.check}
90
- end
91
-
92
- def test_class_method_with_defaults
93
- Watir::Waiter.wait_until {@mock_checkee.check}
94
- end
95
-
96
- include Watir
97
- def test_watir_method
98
- wait_until {@mock_checkee.check}
99
- end
100
-
101
- end
102
-
@@ -1,69 +0,0 @@
1
- # feature tests for IE::contains_text
2
-
3
- $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
4
- require 'unittests/setup'
5
-
6
- class TC_contains_text < Test::Unit::TestCase
7
-
8
- def setup
9
- goto_page "textsearch.html"
10
- end
11
-
12
- def test_text_found
13
- assert(browser.contains_text('slings and arrows of outrageous fortune'))
14
- end
15
-
16
- def test_text_not_found
17
- assert_false(browser.contains_text('So are they all, all honourable men'))
18
- end
19
-
20
- def test_regexp_found
21
- assert(browser.contains_text(/bodkin.*fardels/))
22
- end
23
-
24
- def test_regexp_not_found
25
- assert_false(browser.contains_text(/winding.*watch.*wit/))
26
- end
27
-
28
- def test_match_regexp_found
29
- $~ = browser.contains_text(/Messages ([0-9]+)/)
30
- assert_equal('42', $1)
31
- end
32
-
33
- def test_bad_search_argument
34
- assert_raises(ArgumentError) do
35
- browser.contains_text
36
- end
37
- assert_raises(ArgumentError) do
38
- browser.contains_text(nil)
39
- end
40
- assert_raises(ArgumentError) do
41
- browser.contains_text(42)
42
- end
43
- end
44
-
45
- end
46
-
47
- class TC_contains_text_in_new_ie < Test::Unit::TestCase
48
- tags :fails_on_firefox
49
- # Doesn't actually raise an error, but fails to close the window afterwards
50
- # http://jira.openqa.org/browse/WTR-265
51
- def setup
52
- @new_browser = Watir::Browser.new
53
- end
54
- def test_nothing_raised
55
- assert_nothing_raised {@new_browser.text.include? ''}
56
- end
57
- def teardown
58
- @new_browser.close
59
- end
60
- end
61
-
62
- class TC_contains_text_in_frame < Test::Unit::TestCase
63
- def setup
64
- goto_page "frame_links.html"
65
- end
66
- def test_in_frame
67
- assert browser.frame(:name => 'linkFrame').contains_text('The button is really a link')
68
- end
69
- end