watir 1.5.6 → 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. data/{changes.rb → CHANGES} +12 -3
  2. data/bin/watir-console +7 -1
  3. data/lib/changes.rb +3 -0
  4. data/{license.rb → lib/license.rb} +2 -1
  5. data/{readme.rb → lib/readme.rb} +4 -6
  6. data/{watir → lib/watir}/AutoItX3.dll +0 -0
  7. data/{watir → lib/watir}/IEDialog/Release/IEDialog.dll +0 -0
  8. data/{watir → lib/watir}/WindowHelper.rb +1 -1
  9. data/{watir → lib/watir}/camel_case.rb +0 -0
  10. data/{watir → lib/watir}/clickJSDialog.rb +0 -0
  11. data/{watir → lib/watir}/close_all.rb +1 -1
  12. data/{watir → lib/watir}/collections.rb +1 -1
  13. data/{watir → lib/watir}/container.rb +17 -8
  14. data/{watir → lib/watir}/contrib/enabled_popup.rb +0 -0
  15. data/{watir → lib/watir}/contrib/ie-new-process.rb +0 -0
  16. data/{watir → lib/watir}/contrib/page_checker.rb +0 -0
  17. data/{watir → lib/watir}/contrib/visible.rb +2 -2
  18. data/{watir → lib/watir}/cookiemanager.rb +0 -0
  19. data/{watir → lib/watir}/datahandler.rb +0 -0
  20. data/{watir → lib/watir}/dialog.rb +1 -1
  21. data/{watir → lib/watir}/element.rb +3 -7
  22. data/{watir → lib/watir}/element_collections.rb +0 -0
  23. data/{watir → lib/watir}/form.rb +31 -11
  24. data/{watir → lib/watir}/frame.rb +0 -0
  25. data/{watir/ie.rb → lib/watir/ie-class.rb} +22 -22
  26. data/{watir → lib/watir}/ie-process.rb +0 -0
  27. data/{watir.rb → lib/watir/ie.rb} +11 -27
  28. data/{watir → lib/watir}/image.rb +0 -0
  29. data/{watir → lib/watir}/input_elements.rb +33 -44
  30. data/{watir → lib/watir}/irb-history.rb +0 -0
  31. data/{watir → lib/watir}/link.rb +0 -0
  32. data/{watir → lib/watir}/locator.rb +56 -43
  33. data/{watir → lib/watir}/logger.rb +0 -0
  34. data/{watir → lib/watir}/modal_dialog.rb +0 -0
  35. data/{watir → lib/watir}/non_control_elements.rb +0 -0
  36. data/{watir → lib/watir}/page-container.rb +2 -2
  37. data/{watir → lib/watir}/popup.rb +0 -0
  38. data/{watir → lib/watir}/process.rb +0 -0
  39. data/{watir → lib/watir}/screen_capture.rb +0 -0
  40. data/{watir → lib/watir}/setFileDialog.rb +0 -0
  41. data/{watir → lib/watir}/table.rb +7 -2
  42. data/{watir → lib/watir}/utils.rb +0 -0
  43. data/lib/watir/version.rb +5 -0
  44. data/{watir → lib/watir}/watir_simple.rb +3 -3
  45. data/{watir → lib/watir}/win32.rb +0 -0
  46. data/lib/watir/win32ole.rb +6 -0
  47. data/lib/watir/win32ole/win32ole.so +0 -0
  48. data/{watir → lib/watir}/winClicker.rb +0 -0
  49. data/unittests/buttons_xpath_test.rb +32 -32
  50. data/unittests/checkbox_test.rb +113 -99
  51. data/unittests/checkbox_xpath_test.rb +57 -57
  52. data/unittests/core_tests.rb +10 -7
  53. data/unittests/css_test.rb +12 -32
  54. data/unittests/defer_test.rb +22 -22
  55. data/unittests/dialog_test.rb +13 -13
  56. data/unittests/div2_xpath_test.rb +3 -3
  57. data/unittests/div_test.rb +23 -19
  58. data/unittests/div_xpath_test.rb +50 -50
  59. data/unittests/errorchecker_test.rb +7 -9
  60. data/unittests/filefield_test.rb +12 -11
  61. data/unittests/filefield_xpath_test.rb +10 -10
  62. data/unittests/form_test.rb +144 -151
  63. data/unittests/form_xpath_test.rb +99 -99
  64. data/unittests/frame_test.rb +46 -44
  65. data/unittests/google_form_test.rb +2 -2
  66. data/unittests/html/checkboxes1.html +19 -16
  67. data/unittests/html/forms3.html +2 -2
  68. data/unittests/html/wallofcheckboxes.html +1003 -0
  69. data/unittests/ie_exists_test.rb +5 -3
  70. data/unittests/ie_test.rb +2 -2
  71. data/unittests/images_test.rb +83 -82
  72. data/unittests/images_xpath_test.rb +40 -40
  73. data/unittests/iostring_test.rb +1 -1
  74. data/unittests/links_multi_test.rb +7 -8
  75. data/unittests/links_test.rb +73 -71
  76. data/unittests/links_xpath_test.rb +15 -15
  77. data/unittests/lists_test.rb +10 -10
  78. data/unittests/map_test.rb +65 -65
  79. data/unittests/minmax_test.rb +10 -9
  80. data/unittests/navigate_test.rb +19 -23
  81. data/unittests/nbsp_xpath_test.rb +2 -2
  82. data/unittests/non_core_tests.rb +5 -2
  83. data/unittests/other/WindowLogonExample.rb +2 -2
  84. data/unittests/other/WindowLogonExtra.rb +1 -1
  85. data/unittests/other/navigate_exception_test.rb +14 -3
  86. data/unittests/other/screen_capture_test.rb +3 -2
  87. data/unittests/other/testcase_method_order_test.rb +1 -1
  88. data/unittests/pagecontainstext_test.rb +17 -14
  89. data/unittests/parent_child_test.rb +11 -7
  90. data/unittests/perf_test.rb +20 -0
  91. data/unittests/popups_test.rb +13 -14
  92. data/unittests/pre_test.rb +30 -28
  93. data/unittests/radios_test.rb +128 -107
  94. data/unittests/radios_xpath_test.rb +47 -47
  95. data/unittests/security_setting_test.rb +24 -0
  96. data/unittests/selectbox_test.rb +65 -157
  97. data/unittests/selectbox_xpath_test.rb +51 -51
  98. data/unittests/setup.rb +52 -48
  99. data/unittests/speed_settings_test.rb +31 -20
  100. data/unittests/table_cell_using_xpath_test.rb +12 -12
  101. data/unittests/table_test.rb +30 -16
  102. data/unittests/table_xpath_test.rb +25 -25
  103. data/unittests/test_tests.rb +9 -0
  104. data/unittests/textarea_test.rb +33 -33
  105. data/unittests/textarea_xpath_test.rb +37 -37
  106. data/unittests/textfield_for_ch_char_test.rb +9 -9
  107. data/unittests/textfields_test.rb +103 -98
  108. data/unittests/textfields_xpath_test.rb +50 -50
  109. data/unittests/windows/attach_to_existing_window_test.rb +2 -2
  110. data/unittests/windows/attach_to_new_window_test.rb +10 -10
  111. data/unittests/windows/close_window_test.rb +2 -2
  112. data/unittests/windows/frame_links_test.rb +6 -6
  113. data/unittests/windows/ie-each_test.rb +1 -1
  114. data/unittests/windows/iedialog_test.rb +4 -5
  115. data/unittests/windows/js_events_test.rb +14 -14
  116. data/unittests/windows/jscriptExtraAlert.rb +2 -1
  117. data/unittests/windows/jscriptExtraConfirmCancel.rb +1 -1
  118. data/unittests/windows/jscriptExtraConfirmOk.rb +1 -1
  119. data/unittests/windows/jscriptPushButton.rb +2 -1
  120. data/unittests/windows/jscript_test.rb +7 -7
  121. data/unittests/windows/modal_dialog_test.rb +28 -29
  122. data/unittests/windows/{new.rb → new_test.rb} +1 -1
  123. data/unittests/windows/open_close_test.rb +4 -7
  124. data/unittests/windows/send_keys_test.rb +11 -11
  125. data/unittests/xpath_tests.rb +4 -3
  126. metadata +82 -58
  127. data/unittests/buttons_test.rb +0 -107
  128. data/watir/assertions.rb +0 -44
  129. data/watir/exceptions.rb +0 -42
  130. data/watir/testcase.rb +0 -58
  131. data/watir/waiter.rb +0 -88
  132. data/watir/win32ole.rb +0 -8
  133. data/watir/win32ole/win32ole.so +0 -0
