celerity 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +10 -0
- data/README.txt +8 -11
- data/Rakefile +5 -3
- data/benchmark/bm_2000_spans.rb +48 -0
- data/benchmark/bm_digg.rb +26 -0
- data/benchmark/bm_google_images.rb +36 -0
- data/benchmark/bm_input_locator.rb +69 -0
- data/benchmark/loader.rb +9 -0
- data/lib/celerity.rb +3 -1
- data/lib/celerity/container.rb +23 -171
- data/lib/celerity/disabled_element.rb +1 -1
- data/lib/celerity/element.rb +78 -47
- data/lib/celerity/element_collections.rb +16 -32
- data/lib/celerity/element_locator.rb +135 -0
- data/lib/celerity/elements/button.rb +15 -0
- data/lib/celerity/elements/file_field.rb +1 -1
- data/lib/celerity/elements/form.rb +2 -1
- data/lib/celerity/elements/frame.rb +18 -21
- data/lib/celerity/elements/image.rb +2 -8
- data/lib/celerity/elements/label.rb +1 -3
- data/lib/celerity/elements/link.rb +1 -1
- data/lib/celerity/elements/option.rb +16 -0
- data/lib/celerity/elements/radio_check.rb +18 -7
- data/lib/celerity/elements/select_list.rb +1 -17
- data/lib/celerity/elements/table.rb +4 -4
- data/lib/celerity/elements/table_body.rb +6 -8
- data/lib/celerity/elements/table_cell.rb +3 -14
- data/lib/celerity/elements/table_row.rb +4 -10
- data/lib/celerity/elements/text_field.rb +16 -4
- data/lib/celerity/extra/method_generator.rb +144 -0
- data/lib/celerity/identifier.rb +10 -0
- data/lib/celerity/ie.rb +28 -13
- data/lib/celerity/input_element.rb +0 -4
- data/lib/celerity/non_control_elements.rb +12 -12
- data/lib/celerity/version.rb +1 -1
- data/spec/area_spec.rb +41 -41
- data/spec/areas_spec.rb +11 -11
- data/spec/button_spec.rb +73 -68
- data/spec/buttons_spec.rb +10 -10
- data/spec/checkbox_spec.rb +102 -96
- data/spec/checkboxes_spec.rb +10 -10
- data/spec/div_spec.rb +78 -73
- data/spec/divs_spec.rb +10 -10
- data/spec/element_spec.rb +20 -11
- data/spec/filefield_spec.rb +36 -41
- data/spec/filefields_spec.rb +10 -10
- data/spec/form_spec.rb +29 -29
- data/spec/forms_spec.rb +11 -11
- data/spec/frame_spec.rb +54 -49
- data/spec/hidden_spec.rb +43 -43
- data/spec/hiddens_spec.rb +10 -10
- data/spec/html/2000_spans.html +2009 -0
- data/spec/html/forms_with_input_elements.html +15 -9
- data/spec/html/non_control_elements.html +4 -2
- data/spec/ie_spec.rb +82 -48
- data/spec/image_spec.rb +83 -100
- data/spec/images_spec.rb +10 -10
- data/spec/label_spec.rb +29 -29
- data/spec/labels_spec.rb +10 -10
- data/spec/li_spec.rb +41 -41
- data/spec/link_spec.rb +65 -59
- data/spec/links_spec.rb +11 -11
- data/spec/lis_spec.rb +10 -10
- data/spec/map_spec.rb +30 -30
- data/spec/maps_spec.rb +10 -10
- data/spec/p_spec.rb +49 -49
- data/spec/pre_spec.rb +41 -41
- data/spec/pres_spec.rb +10 -10
- data/spec/ps_spec.rb +10 -10
- data/spec/radio_spec.rb +104 -97
- data/spec/radios_spec.rb +11 -11
- data/spec/select_list_spec.rb +118 -106
- data/spec/select_lists_spec.rb +15 -15
- data/spec/span_spec.rb +54 -54
- data/spec/spans_spec.rb +11 -11
- data/spec/spec.opts +1 -1
- data/spec/spec_helper.rb +23 -3
- data/spec/table_bodies.rb +8 -8
- data/spec/table_bodies_spec.rb +9 -9
- data/spec/table_body_spec.rb +28 -27
- data/spec/table_cell_spec.rb +25 -25
- data/spec/table_cells_spec.rb +16 -16
- data/spec/table_row_spec.rb +16 -16
- data/spec/table_rows_spec.rb +12 -12
- data/spec/table_spec.rb +36 -36
- data/spec/tables_spec.rb +12 -12
- data/spec/text_field_spec.rb +111 -92
- data/spec/text_fields_spec.rb +13 -13
- data/tasks/benchmark.rake +3 -0
- data/tasks/rspec.rake +2 -2
- data/tasks/testserver.rake +15 -0
- metadata +58 -46
- data/tasks/simple_ci.rake +0 -94
data/spec/links_spec.rb
CHANGED
@@ -2,41 +2,41 @@ require File.dirname(__FILE__) + '/spec_helper.rb'
|
|
2
2
|
|
3
3
|
describe "Links" do
|
4
4
|
before :all do
|
5
|
-
@
|
6
|
-
add_spec_checker(@
|
5
|
+
@browser = IE.new
|
6
|
+
add_spec_checker(@browser)
|
7
7
|
end
|
8
8
|
|
9
9
|
before :each do
|
10
|
-
@
|
10
|
+
@browser.goto(TEST_HOST + "/non_control_elements.html")
|
11
11
|
end
|
12
12
|
|
13
13
|
describe "#length" do
|
14
14
|
it "should return the number of links" do
|
15
|
-
@
|
15
|
+
@browser.links.length.should == 3
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
19
|
describe "#[]" do
|
20
20
|
it "should return the link at the given index" do
|
21
|
-
@
|
21
|
+
@browser.links[3].id.should == "link_3"
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
25
|
describe "#each" do
|
26
26
|
it "should iterate through links correctly" do
|
27
27
|
index = 1
|
28
|
-
@
|
29
|
-
c.name.should == @
|
30
|
-
c.id.should == @
|
31
|
-
c.value.should == @
|
28
|
+
@browser.links.each do |c|
|
29
|
+
c.name.should == @browser.link(:index, index).name
|
30
|
+
c.id.should == @browser.link(:index, index).id
|
31
|
+
c.value.should == @browser.link(:index, index).value
|
32
32
|
index += 1
|
33
33
|
end
|
34
|
-
@
|
34
|
+
@browser.links.length.should == index - 1
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
38
|
after :all do
|
39
|
-
@
|
39
|
+
@browser.close
|
40
40
|
end
|
41
41
|
|
42
42
|
end
|
data/spec/lis_spec.rb
CHANGED
@@ -2,38 +2,38 @@ require File.dirname(__FILE__) + '/spec_helper.rb'
|
|
2
2
|
|
3
3
|
describe "Lis" do
|
4
4
|
before :all do
|
5
|
-
@
|
6
|
-
add_spec_checker(@
|
5
|
+
@browser = IE.new
|
6
|
+
add_spec_checker(@browser)
|
7
7
|
end
|
8
8
|
|
9
9
|
before :each do
|
10
|
-
@
|
10
|
+
@browser.goto(TEST_HOST + "/non_control_elements.html")
|
11
11
|
end
|
12
12
|
|
13
13
|
describe "#length" do
|
14
14
|
it "should return the number of lis" do
|
15
|
-
@
|
15
|
+
@browser.lis.length.should == 7
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
19
|
describe "#[]" do
|
20
20
|
it "should return the p at the given index" do
|
21
|
-
@
|
21
|
+
@browser.lis[5].id.should == "non_link_1"
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
25
|
describe "#each" do
|
26
26
|
it "should iterate through lis correctly" do
|
27
|
-
@
|
28
|
-
l.name.should == @
|
29
|
-
l.id.should == @
|
30
|
-
l.value.should == @
|
27
|
+
@browser.lis.each_with_index do |l, index|
|
28
|
+
l.name.should == @browser.li(:index, index+1).name
|
29
|
+
l.id.should == @browser.li(:index, index+1).id
|
30
|
+
l.value.should == @browser.li(:index, index+1).value
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
35
|
after :all do
|
36
|
-
@
|
36
|
+
@browser.close
|
37
37
|
end
|
38
38
|
|
39
39
|
end
|
data/spec/map_spec.rb
CHANGED
@@ -3,81 +3,81 @@ require File.dirname(__FILE__) + '/spec_helper.rb'
|
|
3
3
|
describe "P" do
|
4
4
|
|
5
5
|
before :all do
|
6
|
-
@
|
7
|
-
add_spec_checker(@
|
6
|
+
@browser = IE.new
|
7
|
+
add_spec_checker(@browser)
|
8
8
|
end
|
9
9
|
|
10
10
|
before :each do
|
11
|
-
@
|
11
|
+
@browser.goto(TEST_HOST + "/images.html")
|
12
12
|
end
|
13
13
|
|
14
14
|
# Exists method
|
15
15
|
describe "#exist?" do
|
16
16
|
it "should return true if the 'map' exists" do
|
17
|
-
@
|
18
|
-
@
|
19
|
-
@
|
20
|
-
@
|
21
|
-
@
|
22
|
-
@
|
17
|
+
@browser.map(:id, "triangle_map").should exist
|
18
|
+
@browser.map(:id, /triangle_map/).should exist
|
19
|
+
@browser.map(:name, "triangle_map").should exist
|
20
|
+
@browser.map(:name, /triangle_map/).should exist
|
21
|
+
@browser.map(:index, 1).should exist
|
22
|
+
@browser.map(:xpath, "//map[@id='triangle_map']").should exist
|
23
23
|
end
|
24
24
|
it "should return false if the 'map' doesn't exist" do
|
25
|
-
@
|
26
|
-
@
|
27
|
-
@
|
28
|
-
@
|
29
|
-
@
|
30
|
-
@
|
25
|
+
@browser.map(:id, "no_such_id").should_not exist
|
26
|
+
@browser.map(:id, /no_such_id/).should_not exist
|
27
|
+
@browser.map(:name, "no_such_id").should_not exist
|
28
|
+
@browser.map(:name, /no_such_id/).should_not exist
|
29
|
+
@browser.map(:index, 1337).should_not exist
|
30
|
+
@browser.map(:xpath, "//map[@id='no_such_id']").should_not exist
|
31
31
|
end
|
32
|
-
it "should raise ArgumentError when what argument is invalid" do
|
33
|
-
lambda { @
|
32
|
+
it "should raise ArgumentError when 'what' argument is invalid" do
|
33
|
+
lambda { @browser.map(:id, 3.14).exists? }.should raise_error(ArgumentError)
|
34
34
|
end
|
35
|
-
it "should raise MissingWayOfFindingObjectException when how argument is invalid" do
|
36
|
-
lambda { @
|
35
|
+
it "should raise MissingWayOfFindingObjectException when 'how' argument is invalid" do
|
36
|
+
lambda { @browser.map(:no_such_how, 'some_value').exists? }.should raise_error(MissingWayOfFindingObjectException)
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
40
|
# Attribute methods
|
41
41
|
describe "#id" do
|
42
42
|
it "should return the id attribute" do
|
43
|
-
@
|
43
|
+
@browser.map(:index, 1).id.should == "triangle_map"
|
44
44
|
end
|
45
45
|
it "should return an empty string if the element exists and the attribute doesn't" do
|
46
|
-
@
|
46
|
+
@browser.map(:index, 2).id.should == ''
|
47
47
|
end
|
48
48
|
it "should raise UnknownObjectException if the p doesn't exist" do
|
49
|
-
lambda { @
|
50
|
-
lambda { @
|
49
|
+
lambda { @browser.map(:id, "no_such_id").id }.should raise_error(UnknownObjectException)
|
50
|
+
lambda { @browser.map(:index, 1337).id }.should raise_error(UnknownObjectException)
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
54
|
describe "#name" do
|
55
55
|
it "should return the name attribute" do
|
56
|
-
@
|
56
|
+
@browser.map(:index, 1).name.should == "triangle_map"
|
57
57
|
end
|
58
58
|
it "should return an empty string if the element exists and the attribute doesn't" do
|
59
|
-
@
|
59
|
+
@browser.map(:index, 2).name.should == ''
|
60
60
|
end
|
61
61
|
it "should raise UnknownObjectException if the p doesn't exist" do
|
62
|
-
lambda { @
|
63
|
-
lambda { @
|
62
|
+
lambda { @browser.map(:id, "no_such_id").name }.should raise_error(UnknownObjectException)
|
63
|
+
lambda { @browser.map(:index, 1337).name }.should raise_error(UnknownObjectException)
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
67
|
# Other
|
68
68
|
describe "#to_s" do
|
69
69
|
it "should return a human readable representation of the element" do
|
70
|
-
@
|
70
|
+
@browser.map(:index, 1).to_s.should == "tag: map\n" +
|
71
71
|
" id: triangle_map\n" +
|
72
72
|
" name: triangle_map"
|
73
73
|
end
|
74
74
|
it "should raise UnknownObjectException if the p doesn't exist" do
|
75
|
-
lambda { @
|
75
|
+
lambda { @browser.map(:xpath, "//map[@id='no_such_id']").to_s }.should raise_error( UnknownObjectException)
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
79
|
after :all do
|
80
|
-
@
|
80
|
+
@browser.close
|
81
81
|
end
|
82
82
|
|
83
83
|
end
|
data/spec/maps_spec.rb
CHANGED
@@ -3,38 +3,38 @@ require File.dirname(__FILE__) + '/spec_helper.rb'
|
|
3
3
|
describe "Maps" do
|
4
4
|
|
5
5
|
before :all do
|
6
|
-
@
|
7
|
-
add_spec_checker(@
|
6
|
+
@browser = IE.new
|
7
|
+
add_spec_checker(@browser)
|
8
8
|
end
|
9
9
|
|
10
10
|
before :each do
|
11
|
-
@
|
11
|
+
@browser.goto(TEST_HOST + "/images.html")
|
12
12
|
end
|
13
13
|
|
14
14
|
describe "#length" do
|
15
15
|
it "should return the number of maps" do
|
16
|
-
@
|
16
|
+
@browser.maps.length.should == 2
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
describe "#[]" do
|
21
21
|
it "should return the p at the given index" do
|
22
|
-
@
|
22
|
+
@browser.maps[1].id.should == "triangle_map"
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
26
|
describe "#each" do
|
27
27
|
it "should iterate through maps correctly" do
|
28
|
-
@
|
29
|
-
m.name.should == @
|
30
|
-
m.id.should == @
|
31
|
-
m.value.should == @
|
28
|
+
@browser.maps.each_with_index do |m, index|
|
29
|
+
m.name.should == @browser.map(:index, index+1).name
|
30
|
+
m.id.should == @browser.map(:index, index+1).id
|
31
|
+
m.value.should == @browser.map(:index, index+1).value
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
36
|
after :all do
|
37
|
-
@
|
37
|
+
@browser.close
|
38
38
|
end
|
39
39
|
|
40
40
|
end
|
data/spec/p_spec.rb
CHANGED
@@ -3,138 +3,138 @@ require File.dirname(__FILE__) + '/spec_helper.rb'
|
|
3
3
|
describe "P" do
|
4
4
|
|
5
5
|
before :all do
|
6
|
-
@
|
7
|
-
add_spec_checker(@
|
6
|
+
@browser = IE.new
|
7
|
+
add_spec_checker(@browser)
|
8
8
|
end
|
9
9
|
|
10
10
|
before :each do
|
11
|
-
@
|
11
|
+
@browser.goto(TEST_HOST + "/non_control_elements.html")
|
12
12
|
end
|
13
13
|
|
14
14
|
# Exists method
|
15
15
|
describe "#exist?" do
|
16
16
|
it "should return true if the 'p' exists" do
|
17
|
-
@
|
18
|
-
@
|
19
|
-
@
|
20
|
-
@
|
21
|
-
@
|
22
|
-
@
|
23
|
-
@
|
24
|
-
@
|
17
|
+
@browser.p(:id, "lead").should exist
|
18
|
+
@browser.p(:id, /lead/).should exist
|
19
|
+
@browser.p(:text, "Dubito, ergo cogito, ergo sum.").should exist
|
20
|
+
@browser.p(:text, /Dubito, ergo cogito, ergo sum/).should exist
|
21
|
+
@browser.p(:class, "lead").should exist
|
22
|
+
@browser.p(:class, /lead/).should exist
|
23
|
+
@browser.p(:index, 1).should exist
|
24
|
+
@browser.p(:xpath, "//p[@id='lead']").should exist
|
25
25
|
end
|
26
26
|
it "should return false if the 'p' doesn't exist" do
|
27
|
-
@
|
28
|
-
@
|
29
|
-
@
|
30
|
-
@
|
31
|
-
@
|
32
|
-
@
|
33
|
-
@
|
34
|
-
@
|
27
|
+
@browser.p(:id, "no_such_id").should_not exist
|
28
|
+
@browser.p(:id, /no_such_id/).should_not exist
|
29
|
+
@browser.p(:text, "no_such_text").should_not exist
|
30
|
+
@browser.p(:text, /no_such_text/).should_not exist
|
31
|
+
@browser.p(:class, "no_such_class").should_not exist
|
32
|
+
@browser.p(:class, /no_such_class/).should_not exist
|
33
|
+
@browser.p(:index, 1337).should_not exist
|
34
|
+
@browser.p(:xpath, "//p[@id='no_such_id']").should_not exist
|
35
35
|
end
|
36
|
-
it "should raise ArgumentError when what argument is invalid" do
|
37
|
-
lambda { @
|
36
|
+
it "should raise ArgumentError when 'what' argument is invalid" do
|
37
|
+
lambda { @browser.p(:id, 3.14).exists? }.should raise_error(ArgumentError)
|
38
38
|
end
|
39
|
-
it "should raise MissingWayOfFindingObjectException when how argument is invalid" do
|
40
|
-
lambda { @
|
39
|
+
it "should raise MissingWayOfFindingObjectException when 'how' argument is invalid" do
|
40
|
+
lambda { @browser.p(:no_such_how, 'some_value').exists? }.should raise_error(MissingWayOfFindingObjectException)
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
44
|
# Attribute methods
|
45
45
|
describe "#class_name" do
|
46
46
|
it "should return the class attribute" do
|
47
|
-
@
|
47
|
+
@browser.p(:index, 1).class_name.should == 'lead'
|
48
48
|
end
|
49
49
|
it "should return an empty string if the element exists and the attribute doesn't" do
|
50
|
-
@
|
50
|
+
@browser.p(:index, 3).class_name.should == ''
|
51
51
|
end
|
52
52
|
it "should raise UnknownObjectException if the p doesn't exist" do
|
53
|
-
lambda { @
|
53
|
+
lambda { @browser.p(:id, 'no_such_id').class_name }.should raise_error(UnknownObjectException)
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
57
|
describe "#id" do
|
58
58
|
it "should return the id attribute" do
|
59
|
-
@
|
59
|
+
@browser.p(:index, 1).id.should == "lead"
|
60
60
|
end
|
61
61
|
it "should return an empty string if the element exists and the attribute doesn't" do
|
62
|
-
@
|
62
|
+
@browser.p(:index, 3).id.should == ''
|
63
63
|
end
|
64
64
|
it "should raise UnknownObjectException if the p doesn't exist" do
|
65
|
-
lambda { @
|
66
|
-
lambda { @
|
65
|
+
lambda { @browser.p(:id, "no_such_id").id }.should raise_error(UnknownObjectException)
|
66
|
+
lambda { @browser.p(:index, 1337).id }.should raise_error(UnknownObjectException)
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
70
|
describe "#name" do
|
71
71
|
it "should return the name attribute" do
|
72
|
-
@
|
72
|
+
@browser.p(:index, 2).name.should == "invalid_attribute"
|
73
73
|
end
|
74
74
|
it "should return an empty string if the element exists and the attribute doesn't" do
|
75
|
-
@
|
75
|
+
@browser.p(:index, 3).name.should == ''
|
76
76
|
end
|
77
77
|
it "should raise UnknownObjectException if the p doesn't exist" do
|
78
|
-
lambda { @
|
79
|
-
lambda { @
|
78
|
+
lambda { @browser.p(:id, "no_such_id").name }.should raise_error(UnknownObjectException)
|
79
|
+
lambda { @browser.p(:index, 1337).name }.should raise_error(UnknownObjectException)
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
83
|
describe "#title" do
|
84
84
|
it "should return the title attribute" do
|
85
|
-
@
|
85
|
+
@browser.p(:index, 1).title.should == 'Lorem ipsum'
|
86
86
|
end
|
87
87
|
it "should return an empty string if the element exists and the attribute doesn't" do
|
88
|
-
@
|
88
|
+
@browser.p(:index, 3).title.should == ''
|
89
89
|
end
|
90
90
|
it "should raise UnknownObjectException if the p doesn't exist" do
|
91
|
-
lambda { @
|
92
|
-
lambda { @
|
91
|
+
lambda { @browser.p(:id, 'no_such_id').title }.should raise_error( UnknownObjectException)
|
92
|
+
lambda { @browser.p(:xpath, "//p[@id='no_such_id']").title }.should raise_error( UnknownObjectException)
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
96
96
|
describe "#text" do
|
97
97
|
it "should return the text of the p" do
|
98
|
-
@
|
98
|
+
@browser.p(:index, 2).text.should == 'Sed pretium metus et quam. Nullam odio dolor, vestibulum non, tempor ut, vehicula sed, sapien. Vestibulum placerat ligula at quam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.'
|
99
99
|
end
|
100
100
|
it "should return an empty string if the element doesn't contain any text" do
|
101
|
-
@
|
101
|
+
@browser.p(:index, 5).text.should == ''
|
102
102
|
end
|
103
103
|
it "should raise UnknownObjectException if the p doesn't exist" do
|
104
|
-
lambda { @
|
105
|
-
lambda { @
|
104
|
+
lambda { @browser.p(:id, 'no_such_id').text }.should raise_error( UnknownObjectException)
|
105
|
+
lambda { @browser.p(:xpath , "//p[@id='no_such_id']").text }.should raise_error( UnknownObjectException)
|
106
106
|
end
|
107
107
|
end
|
108
108
|
|
109
109
|
describe "#value" do
|
110
110
|
it "should return the value attribute" do
|
111
|
-
@
|
111
|
+
@browser.p(:index, 2).value.should == "invalid_attribute"
|
112
112
|
end
|
113
113
|
it "should return an empty string if the element exists and the attribute doesn't" do
|
114
|
-
@
|
114
|
+
@browser.p(:index, 3).value.should == ''
|
115
115
|
end
|
116
116
|
it "should raise UnknownObjectException if the p doesn't exist" do
|
117
|
-
lambda { @
|
118
|
-
lambda { @
|
117
|
+
lambda { @browser.p(:id , "no_such_id").value }.should raise_error(UnknownObjectException)
|
118
|
+
lambda { @browser.p(:index , 1337).value }.should raise_error(UnknownObjectException)
|
119
119
|
end
|
120
120
|
end
|
121
121
|
|
122
122
|
# Other
|
123
123
|
describe "#to_s" do
|
124
124
|
it "should return a human readable representation of the element" do
|
125
|
-
@
|
125
|
+
@browser.p(:index, 1).to_s.should == "tag: p\n" +
|
126
126
|
" id: lead\n" +
|
127
127
|
" class: lead\n" +
|
128
128
|
" title: Lorem ipsum\n" +
|
129
129
|
" text: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Curabitur eu pede. Ut justo. Praesent feugiat, elit in feugiat iaculis, sem risus rutrum justo, eget fermentum dolor arcu non nunc."
|
130
130
|
end
|
131
131
|
it "should raise UnknownObjectException if the p doesn't exist" do
|
132
|
-
lambda { @
|
132
|
+
lambda { @browser.p(:xpath, "//p[@id='no_such_id']").to_s }.should raise_error( UnknownObjectException)
|
133
133
|
end
|
134
134
|
end
|
135
135
|
|
136
136
|
after :all do
|
137
|
-
@
|
137
|
+
@browser.close
|
138
138
|
end
|
139
139
|
|
140
140
|
end
|