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
@@ -1,79 +1,79 @@
|
|
1
1
|
# feature tests for Links
|
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_Links_XPath < Test::Unit::TestCase
|
8
|
-
|
9
|
-
|
8
|
+
|
10
9
|
def setup()
|
11
|
-
|
10
|
+
goto_page("links1.html")
|
12
11
|
end
|
13
12
|
|
14
13
|
def xtest_new_link_exists
|
15
|
-
assert(exists?{
|
16
|
-
assert(exists?{
|
17
|
-
assert_false(exists?{
|
18
|
-
assert_false(exists?{
|
14
|
+
assert(exists?{browser.link(:xpath , "//a[contains(.,'test1')]")})
|
15
|
+
assert(exists?{browser.link(:xpath, "//a[contains(., /TEST/i)]")})
|
16
|
+
assert_false(exists?{browser.link(:xpath , "//a[contains(.,'missing')]")})
|
17
|
+
assert_false(exists?{browser.link(:xpath, "//a[contains(., /miss/)]")})
|
19
18
|
end
|
20
19
|
|
20
|
+
tag_method :test_element_by_xpath_class, :fails_on_ie
|
21
21
|
def test_element_by_xpath_class
|
22
22
|
# TODO: If element is not present this should return null
|
23
|
-
#element =
|
23
|
+
#element = browser.element_by_xpath("//a[contains(., /miss/)]")
|
24
24
|
#assert(element.instance_of?(Link),"element class should be #{Link}; got #{element.class}")
|
25
|
-
#element =
|
25
|
+
#element = browser.element_by_xpath("//a[contains(.,'missing')]")
|
26
26
|
#assert(element.instance_of?(Link),"element class should be #{Link}; got #{element.class}")
|
27
|
-
element =
|
28
|
-
|
29
|
-
element =
|
30
|
-
|
27
|
+
element = browser.element_by_xpath("//a[contains(., /TEST/i)]")
|
28
|
+
assert_class(element, 'Link')
|
29
|
+
element = browser.element_by_xpath("//a[contains(.,'test1')]")
|
30
|
+
assert_class(element, 'Link')
|
31
31
|
end
|
32
32
|
|
33
33
|
def test_element_by_xpath_behavior
|
34
34
|
# TODO implement this, acquiring objects through element_by_xpath and
|
35
35
|
# then testing their properties to see if they behave normally, as if
|
36
|
-
# they had been created with
|
36
|
+
# they had been created with browser.link
|
37
37
|
end
|
38
38
|
|
39
39
|
def test_Link_Exists
|
40
|
-
assert(
|
41
|
-
assert(
|
42
|
-
assert_false(
|
40
|
+
assert(browser.link(:xpath , "//a[contains(.,'test1')]").exists?)
|
41
|
+
assert(browser.link(:xpath, "//a[contains(., /TEST/i)]").exists?)
|
42
|
+
assert_false(browser.link(:xpath , "//a[contains(.,'missing')]").exists?)
|
43
43
|
|
44
|
-
assert_false(
|
44
|
+
assert_false(browser.link(:xpath , "//a[@url='alsomissing.html']").exists?)
|
45
45
|
|
46
|
-
assert(
|
47
|
-
assert_false(
|
46
|
+
assert(browser.link(:xpath , "//a[@id='link_id']").exists?)
|
47
|
+
assert_false(browser.link(:xpath , "//a[@id='alsomissing']").exists?)
|
48
48
|
|
49
|
-
assert(
|
50
|
-
assert_false(
|
51
|
-
assert(
|
49
|
+
assert(browser.link(:xpath , "//a[@name='link_name']").exists?)
|
50
|
+
assert_false(browser.link(:xpath , "//a[@name='alsomissing']").exists?)
|
51
|
+
assert(browser.link(:xpath , "//a[@title='link_title']").exists?)
|
52
52
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def test_Link_click
|
56
|
-
|
57
|
-
assert(
|
56
|
+
browser.link(:xpath , "//a[contains(.,'test1')]").click
|
57
|
+
assert( browser.text.include?("Links2-Pass") )
|
58
58
|
end
|
59
59
|
|
60
60
|
def test_link_properties
|
61
61
|
|
62
|
-
assert_match( /links2/
|
63
|
-
assert_equal( "" ,
|
64
|
-
assert_equal( "test1" ,
|
65
|
-
assert_equal( "" ,
|
66
|
-
assert_equal( "" ,
|
67
|
-
|
68
|
-
assert_equal( "" ,
|
69
|
-
assert_equal( "link_class_1" ,
|
62
|
+
assert_match( /links2/ ,browser.link(:xpath , "//a[contains(.,'test1')]").href )
|
63
|
+
assert_equal( "" , browser.link(:xpath , "//a[contains(.,'test1')]").value)
|
64
|
+
assert_equal( "test1" , browser.link(:xpath , "//a[contains(.,'test1')]").text )
|
65
|
+
assert_equal( "" , browser.link(:xpath , "//a[contains(.,'test1')]").name )
|
66
|
+
assert_equal( "" , browser.link(:xpath , "//a[contains(.,'test1')]").id )
|
67
|
+
assert_equal( false , browser.link(:xpath , "//a[contains(.,'test1')]").disabled )
|
68
|
+
assert_equal( "" , browser.link(:xpath , "//a[contains(.,'test1')]").class_name)
|
69
|
+
assert_equal( "link_class_1" , browser.link(:xpath , "//a[@class='link_class_1']").class_name)
|
70
70
|
|
71
|
-
assert_equal( "link_id" ,
|
72
|
-
assert_equal( "link_name" ,
|
71
|
+
assert_equal( "link_id" , browser.link(:xpath , "//a[@id='link_id']").id )
|
72
|
+
assert_equal( "link_name" , browser.link(:xpath , "//a[@name='link_name']").name )
|
73
73
|
|
74
|
-
assert_equal( "" ,
|
74
|
+
assert_equal( "" , browser.link(:xpath , "//a[@name='link_name']").title)
|
75
75
|
|
76
|
-
assert_equal( "link_title" ,
|
76
|
+
assert_equal( "link_title" , browser.link(:xpath , "//a[@title='link_title']").title)
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
@@ -1,19 +1,7 @@
|
|
1
|
-
# these are the tests that run reliably and invisibly
|
2
|
-
|
3
1
|
TOPDIR = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
4
2
|
$LOAD_PATH.unshift TOPDIR
|
5
|
-
|
6
|
-
puts $LOAD_PATH
|
7
|
-
require 'unittests/setup.rb'
|
3
|
+
require 'unittests/setup'
|
8
4
|
|
9
5
|
Dir.chdir TOPDIR
|
6
|
+
$all_tests.each {|x| require x }
|
10
7
|
|
11
|
-
#tests = ["unittests/test.rb",
|
12
|
-
# "unittests/test_xpath.rb"
|
13
|
-
# ]
|
14
|
-
|
15
|
-
#tests.each { |x| require x }
|
16
|
-
$core_tests.each {|x| require x }
|
17
|
-
|
18
|
-
#$HIDE_IE = true
|
19
|
-
#$ff.visible = false
|
data/unittests/pre_test.rb
CHANGED
@@ -1,63 +1,65 @@
|
|
1
1
|
# feature tests for Pre
|
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_Pre < Test::Unit::TestCase
|
8
|
-
|
8
|
+
|
9
9
|
|
10
10
|
def setup
|
11
|
-
|
11
|
+
goto_page("pre.html")
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_Pre_Count
|
15
|
-
assert(
|
15
|
+
assert( browser.pres.length == 3 )
|
16
16
|
end
|
17
17
|
|
18
18
|
def test_Pre_Exists
|
19
|
-
|
20
|
-
|
19
|
+
assert_false( browser.pre( :id, 'missingPre' ).exists? )
|
20
|
+
assert_false( browser.pre( :index, 33 ).exists? )
|
21
21
|
|
22
|
-
assert(
|
23
|
-
assert(
|
22
|
+
assert( browser.pre( :id, '1' ).exists? )
|
23
|
+
assert( browser.pre( :id, /[3-9]/ ).exists? )
|
24
24
|
|
25
|
-
|
25
|
+
assert_false( browser.pre( :id, /missing_pre/ ).exists? )
|
26
26
|
|
27
|
-
assert(
|
28
|
-
assert(
|
29
|
-
assert(
|
27
|
+
assert( browser.pre( :index, 1 ).exists? )
|
28
|
+
assert( browser.pre( :index, 2 ).exists? )
|
29
|
+
assert( browser.pre( :index, 3 ).exists? )
|
30
30
|
|
31
|
-
assert(
|
32
|
-
|
31
|
+
assert( browser.pre( :name, '3' ).exists? )
|
32
|
+
assert_false( browser.pre( :name, "name_missing" ).exists? )
|
33
33
|
end
|
34
34
|
|
35
35
|
def test_simple_access
|
36
|
-
pre =
|
36
|
+
pre = browser.pre( :index, 1 )
|
37
37
|
assert( pre.text.include?( "simple pre space" ) )
|
38
|
-
|
38
|
+
assert_false( pre.text.include?( "A second block" ) )
|
39
39
|
|
40
|
-
pre =
|
40
|
+
pre = browser.pre( :index, 2 )
|
41
41
|
assert( pre.text.include?( "A second block" ) )
|
42
|
-
|
43
|
-
|
44
|
-
|
42
|
+
assert_false( pre.text.include?( "this is the last block" ) )
|
43
|
+
end
|
44
|
+
|
45
|
+
tag_method :test_embedded_spaces, :fails_on_firefox # http://jira.openqa.org/browse/WTR-267
|
46
|
+
def test_embedded_spaces
|
47
|
+
pre = browser.pre( :index, 3 )
|
45
48
|
assert( pre.text.include?( "continue to work" ) )
|
46
|
-
|
47
|
-
|
49
|
+
assert_false( pre.text.include?( "Pre Tag Test" ) )
|
48
50
|
end
|
49
51
|
|
50
52
|
end
|
51
53
|
|
52
54
|
|
53
55
|
class TC_Pres_Display < Test::Unit::TestCase
|
54
|
-
include FireWatir
|
55
56
|
include MockStdoutTestCase
|
56
57
|
|
58
|
+
tag_method :test_showPres, :fails_on_ie
|
57
59
|
def test_showPres
|
58
|
-
|
60
|
+
goto_page("pre.html")
|
59
61
|
$stdout = @mockout
|
60
|
-
|
62
|
+
browser.showPres
|
61
63
|
assert_equal(<<END_OF_MESSAGE, @mockout)
|
62
64
|
There are 3 pres
|
63
65
|
pre: id: 1
|
data/unittests/radios_test.rb
CHANGED
@@ -1,164 +1,164 @@
|
|
1
1
|
# feature tests for Radio Buttons
|
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_Radios < Test::Unit::TestCase
|
8
|
-
|
8
|
+
|
9
9
|
|
10
10
|
def setup()
|
11
|
-
|
11
|
+
goto_page("radioButtons1.html")
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_Radio_Exists
|
15
|
-
assert(
|
16
|
-
assert(
|
15
|
+
assert(browser.radio(:name, "box1").exists?)
|
16
|
+
assert(browser.radio(:id, "box5").exists?)
|
17
17
|
|
18
|
-
assert_false(
|
19
|
-
assert_false(
|
18
|
+
assert_false(browser.radio(:name, "missingname").exists?)
|
19
|
+
assert_false(browser.radio(:id, "missingid").exists?)
|
20
20
|
end
|
21
21
|
|
22
22
|
def test_radio_class
|
23
|
-
assert_raises(UnknownObjectException
|
24
|
-
assert_equal("radio_style" ,
|
25
|
-
assert_equal("" ,
|
23
|
+
assert_raises(UnknownObjectException) { browser.radio(:name, "noName").class_name }
|
24
|
+
assert_equal("radio_style" , browser.radio(:name, "box1").class_name)
|
25
|
+
assert_equal("" , browser.radio(:id, "box5").class_name)
|
26
26
|
end
|
27
27
|
|
28
28
|
def test_Radio_Enabled
|
29
|
-
assert_raises(UnknownObjectException
|
30
|
-
assert_raises(UnknownObjectException
|
31
|
-
assert_raises(UnknownObjectException
|
29
|
+
assert_raises(UnknownObjectException) { browser.radio(:name, "noName").enabled? }
|
30
|
+
assert_raises(UnknownObjectException) { browser.radio(:id, "noName").enabled? }
|
31
|
+
assert_raises(UnknownObjectException) { browser.radio(:name, "box4" , 6).enabled? }
|
32
32
|
|
33
|
-
assert_false(
|
34
|
-
assert(
|
35
|
-
assert(
|
33
|
+
assert_false(browser.radio(:name, "box2").enabled?)
|
34
|
+
assert(browser.radio(:id, "box5").enabled?)
|
35
|
+
assert(browser.radio(:name, "box1").enabled?)
|
36
36
|
end
|
37
37
|
|
38
38
|
def test_little
|
39
|
-
assert_false(
|
39
|
+
assert_false(browser.button(:value , "foo").enabled?)
|
40
40
|
end
|
41
41
|
|
42
42
|
def test_onClick
|
43
43
|
|
44
|
-
assert_false(
|
45
|
-
assert_false(
|
44
|
+
assert_false(browser.radio(:name, "box5").isSet?)
|
45
|
+
assert_false(browser.button(:value , "foo").enabled?)
|
46
46
|
|
47
47
|
# first click the button is enabled and the radio is set
|
48
|
-
|
49
|
-
assert(
|
50
|
-
#assert(
|
48
|
+
browser.radio(:name, "box5" , 1).click
|
49
|
+
assert(browser.radio(:name, "box5",1).isSet?)
|
50
|
+
#assert(browser.button(:value , "foo").enabled?)
|
51
51
|
|
52
52
|
# second click the button is disabled and the radio is still set
|
53
|
-
|
54
|
-
assert(
|
55
|
-
assert_false(
|
53
|
+
browser.radio(:name, "box5", 1).click
|
54
|
+
assert(browser.radio(:name, "box5",1).isSet?)
|
55
|
+
assert_false(browser.button(:value , "foo").enabled?)
|
56
56
|
|
57
57
|
# third click the button is enabled and the radio is still set
|
58
|
-
|
59
|
-
assert(
|
60
|
-
assert(
|
58
|
+
browser.radio(:name, "box5", 1).click
|
59
|
+
assert(browser.radio(:name, "box5",1 ).isSet?)
|
60
|
+
assert(browser.button(:value , "foo").enabled?)
|
61
61
|
|
62
62
|
# click the radio with a value of 2 , button is disabled and the radio is still set
|
63
|
-
|
64
|
-
assert_false(
|
65
|
-
assert(
|
66
|
-
assert_false(
|
63
|
+
browser.radio(:name, "box5", 2).click
|
64
|
+
assert_false(browser.radio(:name, "box5" ,1).isSet?)
|
65
|
+
assert(browser.radio(:name, "box5" ,2).isSet?)
|
66
|
+
assert_false(browser.button(:value , "foo").enabled?)
|
67
67
|
end
|
68
68
|
|
69
69
|
def test_Radio_isSet
|
70
|
-
assert_raises(UnknownObjectException
|
70
|
+
assert_raises(UnknownObjectException) { browser.radio(:name, "noName").isSet? }
|
71
71
|
|
72
|
-
assert_false(
|
73
|
-
assert(
|
74
|
-
assert_false(
|
75
|
-
assert(
|
76
|
-
assert_false(
|
72
|
+
assert_false(browser.radio(:name, "box1").isSet?)
|
73
|
+
assert( browser.radio(:name, "box3").isSet?)
|
74
|
+
assert_false(browser.radio(:name, "box2").isSet?)
|
75
|
+
assert( browser.radio(:name, "box4" , 1 ).isSet?)
|
76
|
+
assert_false(browser.radio(:name, "box4" , 2 ).isSet?)
|
77
77
|
end
|
78
78
|
|
79
79
|
def test_radio_clear
|
80
|
-
assert_raises(UnknownObjectException
|
80
|
+
assert_raises(UnknownObjectException) { browser.radio(:name, "noName").clear }
|
81
81
|
|
82
|
-
|
83
|
-
assert_false(
|
82
|
+
browser.radio(:name, "box1").clear
|
83
|
+
assert_false(browser.radio(:name, "box1").isSet?)
|
84
84
|
|
85
|
-
assert_raises(ObjectDisabledException, "ObjectDisabledException was supposed to be thrown" ) {
|
86
|
-
assert_false(
|
85
|
+
assert_raises(ObjectDisabledException, "ObjectDisabledException was supposed to be thrown" ) { browser.radio(:name, "box2").clear }
|
86
|
+
assert_false(browser.radio(:name, "box2").isSet?)
|
87
87
|
|
88
|
-
|
89
|
-
assert_false(
|
88
|
+
browser.radio(:name, "box3").clear
|
89
|
+
assert_false(browser.radio(:name, "box3").isSet?)
|
90
90
|
|
91
|
-
|
92
|
-
assert_false(
|
91
|
+
browser.radio(:name, "box4" , 1).clear
|
92
|
+
assert_false(browser.radio(:name, "box4" , 1).isSet?)
|
93
93
|
end
|
94
94
|
|
95
95
|
def test_radio_getState
|
96
|
-
assert_raises(UnknownObjectException
|
96
|
+
assert_raises(UnknownObjectException) { browser.radio(:name, "noName").getState }
|
97
97
|
|
98
|
-
assert_equal( false ,
|
99
|
-
assert_equal( true ,
|
98
|
+
assert_equal( false , browser.radio(:name, "box1").getState )
|
99
|
+
assert_equal( true , browser.radio(:name, "box3").getState)
|
100
100
|
|
101
101
|
# radioes that have the same name but different values
|
102
|
-
assert_equal( false ,
|
103
|
-
assert_equal( true ,
|
102
|
+
assert_equal( false , browser.radio(:name, "box4" , 2).getState )
|
103
|
+
assert_equal( true , browser.radio(:name, "box4" , 1).getState)
|
104
104
|
end
|
105
105
|
|
106
106
|
def test_radio_set
|
107
|
-
assert_raises(UnknownObjectException
|
108
|
-
|
109
|
-
assert(
|
107
|
+
assert_raises(UnknownObjectException) { browser.radio(:name, "noName").set }
|
108
|
+
browser.radio(:name, "box1").set
|
109
|
+
assert(browser.radio(:name, "box1").isSet?)
|
110
110
|
|
111
|
-
assert_raises(ObjectDisabledException, "ObjectDisabledException was supposed to be thrown" ) {
|
111
|
+
assert_raises(ObjectDisabledException, "ObjectDisabledException was supposed to be thrown" ) { browser.radio(:name, "box2").set }
|
112
112
|
|
113
|
-
|
114
|
-
assert(
|
113
|
+
browser.radio(:name, "box3").set
|
114
|
+
assert(browser.radio(:name, "box3").isSet?)
|
115
115
|
|
116
116
|
# radioes that have the same name but different values
|
117
|
-
|
118
|
-
assert(
|
117
|
+
browser.radio(:name, "box4" , 3).set
|
118
|
+
assert(browser.radio(:name, "box4" , 3).isSet?)
|
119
119
|
end
|
120
120
|
|
121
121
|
def test_radio_properties
|
122
122
|
|
123
|
-
assert_raises(UnknownObjectException , "UnknownObjectException was supposed to be thrown" ) {
|
124
|
-
assert_raises(UnknownObjectException , "UnknownObjectException was supposed to be thrown" ) {
|
125
|
-
assert_raises(UnknownObjectException , "UnknownObjectException was supposed to be thrown" ) {
|
126
|
-
assert_raises(UnknownObjectException , "UnknownObjectException was supposed to be thrown" ) {
|
127
|
-
assert_raises(UnknownObjectException , "UnknownObjectException was supposed to be thrown" ) {
|
123
|
+
assert_raises(UnknownObjectException , "UnknownObjectException was supposed to be thrown" ) { browser.radio(:index, 199).value}
|
124
|
+
assert_raises(UnknownObjectException , "UnknownObjectException was supposed to be thrown" ) { browser.radio(:index, 199).name }
|
125
|
+
assert_raises(UnknownObjectException , "UnknownObjectException was supposed to be thrown" ) { browser.radio(:index, 199).id }
|
126
|
+
assert_raises(UnknownObjectException , "UnknownObjectException was supposed to be thrown" ) { browser.radio(:index, 199).disabled }
|
127
|
+
assert_raises(UnknownObjectException , "UnknownObjectException was supposed to be thrown" ) { browser.radio(:index, 199).type }
|
128
128
|
|
129
|
-
assert_equal("on" ,
|
130
|
-
assert_equal("box1" ,
|
131
|
-
assert_equal("" ,
|
132
|
-
assert_equal("radio",
|
129
|
+
assert_equal("on" , browser.radio(:index, 1).value)
|
130
|
+
assert_equal("box1" , browser.radio(:index, 1).name )
|
131
|
+
assert_equal("" , browser.radio(:index, 1).id )
|
132
|
+
assert_equal("radio", browser.radio(:index, 1).type )
|
133
133
|
|
134
|
-
assert_equal( false,
|
135
|
-
assert_equal( true,
|
134
|
+
assert_equal( false, browser.radio(:index, 1).disabled )
|
135
|
+
assert_equal( true, browser.radio(:index, 3).disabled )
|
136
136
|
|
137
|
-
assert_equal("box5" ,
|
138
|
-
assert_equal("" ,
|
137
|
+
assert_equal("box5" , browser.radio(:index, 2).id )
|
138
|
+
assert_equal("" , browser.radio(:index, 2).name )
|
139
139
|
|
140
|
-
assert_equal("box4-value5",
|
141
|
-
assert_equal("",
|
140
|
+
assert_equal("box4-value5", browser.radio(:name , "box4" , 5 ).title )
|
141
|
+
assert_equal("", browser.radio(:name , "box4" , 4 ).title )
|
142
142
|
|
143
143
|
|
144
144
|
end
|
145
145
|
|
146
146
|
def test_radio_iterators
|
147
147
|
|
148
|
-
assert_equal(11,
|
149
|
-
assert_equal("box5" ,
|
150
|
-
assert_equal(true ,
|
151
|
-
assert_equal(false ,
|
148
|
+
assert_equal(11, browser.radios.length)
|
149
|
+
assert_equal("box5" , browser.radios[2].id )
|
150
|
+
assert_equal(true , browser.radios[3].disabled )
|
151
|
+
assert_equal(false , browser.radios[1].disabled )
|
152
152
|
index = 1
|
153
|
-
|
154
|
-
assert_equal(
|
155
|
-
assert_equal(
|
156
|
-
assert_equal(
|
157
|
-
assert_equal(
|
158
|
-
assert_equal(
|
153
|
+
browser.radios.each do |r|
|
154
|
+
assert_equal( browser.radio(:index, index).name , r.name )
|
155
|
+
assert_equal( browser.radio(:index, index).id , r.id )
|
156
|
+
assert_equal( browser.radio(:index, index).value, r.value)
|
157
|
+
assert_equal( browser.radio(:index, index).disabled , r.disabled )
|
158
|
+
assert_equal( browser.radio(:index, index).isSet? , r.isSet? )
|
159
159
|
index+=1
|
160
160
|
end
|
161
|
-
assert_equal(index -1,
|
161
|
+
assert_equal(index -1, browser.radios.length)
|
162
162
|
end
|
163
163
|
|
164
164
|
|