@@ -1,7 +1,7 @@
1
1
  # feature tests for Links
2
- # revision: $Revision: 1348 $
2
+ # revision: $Revision: 1544 $
3
3
 
4
- $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__
4
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
5
5
  require 'unittests/setup'
6
6
 
7
7
  class TC_Links_XPath < Test::Unit::TestCase
@@ -11,28 +11,28 @@ class TC_Links_XPath < Test::Unit::TestCase
11
11
  end
12
12
 
13
13
  def test_link_exists
14
- assert($ie.link(:xpath, "//a[contains(.,'test1')]/").exists?)
15
- assert($ie.link(:xpath, "//a[contains(., /TEST/i)]/").exists?)
16
- assert(!$ie.link(:xpath, "//a[contains(.,'missing')]/").exists?)
14
+ assert(browser.link(:xpath, "//a[contains(.,'test1')]/").exists?)
15
+ assert(browser.link(:xpath, "//a[contains(., /TEST/i)]/").exists?)
16
+ assert_false(browser.link(:xpath, "//a[contains(.,'missing')]/").exists?)
17
17
 
18
- assert(!$ie.link(:xpath, "//a[@url='alsomissing.html']/").exists?)
18
+ assert_false(browser.link(:xpath, "//a[@url='alsomissing.html']/").exists?)
19
19
 
