watir-classic 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +721 -0
- data/LICENSE +34 -0
- data/README.rdoc +78 -0
- data/VERSION +1 -0
- data/bin/watir-console +5 -0
- data/lib/watir-classic.rb +14 -0
- data/lib/watir-classic/IEDialog/Release/IEDialog.dll +0 -0
- data/lib/watir-classic/assertions.rb +44 -0
- data/lib/watir-classic/browser.rb +149 -0
- data/lib/watir-classic/browsers.rb +7 -0
- data/lib/watir-classic/close_all.rb +31 -0
- data/lib/watir-classic/container.rb +110 -0
- data/lib/watir-classic/contrib/enabled_popup.rb +21 -0
- data/lib/watir-classic/contrib/ie-new-process.rb +27 -0
- data/lib/watir-classic/contrib/page_checker.rb +29 -0
- data/lib/watir-classic/cookies.rb +80 -0
- data/lib/watir-classic/core.rb +43 -0
- data/lib/watir-classic/dialogs/file_field.rb +34 -0
- data/lib/watir-classic/dialogs/javascript.rb +43 -0
- data/lib/watir-classic/drag_and_drop_helper.rb +68 -0
- data/lib/watir-classic/element.rb +438 -0
- data/lib/watir-classic/element_collection.rb +109 -0
- data/lib/watir-classic/element_extensions.rb +69 -0
- data/lib/watir-classic/exceptions.rb +50 -0
- data/lib/watir-classic/form.rb +96 -0
- data/lib/watir-classic/frame.rb +47 -0
- data/lib/watir-classic/ie-class.rb +767 -0
- data/lib/watir-classic/ie-process.rb +47 -0
- data/lib/watir-classic/ie.rb +20 -0
- data/lib/watir-classic/image.rb +111 -0
- data/lib/watir-classic/input_elements.rb +480 -0
- data/lib/watir-classic/irb-history.rb +31 -0
- data/lib/watir-classic/link.rb +46 -0
- data/lib/watir-classic/locator.rb +243 -0
- data/lib/watir-classic/logger.rb +19 -0
- data/lib/watir-classic/matches.rb +23 -0
- data/lib/watir-classic/modal_dialog.rb +72 -0
- data/lib/watir-classic/module.rb +12 -0
- data/lib/watir-classic/non_control_elements.rb +114 -0
- data/lib/watir-classic/options.rb +56 -0
- data/lib/watir-classic/page-container.rb +114 -0
- data/lib/watir-classic/process.rb +20 -0
- data/lib/watir-classic/screen_capture.rb +115 -0
- data/lib/watir-classic/supported_elements.rb +172 -0
- data/lib/watir-classic/table.rb +224 -0
- data/lib/watir-classic/testcase.rb +97 -0
- data/lib/watir-classic/util.rb +35 -0
- data/lib/watir-classic/version.rb +4 -0
- data/lib/watir-classic/wait.rb +41 -0
- data/lib/watir-classic/wait_helper.rb +12 -0
- data/lib/watir-classic/waiter.rb +98 -0
- data/lib/watir-classic/win32.rb +40 -0
- data/lib/watir-classic/win32ole.rb +16 -0
- data/lib/watir-classic/win32ole/1.8.7/win32ole.so +0 -0
- data/lib/watir-classic/win32ole/1.9.3/win32ole.so +0 -0
- data/lib/watir-classic/window.rb +68 -0
- data/lib/watir-classic/xpath_locator.rb +52 -0
- data/rakefile.rb +54 -0
- data/unittests/all_tests.rb +10 -0
- data/unittests/buttons_xpath_test.rb +68 -0
- data/unittests/checkbox_test.rb +163 -0
- data/unittests/checkbox_xpath_test.rb +106 -0
- data/unittests/click_no_wait_test.rb +23 -0
- data/unittests/close_all_test.rb +17 -0
- data/unittests/core_tests.rb +17 -0
- data/unittests/css_selector_test.rb +44 -0
- data/unittests/css_test.rb +38 -0
- data/unittests/dialog_test.rb +64 -0
- data/unittests/div2_xpath_test.rb +21 -0
- data/unittests/div_test.rb +170 -0
- data/unittests/div_xpath_test.rb +95 -0
- data/unittests/document_standards.rb +63 -0
- data/unittests/element_collection_indexes_test.rb +57 -0
- data/unittests/element_collections_test.rb +100 -0
- data/unittests/element_test.rb +47 -0
- data/unittests/errorchecker_test.rb +31 -0
- data/unittests/filefield_test.rb +43 -0
- data/unittests/filefield_xpath_test.rb +35 -0
- data/unittests/form_test.rb +282 -0
- data/unittests/form_xpath_test.rb +254 -0
- data/unittests/frame_test.rb +165 -0
- data/unittests/google_form_test.rb +15 -0
- data/unittests/html/JavascriptClick.html +39 -0
- data/unittests/html/blankpage.html +11 -0
- data/unittests/html/buttons1.html +40 -0
- data/unittests/html/checkboxes1.html +89 -0
- data/unittests/html/click_no_wait.html +14 -0
- data/unittests/html/complex_table.html +35 -0
- data/unittests/html/cssTest.html +42 -0
- data/unittests/html/depot_store.html +59 -0
- data/unittests/html/div.html +92 -0
- data/unittests/html/div_xml.html +21 -0
- data/unittests/html/fileupload.html +44 -0
- data/unittests/html/formTest1.html +38 -0
- data/unittests/html/forms2.html +44 -0
- data/unittests/html/forms3.html +131 -0
- data/unittests/html/forms4.html +26 -0
- data/unittests/html/frame_buttons.html +4 -0
- data/unittests/html/frame_links.html +4 -0
- data/unittests/html/frame_multi.html +5 -0
- data/unittests/html/google_india.html +119 -0
- data/unittests/html/ie7_document_standards.html +9 -0
- data/unittests/html/ie8_document_standards.html +9 -0
- data/unittests/html/ie9_document_standards.html +9 -0
- data/unittests/html/iframe.html +3 -0
- data/unittests/html/iframeTest.html +17 -0
- data/unittests/html/iframeTest1.html +7 -0
- data/unittests/html/iframeTest2.html +5 -0
- 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 +65 -0
- data/unittests/html/javascriptevents.html +33 -0
- data/unittests/html/link_pass.html +11 -0
- data/unittests/html/links1.html +37 -0
- data/unittests/html/links2.html +11 -0
- data/unittests/html/links_multi.html +12 -0
- data/unittests/html/list_matters.html +720 -0
- data/unittests/html/lists.html +18 -0
- data/unittests/html/map_test.html +30 -0
- data/unittests/html/modal_dialog.html +10 -0
- data/unittests/html/modal_dialog_launcher.html +12 -0
- data/unittests/html/multiple_specifiers.html +64 -0
- data/unittests/html/nestedFrames.html +6 -0
- data/unittests/html/new_browser.html +17 -0
- data/unittests/html/pass.html +13 -0
- data/unittests/html/popups1.html +59 -0
- data/unittests/html/pre.html +29 -0
- data/unittests/html/quirks_document_standards.html +8 -0
- data/unittests/html/radioButtons1.html +71 -0
- data/unittests/html/select_tealeaf.html +54 -0
- data/unittests/html/selectboxes1.html +52 -0
- data/unittests/html/simple_table.html +25 -0
- data/unittests/html/simple_table_buttons.html +104 -0
- data/unittests/html/simple_table_columns.html +75 -0
- data/unittests/html/table1.html +179 -0
- data/unittests/html/tableCell_using_xpath.html +19 -0
- data/unittests/html/table_and_tablerow_to_a.html +174 -0
- data/unittests/html/textarea.html +30 -0
- data/unittests/html/textfields1.html +100 -0
- data/unittests/html/textsearch.html +44 -0
- data/unittests/html/wallofcheckboxes.html +1003 -0
- data/unittests/html/xpath_nbsp.html +11 -0
- data/unittests/html/zeroindex.html +11 -0
- data/unittests/ie_exists_test.rb +16 -0
- data/unittests/ie_mock.rb +94 -0
- data/unittests/ie_test.rb +54 -0
- data/unittests/images_test.rb +156 -0
- data/unittests/images_xpath_test.rb +90 -0
- data/unittests/index_specifier_test.rb +31 -0
- data/unittests/js_events_test.rb +31 -0
- data/unittests/links_multi_test.rb +34 -0
- data/unittests/links_test.rb +131 -0
- data/unittests/links_xpath_test.rb +38 -0
- data/unittests/lists_test.rb +23 -0
- data/unittests/map_test.rb +98 -0
- data/unittests/minmax_test.rb +37 -0
- data/unittests/navigate_test.rb +38 -0
- data/unittests/nbsp_xpath_test.rb +16 -0
- data/unittests/no_wait_test.rb +28 -0
- data/unittests/non_core_tests.rb +12 -0
- data/unittests/other/all_tests_concurrent.rb +57 -0
- data/unittests/other/navigate_exception_test.rb +24 -0
- data/unittests/other/rexml_unit_test.rb +27 -0
- data/unittests/other/screen_capture_test.rb +53 -0
- data/unittests/other/testcase_method_order_test.rb +36 -0
- data/unittests/other/testcase_verify_test.rb +25 -0
- data/unittests/other/wait_until_test.rb +102 -0
- data/unittests/pagecontainstext_test.rb +69 -0
- data/unittests/parent_child_test.rb +27 -0
- data/unittests/perf_test.rb +20 -0
- data/unittests/pre_test.rb +49 -0
- data/unittests/radios_test.rb +181 -0
- data/unittests/radios_xpath_test.rb +100 -0
- data/unittests/security_setting_test.rb +24 -0
- data/unittests/selectbox_test.rb +144 -0
- data/unittests/selectbox_xpath_test.rb +102 -0
- data/unittests/setup.rb +69 -0
- data/unittests/speed_settings_test.rb +67 -0
- data/unittests/table_cell_using_xpath_test.rb +34 -0
- data/unittests/table_test.rb +296 -0
- data/unittests/table_xpath_test.rb +109 -0
- data/unittests/test_tests.rb +9 -0
- data/unittests/textarea_test.rb +92 -0
- data/unittests/textarea_xpath_test.rb +77 -0
- data/unittests/textfield_for_ch_char_test.rb +32 -0
- data/unittests/textfields_test.rb +184 -0
- data/unittests/textfields_xpath_test.rb +110 -0
- data/unittests/version_test.rb +15 -0
- data/unittests/win32ole_so_test.rb +35 -0
- data/unittests/window_tests.rb +10 -0
- data/unittests/windows/attach_to_existing_window_test.rb +52 -0
- data/unittests/windows/attach_to_new_window_test.rb +74 -0
- data/unittests/windows/close_window_test.rb +20 -0
- data/unittests/windows/frame_links_test.rb +23 -0
- data/unittests/windows/ie-each_test.rb +46 -0
- data/unittests/windows/modal_dialog_test.rb +95 -0
- data/unittests/windows/new_process_test.rb +24 -0
- data/unittests/windows/new_test.rb +58 -0
- data/unittests/windows/open_close_test.rb +19 -0
- data/unittests/windows/send_keys_test.rb +26 -0
- data/unittests/xpath_tests.rb +11 -0
- data/watir-rdoc.rb +7 -0
- metadata +370 -0
@@ -0,0 +1,165 @@
|
|
1
|
+
# feature tests for Frames
|
2
|
+
|
3
|
+
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
|
4
|
+
require 'unittests/setup'
|
5
|
+
|
6
|
+
class TC_Frames < Test::Unit::TestCase
|
7
|
+
include Watir::Exception
|
8
|
+
|
9
|
+
def setup
|
10
|
+
goto_page "frame_buttons.html"
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_frame_no_what
|
14
|
+
assert_raises(UnknownFrameException) { browser.frame(:name => "missingFrame").html }
|
15
|
+
assert_raises(UnknownObjectException) { browser.frame(:name => "buttonFrame2").button(:id, "b2").enabled? }
|
16
|
+
assert(browser.frame(:name => "buttonFrame").button(:id, "b2").enabled?)
|
17
|
+
assert_false(browser.frame(:name => "buttonFrame").button(:caption, "Disabled Button").enabled?)
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_frame_using_name
|
21
|
+
assert_raises(UnknownFrameException) { browser.frame(:name, "missingFrame").html }
|
22
|
+
assert_raises(UnknownObjectException) { browser.frame(:name, "buttonFrame2").button(:id, "b2").enabled? }
|
23
|
+
assert(browser.frame(:name, "buttonFrame").button(:id, "b2").enabled?)
|
24
|
+
assert_false(browser.frame(:name, "buttonFrame").button(:caption, "Disabled Button").enabled?)
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_frame_using_name_and_regexp
|
28
|
+
assert_raises(UnknownFrameException) { browser.frame(:name, /missingFrame/).button(:id, "b2").enabled? }
|
29
|
+
assert(browser.frame(:name, /button/).button(:id, "b2").enabled?)
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_frame_using_index
|
33
|
+
assert_raises(UnknownFrameException) { browser.frame(:index, 7).button(:id, "b2").enabled? }
|
34
|
+
assert_raises(UnknownObjectException) { browser.frame(:index, 1).button(:id, "b2").enabled? }
|
35
|
+
assert(browser.frame(:index, 0 ).button(:id, "b2").enabled?)
|
36
|
+
assert_false(browser.frame(:index, 0).button(:caption, "Disabled Button").enabled?)
|
37
|
+
assert_equal('blankpage.html', browser.frame(:index, 1).src)
|
38
|
+
end
|
39
|
+
|
40
|
+
tag_method :test_frame_with_invalid_attribute, :fails_on_firefox
|
41
|
+
|
42
|
+
def test_frame_with_invalid_attribute
|
43
|
+
assert_raises(MissingWayOfFindingObjectException) { browser.frame(:blah, 'no_such_thing').button(:id, "b2").enabled? }
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_preset_frame
|
47
|
+
assert browser.frame(:name => "buttonFrame").button(:id, "b2").enabled?
|
48
|
+
assert !browser.frame(:name => "buttonFrame").button(:caption, "Disabled Button").enabled?
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
|
53
|
+
class TC_Frames2 < Test::Unit::TestCase
|
54
|
+
include Watir::Exception
|
55
|
+
|
56
|
+
def setup
|
57
|
+
goto_page "frame_multi.html"
|
58
|
+
end
|
59
|
+
|
60
|
+
def test_frame_with_no_name
|
61
|
+
assert_raises(UnknownFrameException) { browser.frame(:name, "missingFrame").button(:id, "b2").enabled? }
|
62
|
+
end
|
63
|
+
|
64
|
+
def test_frame_by_id
|
65
|
+
assert_raises(UnknownFrameException) { browser.frame(:id, "missingFrame").button(:id, "b2").enabled? }
|
66
|
+
assert(browser.frame(:id, 'first_frame').button(:id, "b2").enabled?)
|
67
|
+
end
|
68
|
+
|
69
|
+
def test_frame_by_src
|
70
|
+
assert(browser.frame(:src, /pass/).button(:value, 'Close Window').exists?)
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
74
|
+
|
75
|
+
class TC_NestedFrames < Test::Unit::TestCase
|
76
|
+
tags :fails_on_firefox
|
77
|
+
|
78
|
+
def setup
|
79
|
+
goto_page "nestedFrames.html"
|
80
|
+
end
|
81
|
+
|
82
|
+
def test_frame
|
83
|
+
assert_raises(UnknownFrameException) { browser.frame(:name => "missingFrame").button(:id, "b2").enabled? }
|
84
|
+
assert_raises(UnknownFrameException) { browser.frame(:name => "nestedFrame").frame(:name => "subFrame").button(:id, "b2").enabled? }
|
85
|
+
assert(browser.frame(:name => "nestedFrame").frame(:name => "senderFrame").button(:name, "sendIt").enabled?)
|
86
|
+
browser.frame(:name => "nestedFrame").frame(:name => "senderFrame").text_field(:index, "0").set("Hello")
|
87
|
+
browser.frame(:name => "nestedFrame").frame(:name => "senderFrame").button(:name, "sendIt").click
|
88
|
+
assert(browser.frame(:name => "nestedFrame").frame(:name => "receiverFrame").text_field(:name, "receiverText").verify_contains("Hello"))
|
89
|
+
end
|
90
|
+
|
91
|
+
end
|
92
|
+
|
93
|
+
class TC_IFrames < Test::Unit::TestCase
|
94
|
+
tags :fails_on_firefox
|
95
|
+
|
96
|
+
def setup
|
97
|
+
goto_page "iframeTest.html"
|
98
|
+
end
|
99
|
+
|
100
|
+
def test_Iframe
|
101
|
+
browser.frame(:name => "senderFrame").text_field(:name, "textToSend").set( "Hello World")
|
102
|
+
browser.frame(:name => "senderFrame").button(:index, 0).click
|
103
|
+
assert( browser.frame(:name => "receiverFrame").text_field(:name, "receiverText").verify_contains("Hello World") )
|
104
|
+
assert_equal(browser.frame(:src, /iframeTest2/).text_field(:name, 'receiverText').value, "Hello World")
|
105
|
+
end
|
106
|
+
|
107
|
+
def test_iframes_id
|
108
|
+
browser.frame(:id, "sf").text_field(:name, "textToSend").set( "Hello World")
|
109
|
+
browser.frame(:id, "sf").button(:name, 'sendIt').click
|
110
|
+
assert( browser.frame(:name => "receiverFrame").text_field(:name, "receiverText").verify_contains("Hello World") )
|
111
|
+
end
|
112
|
+
|
113
|
+
end
|
114
|
+
|
115
|
+
class TC_Frames_click_no_wait < Test::Unit::TestCase
|
116
|
+
def setup
|
117
|
+
goto_page "frame_buttons.html"
|
118
|
+
end
|
119
|
+
|
120
|
+
def test_frame_click_no_wait
|
121
|
+
frame = browser.frame(:name => "buttonFrame")
|
122
|
+
assert !frame.text.include?("PASS")
|
123
|
+
frame.button(:id => "b2").click_no_wait
|
124
|
+
assert_nothing_raised {
|
125
|
+
Watir::Wait.until {frame.text.include?("PASS")}
|
126
|
+
}
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
class TC_Frame_multiple_attributes < Test::Unit::TestCase
|
131
|
+
def setup
|
132
|
+
goto_page "frame_multi.html"
|
133
|
+
end
|
134
|
+
|
135
|
+
def test_get_frame_by_name_and_src
|
136
|
+
assert_equal('blankpage.html', browser.frame(:src => 'blankpage.html', :name => 'buttonFrame2').src)
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
class TC_frames_method_for_container < Test::Unit::TestCase
|
141
|
+
def setup
|
142
|
+
goto_page "frame_multi.html"
|
143
|
+
end
|
144
|
+
|
145
|
+
def test_frames_collection
|
146
|
+
frames = browser.frames
|
147
|
+
assert_equal(3, frames.length)
|
148
|
+
assert_equal('first_frame', frames[0].id)
|
149
|
+
assert_equal('pass.html', frames[2].src)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
class TC_iframe_access < Test::Unit::TestCase
|
154
|
+
def setup
|
155
|
+
goto_page "iframe.html"
|
156
|
+
end
|
157
|
+
|
158
|
+
def test_frame_without_access_should_still_show_properties
|
159
|
+
frame = browser.frame(:name, 'iframe')
|
160
|
+
assert_nothing_raised {frame.src}
|
161
|
+
assert_equal('http://www.google.com', frame.src)
|
162
|
+
assert_raises(FrameAccessDeniedException) {frame.button(:index, 0).click}
|
163
|
+
end
|
164
|
+
|
165
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# defect report from users of Watir Recorder
|
2
|
+
|
3
|
+
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
|
4
|
+
require 'unittests/setup'
|
5
|
+
|
6
|
+
class TC_GoogleForm < Test::Unit::TestCase
|
7
|
+
|
8
|
+
def setup
|
9
|
+
goto_page "google_india.html"
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_it
|
13
|
+
browser.form(:name, "f").text_field(:name, "q").set("ruby")
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<head>
|
3
|
+
<title>Alert Test</title>
|
4
|
+
<script type="text/javascript">
|
5
|
+
function disp_confirm()
|
6
|
+
{
|
7
|
+
testResult = document.getElementById('testResult');
|
8
|
+
if (confirm("Press a button."))
|
9
|
+
testResult.value = "You pressed the Confirm and OK button!";
|
10
|
+
else
|
11
|
+
testResult.value = "You pressed the Confirm and Cancel button!";
|
12
|
+
}
|
13
|
+
function disp_alert()
|
14
|
+
{
|
15
|
+
testResult = document.getElementById('testResult');
|
16
|
+
alert("Press OK")
|
17
|
+
testResult.value = "You pressed the Alert button!"
|
18
|
+
}
|
19
|
+
</script>
|
20
|
+
|
21
|
+
</head>
|
22
|
+
<body>
|
23
|
+
<form action="get">
|
24
|
+
<p>There are two basic methods for bringing up dialogs using javascript.</p>
|
25
|
+
<ul>
|
26
|
+
<li>
|
27
|
+
alert(message) -- Display message and OK button.<br/>
|
28
|
+
<input type="button" id="btnAlert" value="alert" OnClick="disp_alert();" />
|
29
|
+
</li>
|
30
|
+
<li>
|
31
|
+
confirm(message) -- Display message and OK and Cancel buttons.<br/>
|
32
|
+
<input type="button" id="btnConfirm" value="confirm" OnClick="disp_confirm();" /> </li>
|
33
|
+
</ul>
|
34
|
+
<p>Results of dialogs:</p>
|
35
|
+
<input type="text" style="width:248px;" id="testResult" value="Test Result" />
|
36
|
+
</form>
|
37
|
+
</body>
|
38
|
+
|
39
|
+
</html>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<head>
|
3
|
+
<title>
|
4
|
+
Test page for buttons
|
5
|
+
</title>
|
6
|
+
<link rel="stylesheet" type="text/css" href="watir_unit_tests.css">
|
7
|
+
</head>
|
8
|
+
<body>
|
9
|
+
<br>
|
10
|
+
<br>
|
11
|
+
<table>
|
12
|
+
<tr>
|
13
|
+
<td>
|
14
|
+
<form name = test1 method = get action = pass.html>
|
15
|
+
|
16
|
+
<input type = button class="italic_button" name = b1 id = b2 value = "Click Me" onClick="javascript:document.location='pass.html';" title = "this is button1">
|
17
|
+
<br><input type = button name = b4 id=b5 value = "Disabled Button" onClick="javascript:document.location='fail.html';" disabled>
|
18
|
+
|
19
|
+
</form>
|
20
|
+
<td> The top button is for testing buttons with names
|
21
|
+
<br> The second button is used for testing disabled buttons
|
22
|
+
|
23
|
+
|
24
|
+
<tr>
|
25
|
+
<td>
|
26
|
+
<form name = test2 method = get action = pass2.html>
|
27
|
+
<br><input type = submit value=Submit>
|
28
|
+
</form>
|
29
|
+
<td> This button is a submit ( the others are buttons)
|
30
|
+
|
31
|
+
<tr>
|
32
|
+
<td>
|
33
|
+
<form name = test3 method = get action = pass3.html>
|
34
|
+
<br><input type = image src=images/button.jpg name =sub3>
|
35
|
+
</form>
|
36
|
+
<td> This button is an image. It should behave the same as a submit
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
</html>
|
@@ -0,0 +1,89 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<head>
|
3
|
+
<title>
|
4
|
+
Test page for Check Boxes
|
5
|
+
</title>
|
6
|
+
|
7
|
+
<script>
|
8
|
+
|
9
|
+
function setButtonState( )
|
10
|
+
{
|
11
|
+
var button = document.getElementById('foo');
|
12
|
+
if (button.disabled ){
|
13
|
+
|
14
|
+
button.disabled = false
|
15
|
+
} else {
|
16
|
+
button.disabled = true
|
17
|
+
}
|
18
|
+
}
|
19
|
+
</script>
|
20
|
+
|
21
|
+
<link rel="stylesheet" type="text/css" href="watir_unit_tests.css">
|
22
|
+
|
23
|
+
</head>
|
24
|
+
<body>
|
25
|
+
<br>
|
26
|
+
<br>
|
27
|
+
<table>
|
28
|
+
<tr>
|
29
|
+
<td>
|
30
|
+
CheckBox 1 <input type = checkbox name = box1 class=check_box_style >
|
31
|
+
</td>
|
32
|
+
</tr>
|
33
|
+
|
34
|
+
<tr>
|
35
|
+
<td>
|
36
|
+
Disabled<input type = checkbox name = box2 disabled>
|
37
|
+
</td>
|
38
|
+
</tr>
|
39
|
+
<tr>
|
40
|
+
<td>
|
41
|
+
Set<input type = checkbox name = box3 checked>
|
42
|
+
</td>
|
43
|
+
</tr>
|
44
|
+
<tr><td>
|
45
|
+
These 2 have ids
|
46
|
+
<br>
|
47
|
+
id= box4 value=1 <input type ='checkbox' id='box4' name='verify1' value='1' checked>
|
48
|
+
<br>
|
49
|
+
id = box4a value=2 <input type = 'checkbox' id = 'box4a' name= 'verify2' value = '2' checked>
|
50
|
+
</tr>
|
51
|
+
<br>
|
52
|
+
<tr>
|
53
|
+
These boxes have the same name, but different values
|
54
|
+
</tr>
|
55
|
+
|
56
|
+
<tr><td>
|
57
|
+
Name = box4 value=1 <input type = checkbox name = box4 value = 1 checked>
|
58
|
+
</tr>
|
59
|
+
<tr><td>
|
60
|
+
Name = box4 value=2 <input type = checkbox name = box4 value = 2>
|
61
|
+
</tr>
|
62
|
+
<tr><td>
|
63
|
+
Name = box4 value=3 <input type = checkbox name = box4 value = 3>
|
64
|
+
</tr>
|
65
|
+
<tr><td>
|
66
|
+
Name = box4 value=4 <input type = checkbox name = box4 value = 4>
|
67
|
+
</tr>
|
68
|
+
<tr><td>
|
69
|
+
Name = box4 value=5 <input type = checkbox name = box4 value = 5 disabled title="box4-value5">
|
70
|
+
</tr>
|
71
|
+
|
72
|
+
<tr><td>
|
73
|
+
Name = box5 value=1 <input type = checkbox name = box5 value = 1 onClick='javascript:setButtonState( )'>
|
74
|
+
</tr>
|
75
|
+
|
76
|
+
<tr><td>
|
77
|
+
<input type = button id = foo value = foo disabled=disabled ><td> This button is used with checkbox box5. This button is enabled if the checkbox is enabled
|
78
|
+
</tr>
|
79
|
+
|
80
|
+
<tr><td>
|
81
|
+
Milk<input type = checkbox name = "box6" value ="Milk">
|
82
|
+
<br>
|
83
|
+
Tea<input type = checkbox name = "box6" value ="Tea">
|
84
|
+
</tr>
|
85
|
+
|
86
|
+
|
87
|
+
</table>
|
88
|
+
</body>
|
89
|
+
</html>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<head>
|
3
|
+
<title>Click No Wait Tests</title>
|
4
|
+
<script type="text/javascript">
|
5
|
+
function showMessage() {
|
6
|
+
document.getElementById('div1').innerHTML = "message!";
|
7
|
+
}
|
8
|
+
</script>
|
9
|
+
</head>
|
10
|
+
|
11
|
+
<div id="div1">nothing</div>
|
12
|
+
<a id="link1" href="javascript:void(0)" onclick="javascript:showMessage();">Click me!</a>
|
13
|
+
|
14
|
+
</html>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<head>
|
3
|
+
<title>
|
4
|
+
Test page for Tables
|
5
|
+
</title>
|
6
|
+
</head>
|
7
|
+
<body>
|
8
|
+
<br>
|
9
|
+
<br>
|
10
|
+
|
11
|
+
The table below has 2 smaller tables, one on each row
|
12
|
+
<br>
|
13
|
+
red is the main table
|
14
|
+
green is a table and grey is also a table
|
15
|
+
|
16
|
+
<table border =1 bgcolor=red>
|
17
|
+
<tr>
|
18
|
+
<td><table bgcolor=grey ><tr>
|
19
|
+
<td> subtable1 Row 1 Col1 </td>
|
20
|
+
<td> subtable1 Row 1 Col2 </td>
|
21
|
+
</tr>
|
22
|
+
</table>
|
23
|
+
</td>
|
24
|
+
</tr>
|
25
|
+
<tr>
|
26
|
+
<td><table bgcolor=silver><tr>
|
27
|
+
<td> subtable2 Row 1 Col1 </td>
|
28
|
+
<td> subtable2 Row 1 Col2 </td>
|
29
|
+
</tr>
|
30
|
+
</table>
|
31
|
+
</td>
|
32
|
+
</tr>
|
33
|
+
</table>
|
34
|
+
</body>
|
35
|
+
</html>
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<head>
|
3
|
+
<title>Test Hidden Message</title>
|
4
|
+
|
5
|
+
<style type="text/css">
|
6
|
+
div.hide { display: none; margin-left: auto; margin-right: auto; }
|
7
|
+
div.show { display: block; margin-left: auto; margin-right: auto; }
|
8
|
+
#Container { background-color: #f00; color: #fff; width: 300px; height: 300px; padding-top: 100px; text-align: center; font: bold 2em Verdana, Helvetica, sans-serif; }
|
9
|
+
|
10
|
+
</style>
|
11
|
+
|
12
|
+
<script type="text/javascript">
|
13
|
+
function show(divId)
|
14
|
+
{
|
15
|
+
var divContainer = document.getElementById("Container");
|
16
|
+
var divArr = divContainer.getElementsByTagName("div");
|
17
|
+
for (var i = 0; i < divArr.length; i++)
|
18
|
+
{
|
19
|
+
if ( divArr[i].id == divId )
|
20
|
+
{
|
21
|
+
divArr[i].className = "show";
|
22
|
+
}
|
23
|
+
else
|
24
|
+
{
|
25
|
+
divArr[i].className = "hide";
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
29
|
+
</script>
|
30
|
+
</head>
|
31
|
+
|
32
|
+
<body>
|
33
|
+
<div id="Container">
|
34
|
+
<div id="successError" class="hide">Success!</div><div id="failureError" class="hide">Failure!</div>
|
35
|
+
</div>
|
36
|
+
<form style="width: 300px; text-align: center;">
|
37
|
+
<p>Click on a button to display a message.</p>
|
38
|
+
<input type="button" name="success" value="Success" onclick="show( this.name + 'Error' );" />
|
39
|
+
<input type="button" name="failure" value="Failure" onclick="show( this.name + 'Error' );" />
|
40
|
+
</form>
|
41
|
+
</body>
|
42
|
+
</html>
|