firewatir 1.6.2 → 1.6.5
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +32 -0
- data/lib/firewatir.rb +40 -50
- data/lib/firewatir/container.rb +491 -534
- data/lib/firewatir/document.rb +239 -0
- data/lib/firewatir/element.rb +1365 -0
- data/lib/firewatir/element_collections.rb +314 -0
- data/lib/firewatir/elements/button.rb +15 -0
- data/lib/firewatir/elements/file_field.rb +29 -0
- data/lib/firewatir/elements/form.rb +40 -0
- data/lib/firewatir/elements/frame.rb +55 -0
- data/lib/firewatir/elements/hidden.rb +56 -0
- data/lib/firewatir/elements/image.rb +139 -0
- data/lib/firewatir/elements/input_element.rb +44 -0
- data/lib/firewatir/elements/link.rb +76 -0
- data/lib/firewatir/elements/non_control_element.rb +53 -0
- data/lib/firewatir/elements/non_control_elements.rb +108 -0
- data/lib/firewatir/elements/not_used.rb +278 -0
- data/lib/firewatir/elements/option.rb +131 -0
- data/lib/firewatir/elements/radio_check_common.rb +163 -0
- data/lib/firewatir/elements/select_list.rb +188 -0
- data/lib/firewatir/elements/table.rb +218 -0
- data/lib/firewatir/elements/table_cell.rb +54 -0
- data/lib/firewatir/elements/table_row.rb +100 -0
- data/lib/firewatir/elements/text_field.rb +218 -0
- data/lib/firewatir/exceptions.rb +10 -10
- data/lib/firewatir/firefox.rb +1040 -1127
- data/lib/firewatir/jssh_socket.rb +101 -0
- data/lib/firewatir/version.rb +5 -5
- data/unittests/attach_to_new_window_test.rb +49 -42
- data/unittests/bug_fixes_test.rb +195 -198
- data/unittests/buttons_xpath_test.rb +88 -88
- data/unittests/checkbox_test.rb +158 -155
- data/unittests/checkbox_xpath_test.rb +107 -107
- data/unittests/div_test.rb +275 -276
- data/unittests/filefield_test.rb +49 -45
- data/unittests/filefield_xpath_test.rb +35 -35
- data/unittests/form_test.rb +296 -308
- data/unittests/frame_test.rb +159 -152
- data/unittests/hidden_test.rb +85 -85
- data/unittests/hidden_xpath_test.rb +72 -72
- data/unittests/html/blankpage.html +11 -11
- data/unittests/html/buttons1.html +61 -61
- data/unittests/html/cssTest.html +42 -42
- data/unittests/html/div.html +72 -72
- data/unittests/html/fileupload.html +45 -45
- data/unittests/html/formTest1.html +38 -38
- data/unittests/html/forms2.html +45 -45
- data/unittests/html/frame_buttons.html +3 -3
- data/unittests/html/iframeTest.html +14 -14
- data/unittests/html/iframeTest1.html +13 -13
- data/unittests/html/iframeTest2.html +5 -5
- data/unittests/html/links1.html +42 -42
- data/unittests/html/nestedFrames.html +6 -6
- data/unittests/html/new_browser.html +1 -0
- data/unittests/html/new_browser_popup.html +8 -0
- data/unittests/html/pass.html +9 -9
- data/unittests/html/pre.html +27 -27
- data/unittests/html/redirect.html +10 -10
- data/unittests/html/redirect1.html +8 -8
- data/unittests/html/redirect2.html +8 -8
- data/unittests/html/redirect3.html +8 -8
- data/unittests/html/simple_table_columns.html +74 -74
- data/unittests/html/table1.html +165 -165
- data/unittests/html/textfields1.html +62 -62
- data/unittests/images_test.rb +198 -205
- data/unittests/images_xpath_test.rb +118 -119
- data/unittests/javascript_test.rb +75 -75
- data/unittests/links_test.rb +231 -232
- data/unittests/links_xpath_test.rb +79 -79
- data/unittests/mozilla_all_tests.rb +7 -7
- data/unittests/pre_test.rb +75 -76
- data/unittests/radios_xpath_test.rb +101 -101
- data/unittests/redirect_test.rb +41 -41
- data/unittests/selectbox_test.rb +142 -142
- data/unittests/selectbox_xpath_test.rb +129 -129
- data/unittests/setup.rb +29 -30
- data/unittests/table_test.rb +385 -373
- data/unittests/table_xpath_test.rb +185 -185
- data/unittests/textfields_test.rb +234 -233
- data/unittests/textfields_xpath_test.rb +113 -113
- metadata +33 -11
- data/lib/firewatir/MozillaBaseElement.rb +0 -1863
- data/lib/firewatir/htmlelements.rb +0 -1911
- data/unittests/iostring.rb +0 -30
- data/unittests/iostring_test.rb +0 -48
data/unittests/frame_test.rb
CHANGED
@@ -1,152 +1,159 @@
|
|
1
|
-
# feature tests for Frames
|
2
|
-
# revision: $Revision: 1.0 $
|
3
|
-
|
4
|
-
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
|
5
|
-
require 'unittests/setup'
|
6
|
-
|
7
|
-
class TC_Frames < Test::Unit::TestCase
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
def
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
end
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
end
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
end
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
1
|
+
# feature tests for Frames
|
2
|
+
# revision: $Revision: 1.0 $
|
3
|
+
|
4
|
+
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
|
5
|
+
require 'unittests/setup'
|
6
|
+
|
7
|
+
class TC_Frames < Test::Unit::TestCase
|
8
|
+
|
9
|
+
def setup
|
10
|
+
goto_page("frame_buttons.html")
|
11
|
+
end
|
12
|
+
|
13
|
+
tag_method :test_doesnt_exist, :fails_on_firefox, :fails_on_ie # bug WTR-268
|
14
|
+
def test_doesnt_exist
|
15
|
+
assert_false browser.frame("missingFrame").exists?
|
16
|
+
end
|
17
|
+
|
18
|
+
tag_method :test_exists, :fails_on_ie # related to bug WTR-268
|
19
|
+
def test_exists
|
20
|
+
assert browser.frame('buttonFrame2').exists?
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_frame_no_what
|
24
|
+
assert_raises(UnknownFrameException) { browser.frame("missingFrame").button(:id, "b2").enabled? }
|
25
|
+
assert_raises(UnknownObjectException) { browser.frame("buttonFrame2").button(:id, "b2").enabled? }
|
26
|
+
assert(browser.frame("buttonFrame").button(:id, "b2").enabled?)
|
27
|
+
assert_false(browser.frame("buttonFrame").button(:caption, "Disabled Button").enabled?)
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_frame_using_name
|
31
|
+
assert_raises(UnknownFrameException) { browser.frame(:name , "missingFrame").button(:id, "b2").enabled? }
|
32
|
+
assert_raises(UnknownObjectException) { browser.frame(:name, "buttonFrame2").button(:id, "b2").enabled? }
|
33
|
+
assert(browser.frame(:name, "buttonFrame").button(:id, "b2").enabled?)
|
34
|
+
assert_false(browser.frame(:name , "buttonFrame").button(:caption, "Disabled Button").enabled?)
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_frame_using_name_and_regexp
|
38
|
+
assert_raises(UnknownFrameException) { browser.frame(:name , /missingFrame/).button(:id, "b2").enabled? }
|
39
|
+
assert(browser.frame(:name, /button/).button(:id, "b2").enabled?)
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_frame_using_index
|
43
|
+
assert_raises(UnknownFrameException) { browser.frame(:index, 8).button(:id, "b2").enabled? }
|
44
|
+
assert_raises(UnknownObjectException) { browser.frame(:index, 2).button(:id, "b2").enabled? }
|
45
|
+
assert(browser.frame(:index, 1 ).button(:id, "b2").enabled?)
|
46
|
+
assert_false(browser.frame(:index, 1).button(:caption, "Disabled Button").enabled?)
|
47
|
+
end
|
48
|
+
|
49
|
+
# def test_frame_with_invalid_attribute
|
50
|
+
# assert_raises(ArgumentError) { browser.frame(:blah, 'no_such_thing').button(:id, "b2").enabled? }
|
51
|
+
# end
|
52
|
+
|
53
|
+
def test_preset_frame
|
54
|
+
# with ruby's instance_eval, we are able to use the same frame for several actions
|
55
|
+
results = browser.frame("buttonFrame").instance_eval do [
|
56
|
+
button(:id, "b2").enabled?,
|
57
|
+
button(:caption, "Disabled Button").enabled?
|
58
|
+
]
|
59
|
+
end
|
60
|
+
assert_equal([true, false], results)
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
class TC_Frames2 < Test::Unit::TestCase
|
66
|
+
|
67
|
+
|
68
|
+
def setup
|
69
|
+
goto_page("frame_multi.html")
|
70
|
+
end
|
71
|
+
|
72
|
+
def test_frame_with_no_name
|
73
|
+
assert_raises(UnknownFrameException) { browser.frame(:name , "missingFrame").button(:id, "b2").enabled? }
|
74
|
+
end
|
75
|
+
|
76
|
+
def test_frame_by_id
|
77
|
+
assert_raises(UnknownFrameException) { browser.frame(:id , "missingFrame").button(:id, "b2").enabled? }
|
78
|
+
assert(browser.frame(:id, 'first_frame').button(:id, "b2").enabled?)
|
79
|
+
assert(/.*Test page for buttons.*/ =~ browser.frame(:id, 'first_frame').html)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
class TC_NestedFrames < Test::Unit::TestCase
|
84
|
+
|
85
|
+
|
86
|
+
def setup
|
87
|
+
goto_page("nestedFrames.html")
|
88
|
+
end
|
89
|
+
|
90
|
+
def test_frame
|
91
|
+
assert_raises(UnknownFrameException) { browser.frame("missingFrame").button(:id, "b2").enabled? }
|
92
|
+
assert_raises(UnknownFrameException) { browser.frame("nestedFrame").frame("subFrame").button(:id, "b2").enabled? }
|
93
|
+
assert(browser.frame("nestedFrame").frame("senderFrame").button(:name, "sendIt").enabled?)
|
94
|
+
browser.frame("nestedFrame").frame("senderFrame").text_field(:index, "1").set("Hello")
|
95
|
+
browser.frame("nestedFrame").frame("senderFrame").button(:name, "sendIt").click
|
96
|
+
assert(browser.frame("nestedFrame").frame("receiverFrame").text_field(:name, "receiverText").verify_contains("Hello"))
|
97
|
+
end
|
98
|
+
|
99
|
+
end
|
100
|
+
|
101
|
+
class TC_IFrames < Test::Unit::TestCase
|
102
|
+
|
103
|
+
|
104
|
+
def setup
|
105
|
+
goto_page("iframeTest.html")
|
106
|
+
end
|
107
|
+
|
108
|
+
def test_Iframe
|
109
|
+
f = browser.frame("senderFrame")
|
110
|
+
f.text_field(:name, "textToSend").set("Hello World")
|
111
|
+
browser.frame("senderFrame").text_field(:name , "textToSend").set( "Hello World")
|
112
|
+
browser.frame("senderFrame").button(:index, 1).click
|
113
|
+
assert( browser.frame("receiverFrame").text_field(:name , "receiverText").verify_contains("Hello World") )
|
114
|
+
end
|
115
|
+
|
116
|
+
end
|
117
|
+
|
118
|
+
class TC_show_frames < Test::Unit::TestCase
|
119
|
+
include CaptureIOHelper
|
120
|
+
tags :fails_on_ie
|
121
|
+
|
122
|
+
def capture_and_compare(page, expected)
|
123
|
+
goto_page(page)
|
124
|
+
actual = capture_stdout { browser.showFrames }
|
125
|
+
assert_equal(expected, actual)
|
126
|
+
end
|
127
|
+
|
128
|
+
def test_show_nested_frames
|
129
|
+
capture_and_compare("nestedFrames.html", <<END_OF_MESSAGE)
|
130
|
+
There are 2 frames
|
131
|
+
frame: name: nestedFrame
|
132
|
+
index: 1
|
133
|
+
frame: name: nestedFrame2
|
134
|
+
index: 2
|
135
|
+
END_OF_MESSAGE
|
136
|
+
end
|
137
|
+
|
138
|
+
def test_button_frames
|
139
|
+
capture_and_compare("frame_buttons.html", <<END_OF_MESSAGE)
|
140
|
+
There are 2 frames
|
141
|
+
frame: name: buttonFrame
|
142
|
+
index: 1
|
143
|
+
frame: name: buttonFrame2
|
144
|
+
index: 2
|
145
|
+
END_OF_MESSAGE
|
146
|
+
end
|
147
|
+
|
148
|
+
def test_iframes
|
149
|
+
capture_and_compare("iframeTest.html", <<END_OF_MESSAGE)
|
150
|
+
There are 2 frames
|
151
|
+
frame: name: senderFrame
|
152
|
+
index: 1
|
153
|
+
frame: name: receiverFrame
|
154
|
+
index: 2
|
155
|
+
END_OF_MESSAGE
|
156
|
+
end
|
157
|
+
|
158
|
+
end
|
159
|
+
|
data/unittests/hidden_test.rb
CHANGED
@@ -1,85 +1,85 @@
|
|
1
|
-
# feature tests for Input Hidden elements
|
2
|
-
# revision: $Revision: 1.0 $
|
3
|
-
|
4
|
-
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
|
5
|
-
require 'unittests/setup'
|
6
|
-
|
7
|
-
class TC_Hidden_Fields < Test::Unit::TestCase
|
8
|
-
def setup
|
9
|
-
goto_page("forms3.html")
|
10
|
-
end
|
11
|
-
|
12
|
-
def test_hidden
|
13
|
-
|
14
|
-
# test using index
|
15
|
-
assert( browser.hidden(:index,1).exists? )
|
16
|
-
assert( browser.hidden(:index,2).exists? )
|
17
|
-
assert_false( browser.hidden(:index,3).exists? )
|
18
|
-
|
19
|
-
browser.hidden(:index,1).value = 44
|
20
|
-
browser.hidden(:index,2).value = 55
|
21
|
-
|
22
|
-
browser.button(:value , "Show Hidden").click
|
23
|
-
|
24
|
-
assert_equal("44" , browser.text_field(:name , "vis1").value )
|
25
|
-
assert_equal("55" , browser.text_field(:name , "vis2").value )
|
26
|
-
|
27
|
-
# test using name and ID
|
28
|
-
assert( browser.hidden(:name ,"hid1").exists? )
|
29
|
-
assert( browser.hidden(:id,"hidden_1").exists? )
|
30
|
-
assert_false( browser.hidden(:name,"hidden_44").exists? )
|
31
|
-
assert_false( browser.hidden(:id,"hidden_55").exists? )
|
32
|
-
|
33
|
-
browser.hidden(:name ,"hid1").value = 444
|
34
|
-
browser.hidden(:id,"hidden_1").value = 555
|
35
|
-
|
36
|
-
browser.button(:value , "Show Hidden").click
|
37
|
-
|
38
|
-
assert_equal("444" , browser.text_field(:name , "vis1").value )
|
39
|
-
assert_equal("555" , browser.text_field(:name ,"vis2").value )
|
40
|
-
|
41
|
-
# test the over-ridden append method
|
42
|
-
browser.hidden(:name ,"hid1").append("a")
|
43
|
-
browser.button(:value , "Show Hidden").click
|
44
|
-
assert_equal("444a" , browser.text_field(:name , "vis1").value )
|
45
|
-
assert_equal("555" , browser.text_field(:name ,"vis2").value )
|
46
|
-
|
47
|
-
# test the over-ridden clear method
|
48
|
-
browser.hidden(:name ,"hid1").clear
|
49
|
-
browser.button(:value , "Show Hidden").click
|
50
|
-
assert_equal("" , browser.text_field(:name , "vis1").value )
|
51
|
-
assert_equal("555" , browser.text_field(:name ,"vis2").value )
|
52
|
-
|
53
|
-
# test using a form
|
54
|
-
assert( browser.form(:name , "has_a_hidden").hidden(:name ,"hid1").exists? )
|
55
|
-
assert( browser.form(:name , "has_a_hidden").hidden(:id,"hidden_1").exists? )
|
56
|
-
assert_false( browser.form(:name , "has_a_hidden").hidden(:name,"hidden_44").exists? )
|
57
|
-
assert_false( browser.form(:name , "has_a_hidden").hidden(:id,"hidden_55").exists? )
|
58
|
-
|
59
|
-
browser.form(:name , "has_a_hidden").hidden(:name ,"hid1").value = 222
|
60
|
-
browser.form(:name , "has_a_hidden").hidden(:id,"hidden_1").value = 333
|
61
|
-
|
62
|
-
browser.button(:value , "Show Hidden").click
|
63
|
-
|
64
|
-
assert_equal("222" , browser.text_field(:name , "vis1").value )
|
65
|
-
assert_equal("333" , browser.text_field(:name ,"vis2").value )
|
66
|
-
|
67
|
-
# iterators
|
68
|
-
assert_equal(2, browser.hiddens.length)
|
69
|
-
count =1
|
70
|
-
browser.hiddens.each do |h|
|
71
|
-
case count
|
72
|
-
when 1
|
73
|
-
assert_equal( "", h.id)
|
74
|
-
assert_equal( "hid1", h.name)
|
75
|
-
when 2
|
76
|
-
assert_equal( "", h.name)
|
77
|
-
assert_equal( "hidden_1", h.id)
|
78
|
-
end
|
79
|
-
count+=1
|
80
|
-
end
|
81
|
-
|
82
|
-
assert_equal("hid1" , browser.hiddens[1].name )
|
83
|
-
assert_equal("hidden_1" , browser.hiddens[2].id )
|
84
|
-
end
|
85
|
-
end
|
1
|
+
# feature tests for Input Hidden elements
|
2
|
+
# revision: $Revision: 1.0 $
|
3
|
+
|
4
|
+
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
|
5
|
+
require 'unittests/setup'
|
6
|
+
|
7
|
+
class TC_Hidden_Fields < Test::Unit::TestCase
|
8
|
+
def setup
|
9
|
+
goto_page("forms3.html")
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_hidden
|
13
|
+
|
14
|
+
# test using index
|
15
|
+
assert( browser.hidden(:index,1).exists? )
|
16
|
+
assert( browser.hidden(:index,2).exists? )
|
17
|
+
assert_false( browser.hidden(:index,3).exists? )
|
18
|
+
|
19
|
+
browser.hidden(:index,1).value = 44
|
20
|
+
browser.hidden(:index,2).value = 55
|
21
|
+
|
22
|
+
browser.button(:value , "Show Hidden").click
|
23
|
+
|
24
|
+
assert_equal("44" , browser.text_field(:name , "vis1").value )
|
25
|
+
assert_equal("55" , browser.text_field(:name , "vis2").value )
|
26
|
+
|
27
|
+
# test using name and ID
|
28
|
+
assert( browser.hidden(:name ,"hid1").exists? )
|
29
|
+
assert( browser.hidden(:id,"hidden_1").exists? )
|
30
|
+
assert_false( browser.hidden(:name,"hidden_44").exists? )
|
31
|
+
assert_false( browser.hidden(:id,"hidden_55").exists? )
|
32
|
+
|
33
|
+
browser.hidden(:name ,"hid1").value = 444
|
34
|
+
browser.hidden(:id,"hidden_1").value = 555
|
35
|
+
|
36
|
+
browser.button(:value , "Show Hidden").click
|
37
|
+
|
38
|
+
assert_equal("444" , browser.text_field(:name , "vis1").value )
|
39
|
+
assert_equal("555" , browser.text_field(:name ,"vis2").value )
|
40
|
+
|
41
|
+
# test the over-ridden append method
|
42
|
+
browser.hidden(:name ,"hid1").append("a")
|
43
|
+
browser.button(:value , "Show Hidden").click
|
44
|
+
assert_equal("444a" , browser.text_field(:name , "vis1").value )
|
45
|
+
assert_equal("555" , browser.text_field(:name ,"vis2").value )
|
46
|
+
|
47
|
+
# test the over-ridden clear method
|
48
|
+
browser.hidden(:name ,"hid1").clear
|
49
|
+
browser.button(:value , "Show Hidden").click
|
50
|
+
assert_equal("" , browser.text_field(:name , "vis1").value )
|
51
|
+
assert_equal("555" , browser.text_field(:name ,"vis2").value )
|
52
|
+
|
53
|
+
# test using a form
|
54
|
+
assert( browser.form(:name , "has_a_hidden").hidden(:name ,"hid1").exists? )
|
55
|
+
assert( browser.form(:name , "has_a_hidden").hidden(:id,"hidden_1").exists? )
|
56
|
+
assert_false( browser.form(:name , "has_a_hidden").hidden(:name,"hidden_44").exists? )
|
57
|
+
assert_false( browser.form(:name , "has_a_hidden").hidden(:id,"hidden_55").exists? )
|
58
|
+
|
59
|
+
browser.form(:name , "has_a_hidden").hidden(:name ,"hid1").value = 222
|
60
|
+
browser.form(:name , "has_a_hidden").hidden(:id,"hidden_1").value = 333
|
61
|
+
|
62
|
+
browser.button(:value , "Show Hidden").click
|
63
|
+
|
64
|
+
assert_equal("222" , browser.text_field(:name , "vis1").value )
|
65
|
+
assert_equal("333" , browser.text_field(:name ,"vis2").value )
|
66
|
+
|
67
|
+
# iterators
|
68
|
+
assert_equal(2, browser.hiddens.length)
|
69
|
+
count =1
|
70
|
+
browser.hiddens.each do |h|
|
71
|
+
case count
|
72
|
+
when 1
|
73
|
+
assert_equal( "", h.id)
|
74
|
+
assert_equal( "hid1", h.name)
|
75
|
+
when 2
|
76
|
+
assert_equal( "", h.name)
|
77
|
+
assert_equal( "hidden_1", h.id)
|
78
|
+
end
|
79
|
+
count+=1
|
80
|
+
end
|
81
|
+
|
82
|
+
assert_equal("hid1" , browser.hiddens[1].name )
|
83
|
+
assert_equal("hidden_1" , browser.hiddens[2].id )
|
84
|
+
end
|
85
|
+
end
|