20
- assert($ie.link(:xpath, "//a[@id='link_id']/").exists?)
21
- assert(!$ie.link(:xpath, "//a[@id='alsomissing']/").exists?)
20
+ assert(browser.link(:xpath, "//a[@id='link_id']/").exists?)
21
+ assert_false(browser.link(:xpath, "//a[@id='alsomissing']/").exists?)
22
22
 
23
- assert($ie.link(:xpath, "//a[@name='link_name']/").exists?)
24
- assert(!$ie.link(:xpath, "//a[@name='alsomissing']/").exists?)
25
- assert($ie.link(:xpath, "//a[@title='link_title']/").exists?)
23
+ assert(browser.link(:xpath, "//a[@name='link_name']/").exists?)
24
+ assert_false(browser.link(:xpath, "//a[@name='alsomissing']/").exists?)
25
+ assert(browser.link(:xpath, "//a[@title='link_title']/").exists?)
26
26
  end
27
27
 
28
28
  def test_link_click
29
- $ie.link(:xpath, "//a[contains(.,'test1')]/").click
30
- assert($ie.text.include?("Links2-Pass"))
29
+ browser.link(:xpath, "//a[contains(.,'test1')]/").click
30
+ assert(browser.text.include?("Links2-Pass"))
31
31
  end
32
32
 
33
33
  def test_link_with_text_call
34
- $ie.link(:xpath, "//a[text()='test1']").click
35
- assert($ie.text.include?("Links2-Pass"))
34
+ browser.link(:xpath, "//a[text()='test1']").click
35
+ assert(browser.text.include?("Links2-Pass"))
36
36
  end
37
37
 
38
38
  end
@@ -1,4 +1,4 @@
1
- $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__
1
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
2
2
  require 'unittests/setup'
3
3
 
4
4
  class Lists_Tests < Watir::TestCase
@@ -8,24 +8,24 @@ class Lists_Tests < Watir::TestCase
8
8
  end
9
9
 
10
10
  def test_list_items_exist
11
- assert($ie.li(:id, 'list1').exists?)
12
- assert($ie.li(:id, 'list2').exists?)
13
- assert($ie.li(:id, 'list3').exists?)
14
- assert($ie.li(:id, 'ordered1').exists?)
15
- assert_equal('Coffee', $ie.li(:index, 1).text)
11
+ assert(browser.li(:id, 'list1').exists?)
12
+ assert(browser.li(:id, 'list2').exists?)
13
+ assert(browser.li(:id, 'list3').exists?)
14
+ assert(browser.li(:id, 'ordered1').exists?)
15
+ assert_equal('Coffee', browser.li(:index, 1).text)
16
16
  end
