firewatir 1.2.1 → 1.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/firewatir.rb +50 -0
- data/lib/firewatir/MozillaBaseElement.rb +1863 -0
- data/lib/firewatir/container.rb +534 -0
- data/lib/firewatir/exceptions.rb +10 -0
- data/lib/firewatir/firefox.rb +1127 -0
- data/lib/firewatir/htmlelements.rb +1911 -0
- data/lib/firewatir/version.rb +5 -0
- data/{firewatir → lib/firewatir}/winClicker.rb +0 -0
- data/{firewatir → lib/firewatir}/x11.rb +0 -0
- data/unittests/attach_to_new_window_test.rb +20 -12
- data/unittests/bug_fixes_test.rb +79 -69
- data/unittests/buttons_xpath_test.rb +45 -44
- data/unittests/checkbox_test.rb +86 -85
- data/unittests/checkbox_xpath_test.rb +58 -58
- data/unittests/div_test.rb +117 -115
- data/unittests/filefield_test.rb +12 -12
- data/unittests/filefield_xpath_test.rb +11 -11
- data/unittests/form_test.rb +134 -133
- data/unittests/frame_test.rb +42 -41
- data/unittests/hidden_test.rb +40 -40
- data/unittests/hidden_xpath_test.rb +32 -32
- data/unittests/images_test.rb +85 -84
- data/unittests/images_xpath_test.rb +57 -56
- data/unittests/iostring_test.rb +1 -1
- data/unittests/javascript_test.rb +42 -38
- data/unittests/links_test.rb +88 -86
- data/unittests/links_xpath_test.rb +38 -38
- data/unittests/mozilla_all_tests.rb +2 -14
- data/unittests/pre_test.rb +27 -25
- data/unittests/radios_test.rb +86 -86
- data/unittests/radios_xpath_test.rb +48 -48
- data/unittests/redirect_test.rb +20 -19
- data/unittests/selectbox_test.rb +72 -71
- data/unittests/selectbox_xpath_test.rb +58 -56
- data/unittests/setup.rb +22 -27
- data/unittests/table_test.rb +89 -88
- data/unittests/table_xpath_test.rb +37 -36
- data/unittests/textfields_test.rb +105 -102
- data/unittests/textfields_xpath_test.rb +53 -52
- metadata +37 -18
- data/MozillaBaseElement.rb +0 -1780
- data/container.rb +0 -900
- data/firewatir.rb +0 -1195
- data/firewatir/exceptions.rb +0 -44
- data/firewatir/testUnitAddons.rb +0 -8
- data/htmlelements.rb +0 -2281
- data/unittests/buttons_test.rb +0 -215
data/unittests/filefield_test.rb
CHANGED
@@ -1,36 +1,36 @@
|
|
1
1
|
# feature tests for file Fields
|
2
2
|
# revision: $Revision: 1.0 $
|
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_FileField < Test::Unit::TestCase
|
8
|
-
|
8
|
+
|
9
9
|
|
10
10
|
def gotoPage()
|
11
|
-
|
11
|
+
goto_page("fileupload.html")
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_fileField_Exists
|
15
15
|
gotoPage()
|
16
16
|
#test for existance of 4 file area
|
17
|
-
assert(
|
18
|
-
assert(
|
17
|
+
assert(browser.file_field(:name,"file1").exists?)
|
18
|
+
assert(browser.file_field(:id,"file2").exists?)
|
19
19
|
#test for missing
|
20
|
-
assert_false(
|
21
|
-
assert_false(
|
20
|
+
assert_false(browser.file_field(:name, "missing").exists?)
|
21
|
+
assert_false(browser.file_field(:name,"totallybogus").exists?)
|
22
22
|
#pop one open and put something in it.
|
23
|
-
|
23
|
+
browser.file_field(:name,"file3").set($htmlRoot + "fileupload.html")
|
24
24
|
#click the upload button
|
25
|
-
|
25
|
+
browser.button(:name,"upload").click
|
26
26
|
|
27
|
-
assert(
|
27
|
+
assert(browser.text.include?("PASS"))
|
28
28
|
end
|
29
29
|
|
30
30
|
def test_iterator
|
31
31
|
gotoPage()
|
32
|
-
assert_equal(6,
|
33
|
-
arrFileFields =
|
32
|
+
assert_equal(6, browser.file_fields.length)
|
33
|
+
arrFileFields = browser.file_fields
|
34
34
|
assert_equal("file1", arrFileFields[1].name)
|
35
35
|
assert_equal("file2", arrFileFields[2].id)
|
36
36
|
assert_equal("disabled", arrFileFields[3].name)
|
@@ -1,35 +1,35 @@
|
|
1
1
|
# feature tests for TextArea Fields
|
2
2
|
# revision: $Revision: 1.0 $
|
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_FileField_XPath < Test::Unit::TestCase
|
8
|
-
|
8
|
+
|
9
9
|
|
10
10
|
def gotoPage
|
11
|
-
|
11
|
+
goto_page("fileupload.html")
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_file_field_Exists
|
15
15
|
gotoPage()
|
16
16
|
#test for existance of 4 file area
|
17
|
-
assert(
|
18
|
-
assert(
|
17
|
+
assert(browser.file_field(:xpath, "//input[@name='file1']").exists?)
|
18
|
+
assert(browser.file_field(:xpath, "//input[@id='file2']").exists?)
|
19
19
|
#test for missing
|
20
|
-
assert_false(
|
21
|
-
assert_false(
|
20
|
+
assert_false(browser.file_field(:xpath, "//input[@name='missing']").exists?)
|
21
|
+
assert_false(browser.file_field(:xpath, "//input[@name='totallybogus']").exists?)
|
22
22
|
#pop one open and put something in it.
|
23
|
-
|
23
|
+
browser.file_field(:xpath, "//input[@name='file3']").set($htmlRoot + "fileupload.html")
|
24
24
|
#click the upload button
|
25
|
-
|
25
|
+
browser.button(:xpath, "//input[@name='upload']").click
|
26
26
|
|
27
|
-
assert(
|
27
|
+
assert(browser.text.include?("PASS"))
|
28
28
|
end
|
29
29
|
|
30
30
|
#def test_iterator
|
31
31
|
# gotoPage()
|
32
|
-
# assert_equal(6,
|
32
|
+
# assert_equal(6, browser.file_fields.length)
|
33
33
|
#end
|
34
34
|
|
35
35
|
end
|
data/unittests/form_test.rb
CHANGED
@@ -1,61 +1,62 @@
|
|
1
1
|
# feature tests for Forms
|
2
2
|
# revision: $Revision: 1.0 $
|
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_Forms2 < Test::Unit::TestCase # Note: there is no TC_Forms
|
8
|
-
|
8
|
+
|
9
9
|
|
10
10
|
def setup
|
11
|
-
|
11
|
+
goto_page("forms2.html")
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_Form_Exists
|
15
|
-
assert(
|
16
|
-
|
15
|
+
assert(browser.form(:name, "test2").exists?)
|
16
|
+
assert_false(browser.form(:name, "missing").exists?)
|
17
17
|
|
18
|
-
assert(
|
19
|
-
|
18
|
+
assert(browser.form("test2").exists?)
|
19
|
+
assert_false(browser.form( "missing").exists?)
|
20
20
|
|
21
|
-
assert(
|
22
|
-
|
21
|
+
assert(browser.form(:index, 1).exists?)
|
22
|
+
assert_false(browser.form(:index, 88).exists?)
|
23
23
|
|
24
|
-
assert(
|
25
|
-
|
24
|
+
assert(browser.form(:method, "get").exists?)
|
25
|
+
assert_false(browser.form(:method, "missing").exists?)
|
26
26
|
|
27
|
-
assert(
|
28
|
-
|
27
|
+
assert(browser.form(:id, 'f2').exists?)
|
28
|
+
assert_false(browser.form(:id, 'missing').exists?)
|
29
29
|
|
30
|
-
assert(
|
31
|
-
|
30
|
+
assert(browser.form(:action, /pass.html/).exists?)
|
31
|
+
assert_false(browser.form(:action, "missing").exists?)
|
32
32
|
end
|
33
33
|
|
34
34
|
def test_ButtonInForm
|
35
|
-
assert(
|
35
|
+
assert(browser.form(:name, "test2").button(:caption , "Submit").exists?)
|
36
36
|
end
|
37
37
|
|
38
38
|
# The following tests from bug 2261
|
39
|
+
tag_method :test_form_html, :fails_on_ie
|
39
40
|
def test_form_html
|
40
41
|
assert_equal("\n<BR><INPUT value=\"Submit\" type=\"submit\">\n".downcase(),
|
41
|
-
|
42
|
+
browser.form(:name, 'test2').html.downcase())
|
42
43
|
end
|
43
44
|
def test_form_flash
|
44
|
-
assert_nothing_raised{
|
45
|
+
assert_nothing_raised{ browser.form(:name, 'test2').flash }
|
45
46
|
end
|
46
47
|
def test_form_sub_element
|
47
|
-
assert_equal('Click Me',
|
48
|
+
assert_equal('Click Me', browser.form(:index, 1).button(:name, 'b1').value)
|
48
49
|
end
|
49
50
|
end
|
50
51
|
|
51
52
|
class TC_Form_Display < Test::Unit::TestCase
|
52
|
-
|
53
|
+
|
53
54
|
include MockStdoutTestCase
|
54
55
|
|
55
56
|
def test_showforms
|
56
|
-
|
57
|
+
goto_page("forms2.html")
|
57
58
|
$stdout = @mockout
|
58
|
-
|
59
|
+
browser.showForms
|
59
60
|
assert_equal(<<END_OF_MESSAGE, @mockout)
|
60
61
|
There are 4 forms
|
61
62
|
Form name:
|
@@ -79,217 +80,217 @@ END_OF_MESSAGE
|
|
79
80
|
end
|
80
81
|
|
81
82
|
class TC_Forms3 < Test::Unit::TestCase
|
82
|
-
|
83
|
+
|
83
84
|
def setup
|
84
|
-
|
85
|
+
goto_page("forms3.html")
|
85
86
|
end
|
86
87
|
|
87
88
|
# The following tests from bug 2261
|
88
89
|
def test_p_in_form
|
89
|
-
|
90
|
+
browser.form(:name, 'buttonsubmit').p(:index, 1).text
|
90
91
|
end
|
91
92
|
|
92
93
|
def test_Form_Exists
|
93
|
-
assert(
|
94
|
-
|
94
|
+
assert(browser.form(:name, "test2").exists?)
|
95
|
+
assert_false(browser.form(:name, "missing").exists?)
|
95
96
|
|
96
|
-
assert(
|
97
|
-
|
97
|
+
assert(browser.form("test2").exists?)
|
98
|
+
assert_false(browser.form( "missing").exists?)
|
98
99
|
|
99
|
-
assert(
|
100
|
-
|
100
|
+
assert(browser.form(:index, 1).exists?)
|
101
|
+
assert_false(browser.form(:index, 88).exists?)
|
101
102
|
|
102
|
-
assert(
|
103
|
-
|
103
|
+
assert(browser.form(:method, "get").exists?)
|
104
|
+
assert_false(browser.form(:method, "missing").exists?)
|
104
105
|
|
105
|
-
assert(
|
106
|
-
|
106
|
+
assert(browser.form(:action, "pass.html").exists?)
|
107
|
+
assert_false(browser.form(:action, "missing").exists?)
|
107
108
|
end
|
108
109
|
|
109
110
|
def test_index_other_element_before_it
|
110
111
|
# test for bug reported by Scott Pack, http://rubyforge.org/pipermail/wtr-general/2005-June/002223.html
|
111
|
-
assert_equal("check1" ,
|
112
|
+
assert_equal("check1" , browser.checkbox(:index,1).name )
|
112
113
|
end
|
113
114
|
|
114
115
|
def test_reset
|
115
|
-
|
116
|
-
assert_equal(
|
116
|
+
browser.text_field(:id, "t1").set("Hello, reset test!")
|
117
|
+
assert_equal(browser.text_field(:id, 't1').value, 'Hello, reset test!')
|
117
118
|
|
118
|
-
|
119
|
-
assert_equal("" ,
|
119
|
+
browser.button(:id, "reset_button").click
|
120
|
+
assert_equal("" , browser.text_field(:id, 't1').value )
|
120
121
|
|
121
122
|
# also verify it works under a form
|
122
|
-
|
123
|
-
assert_equal(
|
123
|
+
browser.text_field(:id, "t1").set("reset test - using a form")
|
124
|
+
assert_equal(browser.text_field(:id, 't1').value, 'reset test - using a form')
|
124
125
|
|
125
|
-
|
126
|
-
assert_equal("" ,
|
126
|
+
browser.form(:index,2).button(:index,2).click
|
127
|
+
assert_equal("" , browser.text_field(:id, 't1').value )
|
127
128
|
|
128
129
|
# also verify it works under a form, this time using the :id attribute
|
129
|
-
|
130
|
-
assert_equal(
|
130
|
+
browser.text_field(:id, "t1").set("reset test - using a form")
|
131
|
+
assert_equal(browser.text_field(:id, 't1').value, 'reset test - using a form')
|
131
132
|
|
132
|
-
|
133
|
-
assert_equal("" ,
|
133
|
+
browser.form(:index,2).button(:id,'reset_button').click
|
134
|
+
assert_equal("" , browser.text_field(:id, 't1').value )
|
134
135
|
end
|
135
136
|
|
136
137
|
## def test_flash1
|
137
|
-
##
|
138
|
+
## browser.form(:name ,"test2").button(:caption , "Submit").flash
|
138
139
|
## end
|
139
140
|
#
|
140
141
|
def test_objects_with_same_name
|
141
|
-
assert_equal('textfield'
|
142
|
-
assert_equal('button'
|
143
|
-
assert_equal('1'
|
144
|
-
assert_equal('2'
|
142
|
+
assert_equal('textfield' ,browser.text_field( :name , 'g1').value )
|
143
|
+
assert_equal('button' ,browser.button( :name , 'g1').value )
|
144
|
+
assert_equal('1' ,browser.checkbox( :name , 'g1').value )
|
145
|
+
assert_equal('2' ,browser.radio( :name , 'g1').value )
|
145
146
|
|
146
|
-
assert_equal('textfield'
|
147
|
-
assert_equal('button'
|
148
|
-
assert_equal('1'
|
149
|
-
assert_equal('2'
|
147
|
+
assert_equal('textfield' ,browser.text_field( :name , /g1/).value )
|
148
|
+
assert_equal('button' ,browser.button( :name , /g1/).value )
|
149
|
+
assert_equal('1' ,browser.checkbox( :name , /g1/).value )
|
150
|
+
assert_equal('2' ,browser.radio( :name , /g1/).value )
|
150
151
|
|
151
|
-
assert_equal('textfield_id'
|
152
|
-
assert_equal('button_id'
|
153
|
-
assert_equal('1_id'
|
154
|
-
assert_equal('2_id'
|
152
|
+
assert_equal('textfield_id' ,browser.text_field( :id , 'g1').value )
|
153
|
+
assert_equal('button_id' ,browser.button( :id , 'g1').value )
|
154
|
+
assert_equal('1_id' ,browser.checkbox( :id , 'g1').value )
|
155
|
+
assert_equal('2_id' ,browser.radio( :id , 'g1').value )
|
155
156
|
|
156
|
-
assert_equal('textfield_id'
|
157
|
-
assert_equal('button_id'
|
158
|
-
assert_equal('1_id'
|
159
|
-
assert_equal('2_id'
|
157
|
+
assert_equal('textfield_id' ,browser.text_field( :id , /g1/).value )
|
158
|
+
assert_equal('button_id' ,browser.button( :id , /g1/).value )
|
159
|
+
assert_equal('1_id' ,browser.checkbox( :id , /g1/).value )
|
160
|
+
assert_equal('2_id' ,browser.radio( :id , /g1/).value )
|
160
161
|
end
|
161
162
|
|
162
163
|
# def test_flash2
|
163
|
-
#
|
164
|
-
# assert_raises( Watir::UnknownObjectException ) {
|
164
|
+
# browser.button(:value, 'Click Me').flash
|
165
|
+
# assert_raises( Watir::UnknownObjectException ) { browser.text_field( :name , 'g177').flash }
|
165
166
|
# end
|
166
167
|
|
167
168
|
def test_submitWithImage
|
168
|
-
assert(
|
169
|
-
assert(
|
169
|
+
assert( browser.button(:alt , "submit").exists? )
|
170
|
+
assert( browser.button(:alt , /sub/).exists? )
|
170
171
|
|
171
|
-
|
172
|
-
|
172
|
+
assert_false( browser.button(:alt , "missing").exists? )
|
173
|
+
assert_false( browser.button(:alt , /missing/).exists? )
|
173
174
|
|
174
|
-
#assert(
|
175
|
-
assert(
|
175
|
+
#assert( browser.button(:src , "file:///#{$myDir}/html/images/button.jpg").exists? ) # this doesnt work for everybody
|
176
|
+
assert( browser.button(:src , /button/).exists? )
|
176
177
|
|
177
|
-
|
178
|
-
|
179
|
-
assert_nothing_raised("raised an exception when it shouldnt have") {
|
178
|
+
assert_false( browser.button(:src , "missing").exists? )
|
179
|
+
assert_false( browser.button(:src , /missing/).exists? )
|
180
|
+
assert_nothing_raised("raised an exception when it shouldnt have") { browser.button(:src , /button/).click }
|
180
181
|
|
181
|
-
assert(
|
182
|
+
assert( browser.text.include?("PASS") )
|
182
183
|
end
|
183
184
|
end
|
184
185
|
|
185
186
|
#class TC_Forms3_Display < Test::Unit::TestCase
|
186
|
-
#
|
187
|
+
#
|
187
188
|
# include MockStdoutTestCase # BUG in test: output not verified!
|
188
189
|
# def test_show_stuff
|
189
|
-
#
|
190
|
+
# goto_page("forms3.html")
|
190
191
|
# $stdout = @mockout
|
191
|
-
#
|
192
|
-
# puts
|
193
|
-
# puts
|
192
|
+
# browser.showAllObjects
|
193
|
+
# puts browser.getText
|
194
|
+
# puts browser.getHTML
|
194
195
|
# end
|
195
196
|
#end
|
196
197
|
|
197
198
|
class TC_Forms4 < Test::Unit::TestCase
|
198
|
-
|
199
|
+
|
199
200
|
def setup
|
200
|
-
|
201
|
+
goto_page("forms4.html")
|
201
202
|
end
|
202
203
|
|
203
204
|
def test_find_text_field_ignoring_form
|
204
|
-
assert_equal(
|
205
|
+
assert_equal(browser.text_field(:name, 'name').value, 'apple') # should it raise a not-unique error instead?
|
205
206
|
end
|
206
207
|
|
207
208
|
def test_correct_form_field_is_found_using_form_name
|
208
|
-
assert_equal(
|
209
|
-
assert_equal(
|
209
|
+
assert_equal(browser.form(:name, 'apple_form').text_field(:name, 'name').value, 'apple')
|
210
|
+
assert_equal(browser.form(:name, 'banana_form').text_field(:name, 'name').value, 'banana')
|
210
211
|
end
|
211
212
|
|
212
213
|
def test_correct_form_field_is_found_using_form_index
|
213
|
-
assert_equal(
|
214
|
-
assert_equal(
|
214
|
+
assert_equal(browser.form(:index, 1).text_field(:name, 'name').value, 'apple')
|
215
|
+
assert_equal(browser.form(:index, 2).text_field(:name, 'name').value, 'banana')
|
215
216
|
end
|
216
217
|
|
217
218
|
def test_using_text_on_form
|
218
|
-
|
219
|
-
assert_equal(
|
219
|
+
browser.form(:name, 'apple_form').text_field(:name, 'name').set('strudel')
|
220
|
+
assert_equal(browser.form(:index, 1).text_field(:name, 'name').value, 'strudel')
|
220
221
|
end
|
221
222
|
|
222
223
|
def test_submit
|
223
|
-
|
224
|
-
assert(
|
224
|
+
browser.form(:name, 'apple_form').submit
|
225
|
+
assert( browser.text.include?("PASS") )
|
225
226
|
end
|
226
227
|
end
|
227
228
|
|
228
229
|
class TC_Hidden_Fields2 < Test::Unit::TestCase
|
229
|
-
|
230
|
+
|
230
231
|
def setup
|
231
|
-
|
232
|
+
goto_page("forms3.html")
|
232
233
|
end
|
233
234
|
|
234
235
|
def test_hidden
|
235
236
|
|
236
237
|
# test using index
|
237
|
-
assert(
|
238
|
-
assert(
|
239
|
-
|
238
|
+
assert( browser.hidden(:index,1).exists? )
|
239
|
+
assert( browser.hidden(:index,2).exists? )
|
240
|
+
assert_false( browser.hidden(:index,3).exists? )
|
240
241
|
|
241
|
-
|
242
|
-
|
242
|
+
browser.hidden(:index,1).value = 44
|
243
|
+
browser.hidden(:index,2).value = 55
|
243
244
|
|
244
|
-
|
245
|
+
browser.button(:value , "Show Hidden").click
|
245
246
|
|
246
|
-
assert_equal("44" ,
|
247
|
-
assert_equal("55" ,
|
247
|
+
assert_equal("44" , browser.text_field(:name , "vis1").value )
|
248
|
+
assert_equal("55" , browser.text_field(:name , "vis2").value )
|
248
249
|
|
249
250
|
# test using name and ID
|
250
|
-
assert(
|
251
|
-
assert(
|
252
|
-
|
253
|
-
|
251
|
+
assert( browser.hidden(:name ,"hid1").exists? )
|
252
|
+
assert( browser.hidden(:id,"hidden_1").exists? )
|
253
|
+
assert_false( browser.hidden(:name,"hidden_44").exists? )
|
254
|
+
assert_false( browser.hidden(:id,"hidden_55").exists? )
|
254
255
|
|
255
|
-
|
256
|
-
|
256
|
+
browser.hidden(:name ,"hid1").value = 444
|
257
|
+
browser.hidden(:id,"hidden_1").value = 555
|
257
258
|
|
258
|
-
|
259
|
+
browser.button(:value , "Show Hidden").click
|
259
260
|
|
260
|
-
assert_equal("444" ,
|
261
|
-
assert_equal("555" ,
|
261
|
+
assert_equal("444" , browser.text_field(:name , "vis1").value )
|
262
|
+
assert_equal("555" , browser.text_field(:name ,"vis2").value )
|
262
263
|
|
263
264
|
# test the over-ridden append method
|
264
|
-
|
265
|
-
|
266
|
-
assert_equal("444a" ,
|
267
|
-
assert_equal("555" ,
|
265
|
+
browser.hidden(:name ,"hid1").append("a")
|
266
|
+
browser.button(:value , "Show Hidden").click
|
267
|
+
assert_equal("444a" , browser.text_field(:name , "vis1").value )
|
268
|
+
assert_equal("555" , browser.text_field(:name ,"vis2").value )
|
268
269
|
|
269
270
|
# test the over-ridden clear method
|
270
|
-
|
271
|
-
|
272
|
-
assert_equal("" ,
|
273
|
-
assert_equal("555" ,
|
271
|
+
browser.hidden(:name ,"hid1").clear
|
272
|
+
browser.button(:value , "Show Hidden").click
|
273
|
+
assert_equal("" , browser.text_field(:name , "vis1").value )
|
274
|
+
assert_equal("555" , browser.text_field(:name ,"vis2").value )
|
274
275
|
|
275
276
|
# test using a form
|
276
|
-
assert(
|
277
|
-
assert(
|
278
|
-
|
279
|
-
|
277
|
+
assert( browser.form(:name , "has_a_hidden").hidden(:name ,"hid1").exists? )
|
278
|
+
assert( browser.form(:name , "has_a_hidden").hidden(:id,"hidden_1").exists? )
|
279
|
+
assert_false( browser.form(:name , "has_a_hidden").hidden(:name,"hidden_44").exists? )
|
280
|
+
assert_false( browser.form(:name , "has_a_hidden").hidden(:id,"hidden_55").exists? )
|
280
281
|
|
281
|
-
|
282
|
-
|
282
|
+
browser.form(:name , "has_a_hidden").hidden(:name ,"hid1").value = 222
|
283
|
+
browser.form(:name , "has_a_hidden").hidden(:id,"hidden_1").value = 333
|
283
284
|
|
284
|
-
|
285
|
+
browser.button(:value , "Show Hidden").click
|
285
286
|
|
286
|
-
assert_equal("222" ,
|
287
|
-
assert_equal("333" ,
|
287
|
+
assert_equal("222" , browser.text_field(:name , "vis1").value )
|
288
|
+
assert_equal("333" , browser.text_field(:name ,"vis2").value )
|
288
289
|
|
289
290
|
# iterators
|
290
|
-
## assert_equal(2,
|
291
|
+
## assert_equal(2, browser.hiddens.length)
|
291
292
|
## count =1
|
292
|
-
##
|
293
|
+
## browser.hiddens.each do |h|
|
293
294
|
## case count
|
294
295
|
## when 1
|
295
296
|
## assert_equal( "", h.id)
|
@@ -301,7 +302,7 @@ class TC_Hidden_Fields2 < Test::Unit::TestCase
|
|
301
302
|
## count+=1
|
302
303
|
## end
|
303
304
|
#
|
304
|
-
## assert_equal("hid1" ,
|
305
|
-
## assert_equal("hidden_1" ,
|
305
|
+
## assert_equal("hid1" , browser.hiddens[1].name )
|
306
|
+
## assert_equal("hidden_1" , browser.hiddens[2].id )
|
306
307
|
end
|
307
308
|
end
|