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/alert_spec.rb
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
require File.expand_path("watirspec/spec_helper", File.dirname(__FILE__))
|
2
|
+
require "watir-webdriver/extensions/alerts"
|
3
|
+
|
4
|
+
describe "AlertHelper" do
|
5
|
+
before do
|
6
|
+
browser.goto("file://" + File.expand_path("html/alerts.html", File.dirname(__FILE__)))
|
7
|
+
end
|
8
|
+
|
9
|
+
it "handles an alert()" do
|
10
|
+
returned = browser.alert do
|
11
|
+
browser.button(:id => "alert").click
|
12
|
+
end
|
13
|
+
|
14
|
+
returned.should == "ok"
|
15
|
+
end
|
16
|
+
|
17
|
+
it "handles a confirmed confirm()" do
|
18
|
+
returned = browser.confirm(true) do
|
19
|
+
browser.button(:id => "confirm").click
|
20
|
+
end
|
21
|
+
|
22
|
+
returned.should == "set the value"
|
23
|
+
|
24
|
+
browser.button(:id => "confirm").value.should == "true"
|
25
|
+
end
|
26
|
+
|
27
|
+
it "handles a cancelled confirm()" do
|
28
|
+
returned = browser.confirm(false) do
|
29
|
+
browser.button(:id => "confirm").click
|
30
|
+
end
|
31
|
+
|
32
|
+
returned.should == "set the value"
|
33
|
+
|
34
|
+
browser.button(:id => "confirm").value.should == "false"
|
35
|
+
end
|
36
|
+
|
37
|
+
it "handles a prompt()" do
|
38
|
+
returned = browser.prompt("my name") do
|
39
|
+
browser.button(:id => "prompt").click
|
40
|
+
end
|
41
|
+
|
42
|
+
returned.should == {
|
43
|
+
:message => "enter your name",
|
44
|
+
:default => "John Doe"
|
45
|
+
}
|
46
|
+
|
47
|
+
browser.button(:id => "prompt").value.should == "my name"
|
48
|
+
end
|
49
|
+
end
|
@@ -27,18 +27,18 @@ describe Watir::ElementLocator do
|
|
27
27
|
end
|
28
28
|
|
29
29
|
it "handles selector with tag name and multiple attributes" do
|
30
|
-
expect_one :xpath,
|
30
|
+
expect_one :xpath, ".//div[@class='foo' and @title='bar']"
|
31
31
|
|
32
|
-
locate_one :tag_name
|
33
|
-
|
34
|
-
|
32
|
+
locate_one [:tag_name, "div",
|
33
|
+
:class , "foo",
|
34
|
+
:title , 'bar']
|
35
35
|
end
|
36
36
|
|
37
37
|
it "handles selector with no tag name and multiple attributes" do
|
38
|
-
expect_one :xpath,
|
38
|
+
expect_one :xpath, ".//*[@class='foo' and @title='bar']"
|
39
39
|
|
40
|
-
locate_one :class
|
41
|
-
|
40
|
+
locate_one [:class, "foo",
|
41
|
+
:title, "bar"]
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
@@ -85,11 +85,11 @@ describe Watir::ElementLocator do
|
|
85
85
|
it "uses the corresponding <label>'s @for attribute when locating by label" do
|
86
86
|
expect_one :xpath, ".//input[@type='text' and @id=//label[normalize-space()='foo']/@for]"
|
87
87
|
|
88
|
-
selector =
|
89
|
-
:tag_name
|
90
|
-
:type
|
91
|
-
:label
|
92
|
-
|
88
|
+
selector = [
|
89
|
+
:tag_name, "input",
|
90
|
+
:type , "text",
|
91
|
+
:label , "foo"
|
92
|
+
]
|
93
93
|
|
94
94
|
locate_one selector, Watir::Input.attributes
|
95
95
|
end
|
@@ -203,7 +203,6 @@ describe Watir::ElementLocator do
|
|
203
203
|
|
204
204
|
selector = {
|
205
205
|
:tag_name => "input",
|
206
|
-
:type => "radio",
|
207
206
|
:xpath => "//div"
|
208
207
|
}
|
209
208
|
|
@@ -255,9 +254,9 @@ describe Watir::ElementLocator do
|
|
255
254
|
it "handles selector with tag name and multiple attributes" do
|
256
255
|
expect_all :xpath, ".//div[@class='foo' and @title='bar']"
|
257
256
|
|
258
|
-
locate_all :tag_name
|
259
|
-
|
260
|
-
|
257
|
+
locate_all [:tag_name, "div",
|
258
|
+
:class , "foo",
|
259
|
+
:title , 'bar']
|
261
260
|
end
|
262
261
|
end
|
263
262
|
|
data/spec/element_spec.rb
CHANGED
@@ -11,36 +11,4 @@ describe Watir::Element do
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
describe "#== and #eql?" do
|
15
|
-
before { browser.goto(WatirSpec.files + "/definition_lists.html") }
|
16
|
-
|
17
|
-
it "returns true if the two elements point to the same DOM element" do
|
18
|
-
a = browser.dl(:id => "experience-list")
|
19
|
-
b = browser.dl
|
20
|
-
|
21
|
-
a.should == b
|
22
|
-
a.should eql(b)
|
23
|
-
end
|
24
|
-
|
25
|
-
it "returns false if the two elements are not the same" do
|
26
|
-
a = browser.dls[0]
|
27
|
-
b = browser.dls[1]
|
28
|
-
|
29
|
-
a.should_not == b
|
30
|
-
a.should_not eql(b)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
describe "data-* attributes" do
|
35
|
-
before { browser.goto("file://" + File.expand_path("html/data_attributes.html", File.dirname(__FILE__))) }
|
36
|
-
|
37
|
-
it "finds elements by a data-* attribute" do
|
38
|
-
browser.p(:data_type => "ruby-library").should exist
|
39
|
-
end
|
40
|
-
|
41
|
-
it "returns the value of a data-* attribute" do
|
42
|
-
browser.p.data_type.should == "ruby-library"
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
14
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Alerts</title>
|
5
|
+
</head>
|
6
|
+
<body>
|
7
|
+
<input id=alert type=button onclick="alert('ok')" value=Alert>
|
8
|
+
<input id=confirm type=button onclick="this.value = confirm('set the value')" value=Confirm>
|
9
|
+
<input id=prompt type=button onclick='this.value = prompt("enter your name", "John Doe")' value=Prompt>
|
10
|
+
</body>
|
11
|
+
</html>
|
data/spec/input_spec.rb
CHANGED
@@ -6,72 +6,34 @@ describe Watir::Input do
|
|
6
6
|
browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
|
7
7
|
end
|
8
8
|
|
9
|
-
describe "#
|
9
|
+
describe "#to_subtype" do
|
10
10
|
it "returns a CheckBox instance" do
|
11
|
-
e = browser.input(:xpath => "//input[@type='checkbox']").
|
11
|
+
e = browser.input(:xpath => "//input[@type='checkbox']").to_subtype
|
12
12
|
e.should be_kind_of(Watir::CheckBox)
|
13
13
|
end
|
14
14
|
|
15
|
-
it "raises an error if the element is not a checkbox" do
|
16
|
-
lambda {
|
17
|
-
browser.input(:xpath => "//input[@type='text']").to_checkbox
|
18
|
-
}.should raise_error(TypeError)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
describe "#to_radio" do
|
23
15
|
it "returns a Radio instance" do
|
24
|
-
e = browser.input(:xpath => "//input[@type='radio']").
|
16
|
+
e = browser.input(:xpath => "//input[@type='radio']").to_subtype
|
25
17
|
e.should be_kind_of(Watir::Radio)
|
26
18
|
end
|
27
19
|
|
28
|
-
it "raises an error if the element is not a radio button" do
|
29
|
-
lambda {
|
30
|
-
browser.input(:xpath => "//input[@type='text']").to_radio
|
31
|
-
}.should raise_error(TypeError)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
describe "#to_button" do
|
36
20
|
it "returns a Button instance" do
|
37
21
|
es = [
|
38
|
-
browser.input(:xpath => "//input[@type='button']").
|
39
|
-
browser.input(:xpath => "//input[@type='submit']").
|
22
|
+
browser.input(:xpath => "//input[@type='button']").to_subtype,
|
23
|
+
browser.input(:xpath => "//input[@type='submit']").to_subtype
|
40
24
|
]
|
41
25
|
|
42
|
-
es.
|
43
|
-
end
|
44
|
-
|
45
|
-
it "raises an error if the element is not a button" do
|
46
|
-
lambda {
|
47
|
-
browser.input(:xpath => "//input[@type='text']").to_button
|
48
|
-
}.should raise_error(TypeError)
|
26
|
+
es.all? { |e| e.should be_kind_of(Watir::Button) }
|
49
27
|
end
|
50
|
-
end
|
51
28
|
|
52
|
-
describe "#to_text_field" do
|
53
29
|
it "returns a TextField instance" do
|
54
|
-
e = browser.input(:xpath => "//input[@type='text']").
|
30
|
+
e = browser.input(:xpath => "//input[@type='text']").to_subtype
|
55
31
|
e.should be_kind_of(Watir::TextField)
|
56
32
|
end
|
57
33
|
|
58
|
-
it "raises an error if the element is not a text field" do
|
59
|
-
lambda {
|
60
|
-
browser.input(:xpath => "//input[@type='radio']").to_text_field
|
61
|
-
}.should raise_error(TypeError)
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
describe "#to_file_field" do
|
66
34
|
it "returns a TextField instance" do
|
67
|
-
e = browser.input(:xpath => "//input[@type='file']").
|
35
|
+
e = browser.input(:xpath => "//input[@type='file']").to_subtype
|
68
36
|
e.should be_kind_of(Watir::FileField)
|
69
37
|
end
|
70
|
-
|
71
|
-
it "raises an error if the element is not a text field" do
|
72
|
-
lambda {
|
73
|
-
browser.input(:xpath => "//input[@type='radio']").to_file_field
|
74
|
-
}.should raise_error(TypeError)
|
75
|
-
end
|
76
38
|
end
|
77
39
|
end
|
data/spec/locator_spec_helper.rb
CHANGED
@@ -1,9 +1,12 @@
|
|
1
|
+
require 'active_support/ordered_hash'
|
2
|
+
|
1
3
|
module LocatorSpecHelper
|
2
4
|
def driver
|
3
5
|
@driver ||= mock(Selenium::WebDriver::Driver)
|
4
6
|
end
|
5
7
|
|
6
|
-
def locator(selector, attrs
|
8
|
+
def locator(selector, attrs)
|
9
|
+
attrs ||= Watir::HTMLElement.attributes
|
7
10
|
Watir::ElementLocator.new(driver, selector, attrs)
|
8
11
|
end
|
9
12
|
|
@@ -15,12 +18,12 @@ module LocatorSpecHelper
|
|
15
18
|
driver.should_receive(:find_elements).with(*args)
|
16
19
|
end
|
17
20
|
|
18
|
-
def locate_one(
|
19
|
-
locator(
|
21
|
+
def locate_one(selector, attrs = nil)
|
22
|
+
locator(ordered_hash(selector), attrs).locate
|
20
23
|
end
|
21
24
|
|
22
|
-
def locate_all(
|
23
|
-
locator(
|
25
|
+
def locate_all(selector, attrs = nil)
|
26
|
+
locator(ordered_hash(selector), attrs).locate_all
|
24
27
|
end
|
25
28
|
|
26
29
|
def element(opts = {})
|
@@ -33,5 +36,16 @@ module LocatorSpecHelper
|
|
33
36
|
|
34
37
|
el
|
35
38
|
end
|
39
|
+
|
40
|
+
def ordered_hash(selector)
|
41
|
+
case selector
|
42
|
+
when Hash
|
43
|
+
selector
|
44
|
+
when Array
|
45
|
+
ActiveSupport::OrderedHash[*selector]
|
46
|
+
else
|
47
|
+
raise ArgumentError, "couldn't create hash for #{selector.inspect}"
|
48
|
+
end
|
49
|
+
end
|
36
50
|
end
|
37
51
|
|
data/spec/spec_helper.rb
CHANGED
@@ -7,6 +7,14 @@ describe "Areas" 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.areas(:alt => "Tables").to_a.should == [browser.area(:alt => "Tables")]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
10
18
|
describe "#length" do
|
11
19
|
it "returns the number of areas" do
|
12
20
|
browser.areas.length.should == 3
|
@@ -81,13 +81,13 @@ describe "Browser" do
|
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
|
-
bug "http://github.com/jarib/watirspec/issues/issue/8" [:webdriver, :ie], [:webdriver, :chrome] do
|
84
|
+
bug "http://github.com/jarib/watirspec/issues/issue/8", [:webdriver, :ie], [:webdriver, :chrome] do
|
85
85
|
describe ".start" do
|
86
86
|
it "goes to the given URL and return an instance of itself" do
|
87
87
|
browser = WatirSpec.implementation.browser_class.start("#{WatirSpec.files}/non_control_elements.html")
|
88
88
|
browser.should be_instance_of(WatirSpec.implementation.browser_class)
|
89
89
|
browser.title.should == "Non-control elements"
|
90
|
-
browser.
|
90
|
+
browser.close
|
91
91
|
end
|
92
92
|
end
|
93
93
|
end
|
@@ -204,7 +204,7 @@ describe "Browser" do
|
|
204
204
|
browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
|
205
205
|
end
|
206
206
|
|
207
|
-
not_compliant_on [:webdriver, :ie] do
|
207
|
+
not_compliant_on [:webdriver, :ie], :celerity do
|
208
208
|
it "returns an Array of matching elements" do
|
209
209
|
objects = browser.elements_by_xpath("//*[@type='text']")
|
210
210
|
objects.should be_kind_of(Array)
|
@@ -213,7 +213,7 @@ describe "Browser" do
|
|
213
213
|
end
|
214
214
|
end
|
215
215
|
|
216
|
-
deviates_on [:webdriver, :ie] do
|
216
|
+
deviates_on [:webdriver, :ie], :celerity do
|
217
217
|
it "returns an Array of matching elements" do
|
218
218
|
objects = browser.elements_by_xpath("//*[@type='text']")
|
219
219
|
objects.should be_kind_of(Array)
|
@@ -105,10 +105,9 @@ describe "Button" do
|
|
105
105
|
end
|
106
106
|
|
107
107
|
describe "#src" do
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
end
|
108
|
+
it "returns the src attribute for the button image" do
|
109
|
+
# varies between browsers
|
110
|
+
browser.button(:name, "new_user_image").src.should =~ %r"images/button.jpg$"
|
112
111
|
end
|
113
112
|
|
114
113
|
it "raises UnknownObjectException if the button does not exist" do
|
@@ -7,6 +7,14 @@ describe "Buttons" 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.buttons(:name => "new_user_button").to_a.should == [browser.button(:name => "new_user_button")]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
10
18
|
describe "#length" do
|
11
19
|
it "returns the number of buttons" do
|
12
20
|
browser.buttons.length.should == 8
|
@@ -7,6 +7,14 @@ describe "CheckBoxes" 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.checkboxes(:value => "books").to_a.should == [browser.checkbox(:value => "books")]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
10
18
|
describe "#length" do
|
11
19
|
it "returns the number of checkboxes" do
|
12
20
|
browser.checkboxes.length.should == 7
|
data/spec/watirspec/dds_spec.rb
CHANGED
@@ -7,6 +7,14 @@ describe "Dds" 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.dds(:text => "11 years").to_a.should == [browser.dd(:text => "11 years")]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
10
18
|
describe "#length" do
|
11
19
|
it "returns the number of dds" do
|
12
20
|
browser.dds.length.should == 11
|
data/spec/watirspec/dels_spec.rb
CHANGED
@@ -7,6 +7,14 @@ describe "Dels" 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.dels(:class => "lead").to_a.should == [browser.del(:class => "lead")]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
10
18
|
describe "#length" do
|
11
19
|
it "returns the number of dels" do
|
12
20
|
browser.dels.length.should == 5
|
data/spec/watirspec/divs_spec.rb
CHANGED
@@ -7,6 +7,14 @@ describe "Divs" 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.divs(:id => "header").to_a.should == [browser.div(:id => "header")]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
10
18
|
describe "#length" do
|
11
19
|
it "returns the number of divs" do
|
12
20
|
browser.divs.length.should == 12
|
data/spec/watirspec/dls_spec.rb
CHANGED
@@ -7,6 +7,14 @@ describe "Dls" 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.dls(:title => "experience").to_a.should == [browser.dl(:title => "experience")]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
10
18
|
describe "#length" do
|
11
19
|
it "returns the number of dls" do
|
12
20
|
browser.dls.length.should == 3
|