17
17
 
18
18
  def test_list_item_exists_by_name
19
- assert($ie.li(:name, 'x1').exists?)
20
- assert ! ($ie.li(:name, 'maptest02').exists?)
19
+ assert(browser.li(:name, 'x1').exists?)
20
+ assert ! (browser.li(:name, 'maptest02').exists?)
21
21
  end
22
22
 
23
23
  def test_li_length
24
- assert_equal(6, $ie.lis.length)
24
+ assert_equal(6, browser.lis.length)
25
25
  end
26
26
 
27
27
  def test_multiple_attributes
28
- assert_equal('Phil', $ie.li(:id => 'ordered1', :name => 'x1').text)
28
+ assert_equal('Phil', browser.li(:id => 'ordered1', :name => 'x1').text)
29
29
  end
30
30
 
31
31
  end
@@ -1,97 +1,97 @@
1
- $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__
1
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
2
2
  require 'unittests/setup'
3
-
3
+
4
4
  class Map_Tests < Watir::TestCase
5
5
 
6
6
  def setup
7
7
  goto_page 'map_test.html'
8
8
  end
9
-
9
+
10
10
  def test_01
11
11
  assert_contains_text "Test Page for Map Tests"
12
12
  end
13
-
13
+
14
14
  def test_map_exists_by_name
15
- assert($ie.map(:name, 'maptest01').exists?)
16
- assert ! ($ie.map(:name, 'maptest03').exists?)
15
+ assert(browser.map(:name, 'maptest01').exists?)
16
+ assert ! (browser.map(:name, 'maptest03').exists?)
17
17
  end
18
18
 
19
19
  def test_map_exists_by_id
20
- assert($ie.map(:id, 'maptestid01').exists?)
21
- assert ! ($ie.map(:id, 'maptestid03').exists?)
20
+ assert(browser.map(:id, 'maptestid01').exists?)
21
+ assert ! (browser.map(:id, 'maptestid03').exists?)
22
22
  end
23
-
23
+
24
24
  def test_map_area_exists_by_href
25
- assert($ie.area(:url, /pass.html/).exists?)
26
- assert($ie.area(:url, /simple_table_buttons.html/).exists?)
27
- assert($ie.area(:url, /images1.html/).exists?)
28
- assert ! ($ie.area(:url, /blobs.html/).exists?)
29
- assert($ie.map(:name, 'maptest01').area(:url, /pass.html/).exists?)
30
- assert($ie.map(:id, 'maptestid01').area(:url, /images1.html/).exists?)
25
+ assert(browser.area(:url, /pass.html/).exists?)
26
+ assert(browser.area(:url, /simple_table_buttons.html/).exists?)
27
+ assert(browser.area(:url, /images1.html/).exists?)
28
+ assert ! (browser.area(:url, /blobs.html/).exists?)
29
+ assert(browser.map(:name, 'maptest01').area(:url, /pass.html/).exists?)
30
+ assert(browser.map(:id, 'maptestid01').area(:url, /images1.html/).exists?)
31
31
  end
32
32
 
33
33
  def test_map_area_exists_by_alt
34
- assert($ie.area(:alt, 'Pass').exists?)
35
- assert($ie.area(:alt, 'Table Buttons').exists?)
36
- assert($ie.area(:alt, 'Images').exists?)
37
- assert ! ($ie.area(:alt, 'Blobs').exists?)
38
- assert($ie.map(:name, 'maptest01').area(:alt, 'Pass').exists?)
39
- assert($ie.map(:id, 'maptestid01').area(:alt, 'Table Buttons').exists?)
34
+ assert(browser.area(:alt, 'Pass').exists?)
35
+ assert(browser.area(:alt, 'Table Buttons').exists?)
36
+ assert(browser.area(:alt, 'Images').exists?)
37
+ assert ! (browser.area(:alt, 'Blobs').exists?)
38
+ assert(browser.map(:name, 'maptest01').area(:alt, 'Pass').exists?)
39
+ assert(browser.map(:id, 'maptestid01').area(:alt, 'Table Buttons').exists?)
40
40
  end
