watir 1.5.6 → 1.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/{changes.rb → CHANGES} +12 -3
- data/bin/watir-console +7 -1
- data/lib/changes.rb +3 -0
- data/{license.rb → lib/license.rb} +2 -1
- data/{readme.rb → lib/readme.rb} +4 -6
- data/{watir → lib/watir}/AutoItX3.dll +0 -0
- data/{watir → lib/watir}/IEDialog/Release/IEDialog.dll +0 -0
- data/{watir → lib/watir}/WindowHelper.rb +1 -1
- data/{watir → lib/watir}/camel_case.rb +0 -0
- data/{watir → lib/watir}/clickJSDialog.rb +0 -0
- data/{watir → lib/watir}/close_all.rb +1 -1
- data/{watir → lib/watir}/collections.rb +1 -1
- data/{watir → lib/watir}/container.rb +17 -8
- data/{watir → lib/watir}/contrib/enabled_popup.rb +0 -0
- data/{watir → lib/watir}/contrib/ie-new-process.rb +0 -0
- data/{watir → lib/watir}/contrib/page_checker.rb +0 -0
- data/{watir → lib/watir}/contrib/visible.rb +2 -2
- data/{watir → lib/watir}/cookiemanager.rb +0 -0
- data/{watir → lib/watir}/datahandler.rb +0 -0
- data/{watir → lib/watir}/dialog.rb +1 -1
- data/{watir → lib/watir}/element.rb +3 -7
- data/{watir → lib/watir}/element_collections.rb +0 -0
- data/{watir → lib/watir}/form.rb +31 -11
- data/{watir → lib/watir}/frame.rb +0 -0
- data/{watir/ie.rb → lib/watir/ie-class.rb} +22 -22
- data/{watir → lib/watir}/ie-process.rb +0 -0
- data/{watir.rb → lib/watir/ie.rb} +11 -27
- data/{watir → lib/watir}/image.rb +0 -0
- data/{watir → lib/watir}/input_elements.rb +33 -44
- data/{watir → lib/watir}/irb-history.rb +0 -0
- data/{watir → lib/watir}/link.rb +0 -0
- data/{watir → lib/watir}/locator.rb +56 -43
- data/{watir → lib/watir}/logger.rb +0 -0
- data/{watir → lib/watir}/modal_dialog.rb +0 -0
- data/{watir → lib/watir}/non_control_elements.rb +0 -0
- data/{watir → lib/watir}/page-container.rb +2 -2
- data/{watir → lib/watir}/popup.rb +0 -0
- data/{watir → lib/watir}/process.rb +0 -0
- data/{watir → lib/watir}/screen_capture.rb +0 -0
- data/{watir → lib/watir}/setFileDialog.rb +0 -0
- data/{watir → lib/watir}/table.rb +7 -2
- data/{watir → lib/watir}/utils.rb +0 -0
- data/lib/watir/version.rb +5 -0
- data/{watir → lib/watir}/watir_simple.rb +3 -3
- data/{watir → lib/watir}/win32.rb +0 -0
- data/lib/watir/win32ole.rb +6 -0
- data/lib/watir/win32ole/win32ole.so +0 -0
- data/{watir → lib/watir}/winClicker.rb +0 -0
- data/unittests/buttons_xpath_test.rb +32 -32
- data/unittests/checkbox_test.rb +113 -99
- data/unittests/checkbox_xpath_test.rb +57 -57
- data/unittests/core_tests.rb +10 -7
- data/unittests/css_test.rb +12 -32
- data/unittests/defer_test.rb +22 -22
- data/unittests/dialog_test.rb +13 -13
- data/unittests/div2_xpath_test.rb +3 -3
- data/unittests/div_test.rb +23 -19
- data/unittests/div_xpath_test.rb +50 -50
- data/unittests/errorchecker_test.rb +7 -9
- data/unittests/filefield_test.rb +12 -11
- data/unittests/filefield_xpath_test.rb +10 -10
- data/unittests/form_test.rb +144 -151
- data/unittests/form_xpath_test.rb +99 -99
- data/unittests/frame_test.rb +46 -44
- data/unittests/google_form_test.rb +2 -2
- data/unittests/html/checkboxes1.html +19 -16
- data/unittests/html/forms3.html +2 -2
- data/unittests/html/wallofcheckboxes.html +1003 -0
- data/unittests/ie_exists_test.rb +5 -3
- data/unittests/ie_test.rb +2 -2
- data/unittests/images_test.rb +83 -82
- data/unittests/images_xpath_test.rb +40 -40
- data/unittests/iostring_test.rb +1 -1
- data/unittests/links_multi_test.rb +7 -8
- data/unittests/links_test.rb +73 -71
- data/unittests/links_xpath_test.rb +15 -15
- data/unittests/lists_test.rb +10 -10
- data/unittests/map_test.rb +65 -65
- data/unittests/minmax_test.rb +10 -9
- data/unittests/navigate_test.rb +19 -23
- data/unittests/nbsp_xpath_test.rb +2 -2
- data/unittests/non_core_tests.rb +5 -2
- data/unittests/other/WindowLogonExample.rb +2 -2
- data/unittests/other/WindowLogonExtra.rb +1 -1
- data/unittests/other/navigate_exception_test.rb +14 -3
- data/unittests/other/screen_capture_test.rb +3 -2
- data/unittests/other/testcase_method_order_test.rb +1 -1
- data/unittests/pagecontainstext_test.rb +17 -14
- data/unittests/parent_child_test.rb +11 -7
- data/unittests/perf_test.rb +20 -0
- data/unittests/popups_test.rb +13 -14
- data/unittests/pre_test.rb +30 -28
- data/unittests/radios_test.rb +128 -107
- data/unittests/radios_xpath_test.rb +47 -47
- data/unittests/security_setting_test.rb +24 -0
- data/unittests/selectbox_test.rb +65 -157
- data/unittests/selectbox_xpath_test.rb +51 -51
- data/unittests/setup.rb +52 -48
- data/unittests/speed_settings_test.rb +31 -20
- data/unittests/table_cell_using_xpath_test.rb +12 -12
- data/unittests/table_test.rb +30 -16
- data/unittests/table_xpath_test.rb +25 -25
- data/unittests/test_tests.rb +9 -0
- data/unittests/textarea_test.rb +33 -33
- data/unittests/textarea_xpath_test.rb +37 -37
- data/unittests/textfield_for_ch_char_test.rb +9 -9
- data/unittests/textfields_test.rb +103 -98
- data/unittests/textfields_xpath_test.rb +50 -50
- data/unittests/windows/attach_to_existing_window_test.rb +2 -2
- data/unittests/windows/attach_to_new_window_test.rb +10 -10
- data/unittests/windows/close_window_test.rb +2 -2
- data/unittests/windows/frame_links_test.rb +6 -6
- data/unittests/windows/ie-each_test.rb +1 -1
- data/unittests/windows/iedialog_test.rb +4 -5
- data/unittests/windows/js_events_test.rb +14 -14
- data/unittests/windows/jscriptExtraAlert.rb +2 -1
- data/unittests/windows/jscriptExtraConfirmCancel.rb +1 -1
- data/unittests/windows/jscriptExtraConfirmOk.rb +1 -1
- data/unittests/windows/jscriptPushButton.rb +2 -1
- data/unittests/windows/jscript_test.rb +7 -7
- data/unittests/windows/modal_dialog_test.rb +28 -29
- data/unittests/windows/{new.rb → new_test.rb} +1 -1
- data/unittests/windows/open_close_test.rb +4 -7
- data/unittests/windows/send_keys_test.rb +11 -11
- data/unittests/xpath_tests.rb +4 -3
- metadata +82 -58
- data/unittests/buttons_test.rb +0 -107
- data/watir/assertions.rb +0 -44
- data/watir/exceptions.rb +0 -42
- data/watir/testcase.rb +0 -58
- data/watir/waiter.rb +0 -88
- data/watir/win32ole.rb +0 -8
- data/watir/win32ole/win32ole.so +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
# feature tests for Links
|
2
|
-
# revision: $Revision:
|
2
|
+
# revision: $Revision: 1544 $
|
3
3
|
|
4
|
-
$LOAD_PATH.unshift File.join(File.dirname(__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(
|
15
|
-
assert(
|
16
|
-
|
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
|
-
|
18
|
+
assert_false(browser.link(:xpath, "//a[@url='alsomissing.html']/").exists?)
|
19
19
|
|
20
|
-
assert(
|
21
|
-
|
20
|
+
assert(browser.link(:xpath, "//a[@id='link_id']/").exists?)
|
21
|
+
assert_false(browser.link(:xpath, "//a[@id='alsomissing']/").exists?)
|
22
22
|
|
23
|
-
assert(
|
24
|
-
|
25
|
-
assert(
|
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
|
-
|
30
|
-
assert(
|
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
|
-
|
35
|
-
assert(
|
34
|
+
browser.link(:xpath, "//a[text()='test1']").click
|
35
|
+
assert(browser.text.include?("Links2-Pass"))
|
36
36
|
end
|
37
37
|
|
38
38
|
end
|
data/unittests/lists_test.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
$LOAD_PATH.unshift File.join(File.dirname(__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(
|
12
|
-
assert(
|
13
|
-
assert(
|
14
|
-
assert(
|
15
|
-
assert_equal('Coffee',
|
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(
|
20
|
-
assert ! (
|
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,
|
24
|
+
assert_equal(6, browser.lis.length)
|
25
25
|
end
|
26
26
|
|
27
27
|
def test_multiple_attributes
|
28
|
-
assert_equal('Phil',
|
28
|
+
assert_equal('Phil', browser.li(:id => 'ordered1', :name => 'x1').text)
|
29
29
|
end
|
30
30
|
|
31
31
|
end
|
data/unittests/map_test.rb
CHANGED
@@ -1,97 +1,97 @@
|
|
1
|
-
$LOAD_PATH.unshift File.join(File.dirname(__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(
|
16
|
-
assert ! (
|
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(
|
21
|
-
assert ! (
|
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(
|
26
|
-
assert(
|
27
|
-
assert(
|
28
|
-
assert ! (
|
29
|
-
assert(
|
30
|
-
assert(
|
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(
|
35
|
-
assert(
|
36
|
-
assert(
|
37
|
-
assert ! (
|
38
|
-
assert(
|
39
|
-
assert(
|
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
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
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,
|
86
|
+
assert_equal(2, browser.maps.length)
|
87
87
|
end
|
88
88
|
|
89
89
|
def test_areas
|
90
|
-
assert_equal(3,
|
90
|
+
assert_equal(3, browser.map(:index, 2).areas.length)
|
91
91
|
end
|
92
92
|
|
93
93
|
def assert_contains_text text
|
94
|
-
assert(
|
94
|
+
assert(browser.contains_text(text))
|
95
95
|
end
|
96
96
|
|
97
97
|
end # class Map_Tests
|
data/unittests/minmax_test.rb
CHANGED
@@ -1,29 +1,30 @@
|
|
1
1
|
# feature tests for minimizing and maximizing IE windows
|
2
|
-
# revision: $Revision:
|
2
|
+
# revision: $Revision: 1431 $
|
3
3
|
|
4
|
-
$LOAD_PATH.unshift File.join(File.dirname(__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
|
-
|
13
|
+
browser.restore
|
13
14
|
end
|
14
15
|
def test_minimimum
|
15
|
-
|
16
|
+
browser.minimize
|
16
17
|
end
|
17
18
|
def test_maximum
|
18
|
-
|
19
|
+
browser.maximize
|
19
20
|
end
|
20
21
|
def test_front
|
21
|
-
assert
|
22
|
+
assert browser.front?
|
22
23
|
ie2 = Watir::IE.start($htmlRoot + 'blankpage.html')
|
23
24
|
assert ie2.front?
|
24
|
-
assert !
|
25
|
-
|
26
|
-
assert
|
25
|
+
assert ! browser.front?
|
26
|
+
browser.bring_to_front
|
27
|
+
assert browser.front?
|
27
28
|
ie2.close
|
28
29
|
end
|
29
30
|
end
|
data/unittests/navigate_test.rb
CHANGED
@@ -1,42 +1,38 @@
|
|
1
1
|
# feature tests for navigation
|
2
|
-
# revision: $Revision:
|
2
|
+
# revision: $Revision: 1470 $
|
3
3
|
|
4
|
-
$LOAD_PATH.unshift File.join(File.dirname(__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
|
-
|
11
|
+
browser.clear_url_list
|
12
12
|
goto_page 'buttons1.html'
|
13
|
-
|
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,
|
18
|
-
assert_equal(url,
|
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
|
-
|
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,
|
26
|
-
assert_equal(url,
|
21
|
+
assert_equal(2, browser.url_list.length)
|
22
|
+
assert_equal(browser.url, browser.url_list[1])
|
27
23
|
|
28
|
-
|
29
|
-
assert_equal(0,
|
24
|
+
browser.clear_url_list
|
25
|
+
assert_equal(0, browser.url_list.length )
|
30
26
|
|
31
|
-
|
32
|
-
assert_equal("Test page for buttons",
|
27
|
+
browser.back
|
28
|
+
assert_equal("Test page for buttons", browser.title)
|
33
29
|
|
34
|
-
|
35
|
-
assert_equal("Test page for Check Boxes",
|
36
|
-
|
37
|
-
assert(
|
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
|
-
|
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__), '..')
|
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 =
|
14
|
+
div = browser.element_by_xpath("//div")
|
15
15
|
assert(div.innerText, "Hello world")
|
16
16
|
end
|
17
17
|
end
|
data/unittests/non_core_tests.rb
CHANGED
@@ -4,6 +4,9 @@ $LOAD_PATH.unshift TOPDIR
|
|
4
4
|
require 'unittests/setup.rb'
|
5
5
|
|
6
6
|
Dir.chdir TOPDIR
|
7
|
-
$
|
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__), '..')
|
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
|
-
|
9
|
+
browser.goto('http://clio.lyris.com/')
|
10
10
|
end
|
11
11
|
|
12
12
|
|
@@ -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__), '..')
|
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) {
|
12
|
-
assert_raises(NavigationException) {
|
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__), '..')
|
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
|
-
|
15
|
+
browser.goto($htmlRoot + 'buttons1.html' )
|
15
16
|
@file_list = []
|
16
17
|
end
|
17
18
|
|