watir-webdriver 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +9 -1
- data/Rakefile +2 -1
- data/VERSION +1 -1
- data/lib/watir-webdriver.rb +6 -7
- data/lib/watir-webdriver/attribute_helper.rb +17 -10
- data/lib/watir-webdriver/browser.rb +1 -1
- data/lib/watir-webdriver/cell_container.rb +19 -0
- data/lib/watir-webdriver/container.rb +8 -0
- data/lib/watir-webdriver/element_collection.rb +2 -2
- data/lib/watir-webdriver/elements/button.rb +3 -2
- data/lib/watir-webdriver/elements/element.rb +41 -1
- data/lib/watir-webdriver/elements/generated.rb +3 -3
- data/lib/watir-webdriver/elements/input.rb +0 -52
- data/lib/watir-webdriver/elements/select.rb +0 -1
- data/lib/watir-webdriver/elements/table.rb +26 -4
- data/lib/watir-webdriver/elements/table_cell.rb +36 -0
- data/lib/watir-webdriver/elements/table_row.rb +23 -14
- data/lib/watir-webdriver/elements/table_section.rb +9 -0
- data/lib/watir-webdriver/extensions/alerts.rb +69 -0
- data/lib/watir-webdriver/extensions/performance.rb +54 -0
- data/lib/watir-webdriver/locators/button_locator.rb +3 -5
- data/lib/watir-webdriver/locators/{table_row_locator.rb → child_cell_locator.rb} +11 -6
- data/lib/watir-webdriver/locators/child_row_locator.rb +37 -0
- data/lib/watir-webdriver/locators/element_locator.rb +24 -14
- data/lib/watir-webdriver/row_container.rb +19 -0
- data/lib/watir-webdriver/window_switching.rb +37 -10
- data/spec/alert_spec.rb +49 -0
- data/spec/element_locator_spec.rb +15 -16
- data/spec/element_spec.rb +0 -32
- data/spec/html/alerts.html +11 -0
- data/spec/input_spec.rb +8 -46
- data/spec/locator_spec_helper.rb +19 -5
- data/spec/spec_helper.rb +3 -0
- data/spec/watirspec/areas_spec.rb +8 -0
- data/spec/watirspec/browser_spec.rb +4 -4
- data/spec/watirspec/button_spec.rb +3 -4
- data/spec/watirspec/buttons_spec.rb +8 -0
- data/spec/watirspec/checkboxes_spec.rb +8 -0
- data/spec/watirspec/dds_spec.rb +8 -0
- data/spec/watirspec/dels_spec.rb +8 -0
- data/spec/watirspec/divs_spec.rb +8 -0
- data/spec/watirspec/dls_spec.rb +8 -0
- data/spec/watirspec/dts_spec.rb +8 -0
- data/spec/watirspec/element_spec.rb +71 -2
- data/spec/watirspec/ems_spec.rb +8 -0
- data/spec/watirspec/filefield_spec.rb +16 -11
- data/spec/watirspec/filefields_spec.rb +8 -0
- data/spec/watirspec/font_spec.rb +21 -19
- data/spec/watirspec/form_spec.rb +5 -3
- data/spec/watirspec/forms_spec.rb +11 -5
- data/spec/watirspec/frames_spec.rb +8 -0
- data/spec/watirspec/hiddens_spec.rb +8 -0
- data/spec/watirspec/hns_spec.rb +8 -0
- data/spec/watirspec/images_spec.rb +8 -0
- data/spec/watirspec/inses_spec.rb +8 -0
- data/spec/watirspec/label_spec.rb +2 -0
- data/spec/watirspec/labels_spec.rb +8 -0
- data/spec/watirspec/lib/server.rb +19 -1
- data/spec/watirspec/lib/spec_helper.rb +1 -1
- data/spec/watirspec/links_spec.rb +8 -0
- data/spec/watirspec/lis_spec.rb +8 -0
- data/spec/watirspec/maps_spec.rb +8 -0
- data/spec/watirspec/metas_spec.rb +8 -0
- data/spec/watirspec/ols_spec.rb +8 -0
- data/spec/watirspec/pres_spec.rb +8 -0
- data/spec/watirspec/ps_spec.rb +8 -0
- data/spec/watirspec/radios_spec.rb +8 -0
- data/spec/watirspec/select_list_spec.rb +6 -6
- data/spec/watirspec/select_lists_spec.rb +8 -0
- data/spec/watirspec/spans_spec.rb +8 -0
- data/spec/watirspec/strongs_spec.rb +8 -0
- data/spec/watirspec/table_nesting_spec.rb +50 -0
- data/spec/watirspec/table_spec.rb +62 -102
- data/spec/watirspec/tables_spec.rb +8 -0
- data/spec/watirspec/{table_body_spec.rb → tbody_spec.rb} +21 -31
- data/spec/watirspec/{table_bodies_spec.rb → tbodys_spec.rb} +8 -0
- data/spec/watirspec/td_spec.rb +72 -0
- data/spec/watirspec/{table_cells_spec.rb → tds_spec.rb} +18 -25
- data/spec/watirspec/text_fields_spec.rb +8 -0
- data/spec/watirspec/{table_footer_spec.rb → tfoot_spec.rb} +21 -28
- data/spec/watirspec/{table_footers_spec.rb → tfoots_spec.rb} +8 -0
- data/spec/watirspec/{table_header_spec.rb → thead_spec.rb} +21 -29
- data/spec/watirspec/{table_headers_spec.rb → theads_spec.rb} +8 -0
- data/spec/watirspec/tr_spec.rb +88 -0
- data/spec/watirspec/trs_spec.rb +68 -0
- data/spec/watirspec/uls_spec.rb +8 -0
- data/spec/watirspec/window_switching_spec.rb +165 -0
- data/support/html5.html +884 -422
- data/watir-webdriver.gemspec +91 -85
- metadata +159 -161
- data/Gemfile.lock +0 -48
- data/spec/html/closeable.html +0 -13
- data/spec/html/data_attributes.html +0 -9
- data/spec/html/window_switching.html +0 -12
- data/spec/watirspec/table_cell_spec.rb +0 -74
- data/spec/watirspec/table_row_spec.rb +0 -99
- data/spec/watirspec/table_rows_spec.rb +0 -60
- data/spec/window_switching_spec.rb +0 -116
data/spec/watirspec/dts_spec.rb
CHANGED
@@ -7,6 +7,14 @@ describe "Dts" do
|
|
7
7
|
browser.goto(WatirSpec.files + "/definition_lists.html")
|
8
8
|
end
|
9
9
|
|
10
|
+
bug "http://github.com/jarib/celerity/issues#issue/25", :celerity do
|
11
|
+
describe "with selectors" do
|
12
|
+
it "returns the matching elements" do
|
13
|
+
browser.dts(:class => "current-industry").to_a.should == [browser.dt(:class => "current-industry")]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
10
18
|
describe "#length" do
|
11
19
|
it "returns the number of dts" do
|
12
20
|
browser.dts.length.should == 11
|
@@ -24,6 +24,69 @@ describe "Element" do
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
+
describe "#== and #eql?" do
|
28
|
+
before { browser.goto(WatirSpec.files + "/definition_lists.html") }
|
29
|
+
|
30
|
+
it "returns true if the two elements point to the same DOM element" do
|
31
|
+
a = browser.dl(:id => "experience-list")
|
32
|
+
b = browser.dl
|
33
|
+
|
34
|
+
a.should == b
|
35
|
+
a.should eql(b)
|
36
|
+
end
|
37
|
+
|
38
|
+
it "returns false if the two elements are not the same" do
|
39
|
+
a = browser.dls[0]
|
40
|
+
b = browser.dls[1]
|
41
|
+
|
42
|
+
a.should_not == b
|
43
|
+
a.should_not eql(b)
|
44
|
+
end
|
45
|
+
|
46
|
+
it "returns false if the other object is not an Element" do
|
47
|
+
browser.dl.should_not == 1
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
describe "data-* attributes" do
|
52
|
+
before { browser.goto("file://" + File.expand_path("html/data_attributes.html", File.dirname(__FILE__))) }
|
53
|
+
|
54
|
+
bug "http://github.com/jarib/celerity/issues#issue/27", :celerity do
|
55
|
+
it "finds elements by a data-* attribute" do
|
56
|
+
browser.p(:data_type => "ruby-library").should exist
|
57
|
+
end
|
58
|
+
|
59
|
+
it "returns the value of a data-* attribute" do
|
60
|
+
browser.p.data_type.should == "ruby-library"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
describe "finding with unknown tag name" do
|
66
|
+
it "finds an element by xpath" do
|
67
|
+
browser.element(:xpath => "//*[@for='new_user_first_name']").should exist
|
68
|
+
end
|
69
|
+
|
70
|
+
it "finds an element by arbitrary attribute" do
|
71
|
+
browser.element(:id => "new_user").should exist
|
72
|
+
end
|
73
|
+
|
74
|
+
it "finds several elements by xpath" do
|
75
|
+
browser.elements(:xpath => "//a").length.should == 1
|
76
|
+
end
|
77
|
+
|
78
|
+
it "finds finds several elements by arbitrary attribute" do
|
79
|
+
browser.elements(:name => /^new_user/).length.should == 30
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
describe "#to_subtype" do
|
84
|
+
it "returns a more precise subtype of Element" do
|
85
|
+
el = browser.element(:xpath => "//input[@type='radio']").to_subtype
|
86
|
+
el.should be_kind_of(Watir::Radio)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
27
90
|
describe "#focus" do
|
28
91
|
bug "http://github.com/jarib/watir-webdriver/issues/issue/20", [:webdriver, :firefox] do
|
29
92
|
it "fires the onfocus event for the given element" do
|
@@ -44,8 +107,10 @@ describe "Element" do
|
|
44
107
|
end
|
45
108
|
|
46
109
|
describe "#parent" do
|
47
|
-
|
48
|
-
|
110
|
+
bug "http://github.com/jarib/celerity/issues#issue/28", :celerity do
|
111
|
+
it "gets the parent of this element" do
|
112
|
+
browser.text_field(:id, "new_user_email").parent.should be_instance_of(FieldSet)
|
113
|
+
end
|
49
114
|
end
|
50
115
|
end
|
51
116
|
|
@@ -75,6 +140,10 @@ describe "Element" do
|
|
75
140
|
it "doesn't raise when called on nested elements" do
|
76
141
|
browser.div(:id, 'no_such_div').link(:id, 'no_such_id').should_not exist
|
77
142
|
end
|
143
|
+
|
144
|
+
it "raises ArgumentError error if selector hash with :xpath has multiple entries" do
|
145
|
+
lambda { browser.div(:xpath => "//div", :class => "foo").exists? }.should raise_error(ArgumentError)
|
146
|
+
end
|
78
147
|
end
|
79
148
|
|
80
149
|
end
|
data/spec/watirspec/ems_spec.rb
CHANGED
@@ -7,6 +7,14 @@ describe "Ems" do
|
|
7
7
|
browser.goto(WatirSpec.files + "/non_control_elements.html")
|
8
8
|
end
|
9
9
|
|
10
|
+
bug "http://github.com/jarib/celerity/issues#issue/25", :celerity do
|
11
|
+
describe "with selectors" do
|
12
|
+
it "returns the matching elements" do
|
13
|
+
browser.ems(:class => "important-class").to_a.should == [browser.em(:class => "important-class")]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
10
18
|
describe "#length" do
|
11
19
|
it "returns the number of ems" do
|
12
20
|
browser.ems.length.should == 1
|
@@ -108,11 +108,14 @@ describe "FileField" do
|
|
108
108
|
it "is able to set a file path in the field and click the upload button and fire the onchange event" do
|
109
109
|
browser.goto("#{WatirSpec.host}/forms_with_input_elements.html")
|
110
110
|
|
111
|
-
path
|
111
|
+
path = File.expand_path(__FILE__)
|
112
|
+
element = browser.file_field(:name, "new_user_portrait")
|
112
113
|
|
113
|
-
|
114
|
-
|
114
|
+
element.set path
|
115
|
+
|
116
|
+
element.value.should include(File.basename(path)) # only some browser will return the full path
|
115
117
|
messages.first.should include(File.basename(path))
|
118
|
+
|
116
119
|
browser.button(:name, "new_user_submit").click
|
117
120
|
end
|
118
121
|
|
@@ -128,17 +131,19 @@ describe "FileField" do
|
|
128
131
|
it "is able to set a file path in the field and click the upload button and fire the onchange event" do
|
129
132
|
browser.goto("#{WatirSpec.host}/forms_with_input_elements.html")
|
130
133
|
|
131
|
-
path
|
134
|
+
path = File.expand_path(__FILE__)
|
135
|
+
element = browser.file_field(:name, "new_user_portrait")
|
132
136
|
|
133
|
-
|
134
|
-
|
135
|
-
messages.first.should include(File.basename(path))
|
136
|
-
browser.button(:name, "new_user_submit").click
|
137
|
+
element.value = path
|
138
|
+
element.value.should include(File.basename(path)) # only some browser will return the full path
|
137
139
|
end
|
138
140
|
|
139
|
-
|
140
|
-
|
141
|
-
|
141
|
+
|
142
|
+
not_compliant_on [:webdriver, :ie] do
|
143
|
+
it "does not raise an error if the file does not exist" do
|
144
|
+
browser.file_field.value = '/tmp/unlikely-to-exist'
|
145
|
+
browser.file_field.value.should == '/tmp/unlikely-to-exist'
|
146
|
+
end
|
142
147
|
end
|
143
148
|
|
144
149
|
it "does not alter its argument" do
|
@@ -7,6 +7,14 @@ describe "FileFields" do
|
|
7
7
|
browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
|
8
8
|
end
|
9
9
|
|
10
|
+
bug "http://github.com/jarib/celerity/issues#issue/25", :celerity do
|
11
|
+
describe "with selectors" do
|
12
|
+
it "returns the matching elements" do
|
13
|
+
browser.file_fields(:class => "portrait").to_a.should == [browser.file_field(:class => "portrait")]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
10
18
|
describe "#length" do
|
11
19
|
it "returns the correct number of file fields" do
|
12
20
|
browser.file_fields.length.should == 2
|
data/spec/watirspec/font_spec.rb
CHANGED
@@ -6,25 +6,27 @@ describe "Font" do
|
|
6
6
|
before :each do
|
7
7
|
browser.goto(WatirSpec.files + "/font.html")
|
8
8
|
end
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
9
|
+
|
10
|
+
bug "http://github.com/jarib/celerity/issues#issue/29", :celerity do
|
11
|
+
it "finds the font element" do
|
12
|
+
browser.font(:index, 0).should exist
|
13
|
+
end
|
14
|
+
|
15
|
+
it "knows about the color attribute" do
|
16
|
+
browser.font(:index, 0).color.should == "#ff00ff"
|
17
|
+
end
|
18
|
+
|
19
|
+
it "knows about the face attribute" do
|
20
|
+
browser.font(:index, 0).face.should == "Helvetica"
|
21
|
+
end
|
22
|
+
|
23
|
+
it "knows about the size attribute" do
|
24
|
+
browser.font(:index, 0).size.should == "12"
|
25
|
+
end
|
26
|
+
|
27
|
+
it "finds all font elements" do
|
28
|
+
browser.fonts.size.should == 1
|
29
|
+
end
|
28
30
|
end
|
29
31
|
|
30
32
|
end
|
data/spec/watirspec/form_spec.rb
CHANGED
@@ -52,9 +52,11 @@ describe "Form" do
|
|
52
52
|
end
|
53
53
|
|
54
54
|
describe "#submit" do
|
55
|
-
|
56
|
-
|
57
|
-
|
55
|
+
not_compliant_on :celerity do
|
56
|
+
it "submits the form" do
|
57
|
+
browser.form(:id, "delete_user").submit
|
58
|
+
browser.text.should include("Semantic table")
|
59
|
+
end
|
58
60
|
end
|
59
61
|
end
|
60
62
|
|
@@ -7,6 +7,14 @@ describe "Forms" do
|
|
7
7
|
browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
|
8
8
|
end
|
9
9
|
|
10
|
+
bug "http://github.com/jarib/celerity/issues#issue/25", :celerity do
|
11
|
+
describe "with selectors" do
|
12
|
+
it "returns the matching elements" do
|
13
|
+
browser.forms(:method => "post").to_a.should == [browser.form(:method => "post")]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
10
18
|
describe "#length" do
|
11
19
|
it "returns the number of forms in the container" do
|
12
20
|
browser.forms.length.should == 2
|
@@ -14,11 +22,9 @@ describe "Forms" do
|
|
14
22
|
end
|
15
23
|
|
16
24
|
describe "#[]n" do
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
browser.forms[0].attribute_value('method').should == 'post'
|
21
|
-
end
|
25
|
+
it "provides access to the nth form" do
|
26
|
+
browser.forms[0].action.should =~ /post_to_me$/ # varies between browsers
|
27
|
+
browser.forms[0].attribute_value('method').should == 'post'
|
22
28
|
end
|
23
29
|
end
|
24
30
|
|
@@ -9,6 +9,14 @@ bug "http://github.com/jarib/watir-webdriver/issues#issue/17", :webdriver do
|
|
9
9
|
browser.goto(WatirSpec.files + "/frames.html")
|
10
10
|
end
|
11
11
|
|
12
|
+
bug "http://github.com/jarib/celerity/issues#issue/25", :celerity do
|
13
|
+
describe "with selectors" do
|
14
|
+
it "returns the matching elements" do
|
15
|
+
browser.frames(:name => "frame1").to_a.should == [browser.frame(:class => "frame1")]
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
12
20
|
describe "#length" do
|
13
21
|
it "returns the correct number of frames" do
|
14
22
|
browser.frames.length.should == 2
|
@@ -7,6 +7,14 @@ describe "Hiddens" do
|
|
7
7
|
browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
|
8
8
|
end
|
9
9
|
|
10
|
+
bug "http://github.com/jarib/celerity/issues#issue/25", :celerity do
|
11
|
+
describe "with selectors" do
|
12
|
+
it "returns the matching elements" do
|
13
|
+
browser.hiddens(:value => "dolls").to_a.should == [browser.hidden(:value => "dolls")]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
10
18
|
describe "#length" do
|
11
19
|
it "returns the number of hiddens" do
|
12
20
|
browser.hiddens.length.should == 1
|
data/spec/watirspec/hns_spec.rb
CHANGED
@@ -6,6 +6,14 @@ describe "H1s", "H2s", "H3s", "H4s", "H5s", "H6s" do
|
|
6
6
|
browser.goto(WatirSpec.files + "/non_control_elements.html")
|
7
7
|
end
|
8
8
|
|
9
|
+
bug "http://github.com/jarib/celerity/issues#issue/25", :celerity do
|
10
|
+
describe "with selectors" do
|
11
|
+
it "returns the matching elements" do
|
12
|
+
browser.h1s(:class => "primary").to_a.should == [browser.h1(:class => "primary")]
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
9
17
|
describe "#length" do
|
10
18
|
it "returns the number of h1s" do
|
11
19
|
browser.h2s.length.should == 9
|
@@ -7,6 +7,14 @@ describe "Images" do
|
|
7
7
|
browser.goto(WatirSpec.files + "/images.html")
|
8
8
|
end
|
9
9
|
|
10
|
+
bug "http://github.com/jarib/celerity/issues#issue/25", :celerity do
|
11
|
+
describe "with selectors" do
|
12
|
+
it "returns the matching elements" do
|
13
|
+
browser.images(:alt => "circle").to_a.should == [browser.image(:alt => "circle")]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
10
18
|
describe "#length" do
|
11
19
|
it "returns the number of images" do
|
12
20
|
browser.images.length.should == 9
|
@@ -7,6 +7,14 @@ describe "Inses" do
|
|
7
7
|
browser.goto(WatirSpec.files + "/non_control_elements.html")
|
8
8
|
end
|
9
9
|
|
10
|
+
bug "http://github.com/jarib/celerity/issues#issue/25", :celerity do
|
11
|
+
describe "with selectors" do
|
12
|
+
it "returns the matching elements" do
|
13
|
+
browser.inses(:class => "lead").to_a.should == [browser.ins(:class => "lead")]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
10
18
|
describe "#length" do
|
11
19
|
it "returns the number of inses" do
|
12
20
|
browser.inses.length.should == 5
|
@@ -12,6 +12,8 @@ describe "Label" do
|
|
12
12
|
it "returns true if the element exists" do
|
13
13
|
browser.label(:id, 'first_label').should exist
|
14
14
|
browser.label(:id, /first_label/).should exist
|
15
|
+
browser.label(:for, "new_user_first_name").should exist
|
16
|
+
browser.label(:for, /new_user_first_name/).should exist
|
15
17
|
browser.label(:text, 'First name').should exist
|
16
18
|
browser.label(:text, /First name/).should exist
|
17
19
|
browser.label(:index, 0).should exist
|
@@ -7,6 +7,14 @@ describe "Labels" do
|
|
7
7
|
browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
|
8
8
|
end
|
9
9
|
|
10
|
+
bug "http://github.com/jarib/celerity/issues#issue/25", :celerity do
|
11
|
+
describe "with selectors" do
|
12
|
+
it "returns the matching elements" do
|
13
|
+
browser.labels(:for => "new_user_first_name").to_a.should == [browser.label(:for => "new_user_first_name")]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
10
18
|
describe "#length" do
|
11
19
|
it "returns the number of labels" do
|
12
20
|
browser.labels.length.should == 26 # changed this from 25 - Jari
|
@@ -52,6 +52,16 @@ module WatirSpec
|
|
52
52
|
false
|
53
53
|
end
|
54
54
|
|
55
|
+
def find_free_port_above(int)
|
56
|
+
port = int
|
57
|
+
|
58
|
+
until free_port?(port)
|
59
|
+
port += 1
|
60
|
+
end
|
61
|
+
|
62
|
+
port
|
63
|
+
end
|
64
|
+
|
55
65
|
def autorun
|
56
66
|
@autorun ||= true
|
57
67
|
end
|
@@ -63,6 +73,14 @@ module WatirSpec
|
|
63
73
|
def running?
|
64
74
|
defined?(@running) && @running
|
65
75
|
end
|
76
|
+
|
77
|
+
def free_port?(port)
|
78
|
+
s = TCPServer.new(@host, port)
|
79
|
+
s.close
|
80
|
+
true
|
81
|
+
rescue SocketError, Errno::EADDRINUSE
|
82
|
+
false
|
83
|
+
end
|
66
84
|
end # class << Server
|
67
85
|
|
68
86
|
set :public, WatirSpec.html
|
@@ -70,7 +88,7 @@ module WatirSpec
|
|
70
88
|
set :run, false
|
71
89
|
set :environment, :production
|
72
90
|
set :bind, "localhost" if WatirSpec.platform == :windows
|
73
|
-
set :port, 2000
|
91
|
+
set :port, find_free_port_above(2000)
|
74
92
|
set :server, %w[mongrel webrick]
|
75
93
|
|
76
94
|
get '/' do
|
@@ -46,7 +46,7 @@ module WatirSpec
|
|
46
46
|
|
47
47
|
def load_requires
|
48
48
|
# load spec_helper from containing folder, if it exists
|
49
|
-
hook = File.expand_path("
|
49
|
+
hook = File.expand_path("../../spec_helper.rb", File.dirname(__FILE__))
|
50
50
|
raise(Errno::ENOENT, hook) unless File.exist?(hook)
|
51
51
|
|
52
52
|
load hook
|
@@ -7,6 +7,14 @@ describe "Links" do
|
|
7
7
|
browser.goto(WatirSpec.files + "/non_control_elements.html")
|
8
8
|
end
|
9
9
|
|
10
|
+
bug "http://github.com/jarib/celerity/issues#issue/25", :celerity do
|
11
|
+
describe "with selectors" do
|
12
|
+
it "returns the matching elements" do
|
13
|
+
browser.links(:title => "link_title_2").to_a.should == [browser.link(:title => "link_title_2")]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
10
18
|
describe "#length" do
|
11
19
|
it "returns the number of links" do
|
12
20
|
browser.links.length.should == 4
|