41
-
41
+
42
42
  def test_map_area_click
43
- $ie.area(:alt, 'Table Buttons').click
44
- assert_contains_text "This table has 3 images"
45
- $ie.back
46
- assert_contains_text "Test Page for Map Tests"
47
- $ie.area(:alt, 'Pass').click
48
- assert_contains_text "PASS"
49
- $ie.back
50
- assert_contains_text "Test Page for Map Tests"
51
- $ie.area(:alt, 'Images').click
52
- assert_contains_text "The triangle only has"
53
- $ie.back
54
- assert_contains_text "Test Page for Map Tests"
55
- $ie.area(:url, /simple_table_buttons.html/).click
56
- assert_contains_text "This table has 3 images"
57
- $ie.back
58
- assert_contains_text "Test Page for Map Tests"
59
- $ie.area(:url, /pass.html/).click
60
- assert_contains_text "PASS"
61
- $ie.back
62
- assert_contains_text "Test Page for Map Tests"
63
- $ie.area(:url, /images1.html/).click
64
- assert_contains_text "The triangle only has"
65
- $ie.back
66
- assert_contains_text "Test Page for Map Tests"
67
- $ie.map(:name, 'maptest01').area(:alt, 'Table Buttons').click
68
- assert_contains_text "This table has 3 images"
69
- $ie.back
70
- assert_contains_text "Test Page for Map Tests"
71
- $ie.map(:id, 'maptestid01').area(:alt, 'Pass').click
72
- assert_contains_text "PASS"
73
- $ie.back
74
- assert_contains_text "Test Page for Map Tests"
75
- $ie.map(:name, 'maptest01').area(:url, /pass.html/).click
76
- assert_contains_text "PASS"
77
- $ie.back
78
- assert_contains_text "Test Page for Map Tests"
79
- $ie.map(:id, 'maptestid01').area(:url, /images1.html/).click
80
- assert_contains_text "The triangle only has"
81
- $ie.back
82
- assert_contains_text "Test Page for Map Tests"
43
+ browser.area(:alt, 'Table Buttons').click
44
+ assert_contains_text "This table has 3 images"
45
+ browser.back
46
+ assert_contains_text "Test Page for Map Tests"
47
+ browser.area(:alt, 'Pass').click
48
+ assert_contains_text "PASS"
49
+ browser.back
50
+ assert_contains_text "Test Page for Map Tests"
51
+ browser.area(:alt, 'Images').click
52
+ assert_contains_text "The triangle only has"
53
+ browser.back
54
+ assert_contains_text "Test Page for Map Tests"
55
+ browser.area(:url, /simple_table_buttons.html/).click
56
+ assert_contains_text "This table has 3 images"
57
+ browser.back
58
+ assert_contains_text "Test Page for Map Tests"
59
+ browser.area(:url, /pass.html/).click
60
+ assert_contains_text "PASS"
61
+ browser.back
62
+ assert_contains_text "Test Page for Map Tests"
63
+ browser.area(:url, /images1.html/).click
64
+ assert_contains_text "The triangle only has"
65
+ browser.back
66
+ assert_contains_text "Test Page for Map Tests"
67
+ browser.map(:name, 'maptest01').area(:alt, 'Table Buttons').click
68
+ assert_contains_text "This table has 3 images"
69
+ browser.back
70
+ assert_contains_text "Test Page for Map Tests"
71
+ browser.map(:id, 'maptestid01').area(:alt, 'Pass').click
72
+ assert_contains_text "PASS"
73
+ browser.back
74
+ assert_contains_text "Test Page for Map Tests"
75
+ browser.map(:name, 'maptest01').area(:url, /pass.html/).click
76
+ assert_contains_text "PASS"
77
+ browser.back
78
+ assert_contains_text "Test Page for Map Tests"
79
+ browser.map(:id, 'maptestid01').area(:url, /images1.html/).click
80
+ assert_contains_text "The triangle only has"
81
+ browser.back
82
+ assert_contains_text "Test Page for Map Tests"
83
83
  end
84
84
 
85
85
  def test_maps
86
- assert_equal(2, $ie.maps.length)
86
+ assert_equal(2, browser.maps.length)
87
87
  end
88
88
 
89
89
  def test_areas
90
- assert_equal(3, $ie.map(:index, 2).areas.length)
90
+ assert_equal(3, browser.map(:index, 2).areas.length)
91
91
  end
92
92
 
93
93
  def assert_contains_text text
94
- assert($ie.contains_text(text))
94
+ assert(browser.contains_text(text))
95
95
  end
96
96
 
97
97
  end # class Map_Tests
@@ -1,29 +1,30 @@
1
1
  # feature tests for minimizing and maximizing IE windows
2
- # revision: $Revision: 1348 $
2
+ # revision: $Revision: 1431 $
3
3
 
4
- $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__
4
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
5
5
  require 'unittests/setup'
6
6
 
7
7
  class TC_MinMax< Test::Unit::TestCase
8
+ tags :must_be_visible
8
9
  def setup
9
10
  goto_page 'pass.html'
10
11
  end
11
12
  def teardown
12
- $ie.restore
13
+ browser.restore
13
14
  end
14
15
  def test_minimimum
15
- $ie.minimize
16
+ browser.minimize
16
17
  end
17
18
  def test_maximum
18
- $ie.maximize
19
+ browser.maximize
19
20
  end
20
21
  def test_front
21
- assert $ie.front?
22
+ assert browser.front?
22
23
  ie2 = Watir::IE.start($htmlRoot + 'blankpage.html')
23
24
  assert ie2.front?
24
- assert ! $ie.front?
25
- $ie.bring_to_front
26
- assert $ie.front?
25
+ assert ! browser.front?
26
+ browser.bring_to_front
27
+ assert browser.front?
27
28
  ie2.close
28
29
  end
29
30
  end
@@ -1,42 +1,38 @@
1
1
  # feature tests for navigation
2
- # revision: $Revision: 1348 $
2
+ # revision: $Revision: 1470 $
3
3
 
4
- $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__
4
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
5
5
  require 'unittests/setup'
6
6
  require 'cgi'
7
7
 
8
8
  class TC_Navigate < Test::Unit::TestCase
9
-
9
+ tags :fails_on_firefox
10
10
  def test_navigation
11
- $ie.clear_url_list
11
+ browser.clear_url_list
12
12
  goto_page 'buttons1.html'
13
- url = $ie.url.downcase
14
- url = CGI::unescape url
15
- assert_equal(($htmlRoot + 'buttons1.html').downcase, url) # sometimes we get capital drive letters
13
+ assert_equal(($htmlRoot + 'buttons1.html').gsub(" ","%20").downcase, browser.url.downcase)
16
14
 
17
- assert_equal(1, $ie.url_list.length)
18
- assert_equal(url, $ie.url_list[0].downcase)
15
+ assert_equal(1, browser.url_list.length)
16
+ assert_equal(browser.url, browser.url_list[0])
19
17
 
20
18
  goto_page 'checkboxes1.html'
21
- url = $ie.url.downcase
22
- url = CGI::unescape url
23
- assert_equal("Test page for Check Boxes", $ie.title)
19
+ assert_equal("Test page for Check Boxes", browser.title)
24
20
 
25
- assert_equal(2, $ie.url_list.length)
26
- assert_equal(url, $ie.url_list[1].downcase)
21
+ assert_equal(2, browser.url_list.length)
22
+ assert_equal(browser.url, browser.url_list[1])
27
23
 
28
- $ie.clear_url_list
29
- assert_equal(0, $ie.url_list.length )
24
+ browser.clear_url_list
25
+ assert_equal(0, browser.url_list.length )
30
26
 
31
- $ie.back
32
- assert_equal("Test page for buttons", $ie.title)
27
+ browser.back
28
+ assert_equal("Test page for buttons", browser.title)
33
29
 
34
- $ie.forward
35
- assert_equal("Test page for Check Boxes", $ie.title)
36
- $ie.checkbox(:name, "box1").set
37
- assert($ie.checkbox(:name, "box1").isSet?)
30
+ browser.forward
31
+ assert_equal("Test page for Check Boxes", browser.title)
32
+ browser.checkbox(:name, "box1").set
33
+ assert(browser.checkbox(:name, "box1").isSet?)
38
34
 
39
- $ie.refresh
35
+ browser.refresh
40
36
  # Not sure how we test this. Text fields and checkboxes dont get reset if you click the browser refresh button
41
37
  # -- this could be tested with the add-row page.
42
38
  end
@@ -1,7 +1,7 @@
1
1
  # feature tests for Tables
2
2
  # revision: $Revision: 1076 $
3
3
 
4
- $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__
4
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
5
5
  require 'unittests/setup'
6
6
 
7
7
  class TC_Nbsp_Xpath < Test::Unit::TestCase
@@ -11,7 +11,7 @@ class TC_Nbsp_Xpath < Test::Unit::TestCase
11
11
  end
12
12
 
13
13
  def test_nbsp
14
- div = $ie.element_by_xpath("//div")
14
+ div = browser.element_by_xpath("//div")
15
15
  assert(div.innerText, "Hello world")
16
16
  end
17
17
  end
@@ -4,6 +4,9 @@ $LOAD_PATH.unshift TOPDIR
4
4
  require 'unittests/setup.rb'
5
5
 
6
6
  Dir.chdir TOPDIR
7
- $non_core_tests.each {|x| require x}
8
-
7
+ $all_tests.each {|x| require x}
9
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,4 +1,4 @@
1
- $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__
1
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
2
2
  require 'unittests/setup'
3
3
  require 'watir/WindowHelper'
4
4
 
@@ -6,7 +6,7 @@ class TC_Logon_Test < Test::Unit::TestCase
6
6
  include Watir
7
7
 
8
8
  def goto_windows_login_page
9
- $ie.goto('http://clio.lyris.com/')
9
+ browser.goto('http://clio.lyris.com/')
10
10
  end
11
11
 
12
12
 
@@ -1,4 +1,4 @@
1
- $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__
1
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
2
2
 
3
3
  require 'watir/WindowHelper'
4
4
 
@@ -1,14 +1,25 @@
1
1
  # feature tests for navigation errors
2
2
  # revision: $Revision: 958 $
3
3
 
4
- $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__
4
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..') unless $SETUP_LOADED
5
5
  require 'unittests/setup'
6
+ require 'watir/contrib/page_checker'
7
+ # To add checkers, call the ie.add_checker method
8
+ #
9
+ # ie.
6
10
 
7
11
  class TC_NavigateException < Test::Unit::TestCase
8
12
  include Watir
9
13
 
14
+ def setup
15
+ browser.add_checker(PageCheckers::NAVIGATION_CHECKER)
16
+ end
17
+ def teardown
18
+ browser.disable_checker(PageCheckers::NAVIGATION_CHECKER)
19
+ end
20
+
10
21
  def test_http_errors
11
- assert_raises(NavigationException) { $ie.goto('http://localhost:3001') } # Cannot find server or DNS Error
12
- assert_raises(NavigationException) { $ie.goto('http://www.fxruby.org/dfdf' ) } # HTTP 404 - File not found
22
+ assert_raises(NavigationException) { browser.goto('http://localhost:3001') } # Cannot find server or DNS Error
23
+ assert_raises(NavigationException) { browser.goto('http://www.fxruby.org/dfdf' ) } # HTTP 404 - File not found
13
24
  end
14
25
  end
@@ -1,17 +1,18 @@
1
1
  # feature tests for screen capture
2
2
  # revision: $Revision:1338 $
3
3
 
4
- $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__
4
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
5
5
  require 'unittests/setup'
6
6
  require 'watir/screen_capture'
7
7
 
8
8
  class TC_Capture< Test::Unit::TestCase
9
+ tags :must_be_visible
9
10
  include Watir
10
11
  include Watir::ScreenCapture
11
12
 
12
13
  def setup
13
14
  delete_captured_files( [ 'jpeg1.jpg' , 'jpeg2.jpg' , 'bmp1.bmp', 'bmp2.bmp' ] )
14
- $ie.goto($htmlRoot + 'buttons1.html' )
15
+ browser.goto($htmlRoot + 'buttons1.html' )
15
16
  @file_list = []
16
17
  end
17
18