symbiont 0.1.9 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +22 -7
- data/HISTORY.md +6 -0
- data/app/public/css/site.css +16 -0
- data/app/public/js/site.js +3 -1
- data/app/views/comics.erb +23 -1
- data/app/views/webobject.erb +1 -1
- data/lib/symbiont/data_setter.rb +7 -3
- data/lib/symbiont/enclosers.rb +24 -27
- data/lib/symbiont/evaluators.rb +52 -23
- data/lib/symbiont/factory.rb +19 -75
- data/lib/symbiont/generators.rb +172 -44
- data/lib/symbiont/platform_watir/platform_object.rb +202 -18
- data/lib/symbiont/version.rb +1 -1
- data/lib/symbiont/web_objects/button.rb +1 -1
- data/lib/symbiont/web_objects/checkbox.rb +1 -1
- data/lib/symbiont/web_objects/heading.rb +12 -0
- data/lib/symbiont/web_objects/hidden_field.rb +19 -0
- data/lib/symbiont/web_objects/label.rb +15 -0
- data/lib/symbiont/web_objects/list_item.rb +13 -0
- data/lib/symbiont/web_objects/ordered_list.rb +49 -0
- data/lib/symbiont/web_objects/radio.rb +1 -1
- data/lib/symbiont/web_objects/select_list.rb +1 -1
- data/lib/symbiont/web_objects/table.rb +4 -0
- data/lib/symbiont/web_objects/table_row.rb +4 -0
- data/lib/symbiont/web_objects/text_area.rb +26 -0
- data/lib/symbiont/web_objects/unordered_list.rb +49 -0
- data/lib/symbiont.rb +7 -0
- data/lucid.yml +6 -0
- data/spec/spec_helper.rb +70 -16
- data/spec/symbiont/data_setter_spec.rb +65 -62
- data/spec/symbiont/enclosers_spec.rb +76 -57
- data/spec/symbiont/evaluators_spec.rb +95 -75
- data/spec/symbiont/factory_spec.rb +174 -122
- data/spec/symbiont/generators/button_generators_spec.rb +34 -31
- data/spec/symbiont/generators/checkbox_generators_spec.rb +79 -75
- data/spec/symbiont/generators/div_generators_spec.rb +56 -52
- data/spec/symbiont/generators/hidden_field_generators_spec.rb +65 -0
- data/spec/symbiont/generators/link_generators_spec.rb +30 -27
- data/spec/symbiont/generators/paragraph_generators_spec.rb +22 -17
- data/spec/symbiont/generators/radio_generators_spec.rb +76 -77
- data/spec/symbiont/generators/select_list_generators_spec.rb +93 -77
- data/spec/symbiont/generators/span_generators_spec.rb +56 -52
- data/spec/symbiont/generators/{cell_generators_spec.rb → table_cell_generators_spec.rb} +56 -52
- data/spec/symbiont/generators/table_generators_spec.rb +56 -52
- data/spec/symbiont/generators/text_area_generators_spec.rb +72 -0
- data/spec/symbiont/generators/text_field_generators_spec.rb +30 -27
- data/spec/symbiont/generators_spec.rb +38 -28
- data/spec/symbiont/locators_spec.rb +68 -68
- data/spec/symbiont/platform_object_spec.rb +2 -4
- data/spec/symbiont/symbiont_spec.rb +10 -8
- data/spec/symbiont/web_object_spec.rb +194 -194
- data/spec/symbiont/web_objects/button_spec.rb +38 -30
- data/spec/symbiont/web_objects/checkbox_spec.rb +27 -27
- data/spec/symbiont/web_objects/div_spec.rb +18 -11
- data/spec/symbiont/web_objects/heading_spec.rb +22 -0
- data/spec/symbiont/web_objects/hidden_field_spec.rb +18 -0
- data/spec/symbiont/web_objects/label_spec.rb +18 -0
- data/spec/symbiont/web_objects/link_spec.rb +33 -33
- data/spec/symbiont/web_objects/list_item_spec.rb +18 -0
- data/spec/symbiont/web_objects/option_spec.rb +9 -9
- data/spec/symbiont/web_objects/ordered_list_spec.rb +53 -0
- data/spec/symbiont/web_objects/paragraph_spec.rb +9 -2
- data/spec/symbiont/web_objects/radio_spec.rb +27 -27
- data/spec/symbiont/web_objects/select_list_spec.rb +69 -69
- data/spec/symbiont/web_objects/span_spec.rb +18 -11
- data/spec/symbiont/web_objects/table_cell_spec.rb +19 -19
- data/spec/symbiont/web_objects/table_row_spec.rb +58 -58
- data/spec/symbiont/web_objects/table_spec.rb +61 -61
- data/spec/symbiont/web_objects/text_area_spec.rb +18 -0
- data/spec/symbiont/web_objects/text_field_spec.rb +39 -39
- data/spec/symbiont/web_objects/unordered_list_spec.rb +51 -0
- data/specs/common/support/browser.rb +25 -0
- data/specs/common/support/env.rb +6 -0
- data/specs/common/support/events.rb +15 -0
- data/specs/enclosers.feature +9 -0
- data/specs/evaluators.feature +26 -0
- data/specs/pages/characters.rb +22 -0
- data/specs/pages/home.rb +9 -0
- data/specs/pages/stardate.rb +23 -0
- data/specs/pages/web_objects.rb +77 -0
- data/specs/select_list.feature +53 -0
- data/specs/steps/enclosers_steps.rb +17 -0
- data/specs/steps/evaluators_steps.rb +44 -0
- data/specs/steps/navigation_steps.rb +14 -0
- data/specs/steps/select_list_steps.rb +94 -0
- data/specs/steps/table_cell_steps.rb +31 -0
- data/specs/steps/table_steps.rb +87 -0
- data/specs/table.feature +49 -0
- data/specs/table_cell.feature +27 -0
- data/symbiont.gemspec +4 -1
- metadata +72 -6
- data/cucumber.yml +0 -6
@@ -1,194 +1,194 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "Web Objects" do
|
4
|
-
let(:watir_browser)
|
5
|
-
let(:watir_definition) { ::Symbiont::WebObjects::WebObject.new(watir_browser) }
|
6
|
-
let(:link)
|
7
|
-
|
8
|
-
it "should
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
watir_definition.
|
18
|
-
end
|
19
|
-
|
20
|
-
it "should
|
21
|
-
watir_browser.should_receive(:
|
22
|
-
watir_definition.
|
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
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
watir_definition.
|
79
|
-
end
|
80
|
-
|
81
|
-
it "should
|
82
|
-
watir_browser.should_receive(:
|
83
|
-
watir_definition.
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
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
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
end
|
194
|
-
end
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "Web Objects" do
|
4
|
+
let(:watir_browser) { mock_browser_for_watir }
|
5
|
+
let(:watir_definition) { ::Symbiont::WebObjects::WebObject.new(watir_browser) }
|
6
|
+
let(:link) { Symbiont::WebObjects::Link }
|
7
|
+
|
8
|
+
it "should determine if a web object is enabled" do
|
9
|
+
watir_browser.should_receive(:enabled?).twice.and_return(true)
|
10
|
+
watir_definition.enabled?.should == true
|
11
|
+
watir_definition.should be_enabled
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should determine if a web object is disabled" do
|
15
|
+
watir_browser.should_receive(:enabled?).twice.and_return(false)
|
16
|
+
watir_definition.disabled?.should == true
|
17
|
+
watir_definition.should be_disabled
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should determine if a web object is visible" do
|
21
|
+
watir_browser.should_receive(:present?).twice.and_return(true)
|
22
|
+
watir_definition.visible?.should == true
|
23
|
+
watir_definition.should be_visible
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should determine if a web object is not visible" do
|
27
|
+
watir_browser.should_receive(:present?).and_return(false)
|
28
|
+
watir_definition.visible?.should == false
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should determine if a web object exists" do
|
32
|
+
watir_browser.should_receive(:exists?).and_return(true)
|
33
|
+
watir_definition.exists?.should == true
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should determine if a web object does not exist" do
|
37
|
+
watir_browser.should_receive(:exists?).and_return(false)
|
38
|
+
watir_definition.exists?.should == false
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should retrieve the id of a web object" do
|
42
|
+
watir_browser.should_receive(:id).and_return("id")
|
43
|
+
watir_definition.id.should == "id"
|
44
|
+
end
|
45
|
+
|
46
|
+
it "should retrieve the value of a web object" do
|
47
|
+
watir_browser.should_receive(:value).and_return("value")
|
48
|
+
watir_definition.value.should == "value"
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should be able to flash a web_object" do
|
52
|
+
watir_browser.should_receive(:flash).and_return(watir_definition)
|
53
|
+
watir_definition.flash.should be_instance_of Symbiont::WebObjects::WebObject
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should retrieve the value of an attribute" do
|
57
|
+
watir_browser.should_receive(:attribute_value).and_return(true)
|
58
|
+
watir_definition.attribute("readonly").should be_true
|
59
|
+
end
|
60
|
+
|
61
|
+
it "should be able to focus on a web object" do
|
62
|
+
watir_browser.should_receive(:focus).and_return(watir_definition)
|
63
|
+
watir_definition.focus
|
64
|
+
end
|
65
|
+
|
66
|
+
it "should return the text contained by a web object" do
|
67
|
+
watir_browser.should_receive(:text).and_return("testing")
|
68
|
+
watir_definition.text.should == "testing"
|
69
|
+
end
|
70
|
+
|
71
|
+
it "should retrieve the html of a web object" do
|
72
|
+
watir_browser.should_receive(:html).and_return("<p>Testing</p>")
|
73
|
+
watir_definition.html.should == "<p>Testing</p>"
|
74
|
+
end
|
75
|
+
|
76
|
+
it "should simulate a click event on a web object" do
|
77
|
+
watir_browser.should_receive(:click)
|
78
|
+
watir_definition.click
|
79
|
+
end
|
80
|
+
|
81
|
+
it "should simulate a double-click event on a web object" do
|
82
|
+
watir_browser.should_receive(:double_click)
|
83
|
+
watir_definition.double_click
|
84
|
+
end
|
85
|
+
|
86
|
+
it "should retrieve the tag of a web object" do
|
87
|
+
watir_browser.should_receive(:tag_name).and_return("div")
|
88
|
+
watir_definition.tag_name.should == "div"
|
89
|
+
end
|
90
|
+
|
91
|
+
it "should allow a clear event on a web object" do
|
92
|
+
watir_browser.should_receive(:clear)
|
93
|
+
watir_definition.clear
|
94
|
+
end
|
95
|
+
|
96
|
+
it "should retrieve the style of a web object" do
|
97
|
+
watir_browser.should_receive(:style).with('display').and_return("none")
|
98
|
+
watir_definition.style('display').should == 'none'
|
99
|
+
end
|
100
|
+
|
101
|
+
it "should be able to inspect a web object" do
|
102
|
+
watir_browser.should_receive(:inspect).and_return(watir_definition)
|
103
|
+
watir_definition.inspect.should be_instance_of Symbiont::WebObjects::WebObject
|
104
|
+
end
|
105
|
+
|
106
|
+
it "should be able to hover over a web object" do
|
107
|
+
watir_browser.should_receive(:hover).and_return(watir_definition)
|
108
|
+
watir_definition.hover
|
109
|
+
end
|
110
|
+
|
111
|
+
it "should be able to fire an event on a web object" do
|
112
|
+
watir_browser.should_receive(:fire_event).and_return("onclick")
|
113
|
+
watir_definition.fire_event("onclick")
|
114
|
+
end
|
115
|
+
|
116
|
+
it "should send key presses to a web object" do
|
117
|
+
watir_browser.should_receive(:send_keys).with([:control, 'a'])
|
118
|
+
watir_definition.send_keys([:control, 'a'])
|
119
|
+
end
|
120
|
+
|
121
|
+
it "should be able to determine if a web object is equal to another" do
|
122
|
+
watir_browser.should_receive(:==).and_return(true)
|
123
|
+
watir_definition.should == watir_definition
|
124
|
+
end
|
125
|
+
|
126
|
+
it "should find the parent for a web object" do
|
127
|
+
watir_browser.should_receive(:tag_name).twice.and_return(:p)
|
128
|
+
watir_browser.should_receive(:parent).and_return(watir_definition)
|
129
|
+
watir_definition.parent
|
130
|
+
end
|
131
|
+
|
132
|
+
it "should wait until a specific condition occurs" do
|
133
|
+
Object::Watir::Wait.stub(:until).with(5, "Condition occurred.")
|
134
|
+
watir_definition.wait_until(5, "Condition occurred.") { true }
|
135
|
+
end
|
136
|
+
|
137
|
+
it "should wait for a web object to be actionable" do
|
138
|
+
watir_browser.should_receive(:wait_until_present).twice.with(5)
|
139
|
+
watir_definition.when_actionable(5)
|
140
|
+
watir_definition.when_present(5)
|
141
|
+
end
|
142
|
+
|
143
|
+
it "should use the provided element wait time for actionable checks" do
|
144
|
+
Symbiont.element_level_wait = 30
|
145
|
+
watir_browser.should_receive(:wait_until_present).with(30)
|
146
|
+
watir_definition.when_present
|
147
|
+
end
|
148
|
+
|
149
|
+
it "should reference a web object when it is actionable" do
|
150
|
+
watir_browser.should_receive(:wait_until_present).with(5)
|
151
|
+
web_object = watir_definition.when_actionable(5)
|
152
|
+
web_object.should === watir_definition
|
153
|
+
end
|
154
|
+
|
155
|
+
it "should wait for a web object to become non-actionable" do
|
156
|
+
watir_browser.should_receive(:wait_while_present).and_return(false)
|
157
|
+
watir_definition.when_not_present(5)
|
158
|
+
end
|
159
|
+
|
160
|
+
it "should wait for a web object to become visible" do
|
161
|
+
watir_browser.should_receive(:present?).and_return(true)
|
162
|
+
watir_definition.when_visible(5)
|
163
|
+
end
|
164
|
+
|
165
|
+
it "should reference a web object when it is visible" do
|
166
|
+
watir_browser.should_receive(:present?).and_return(true)
|
167
|
+
web_object = watir_definition.when_visible(5)
|
168
|
+
web_object.should === watir_definition
|
169
|
+
end
|
170
|
+
|
171
|
+
it "should wait for a web object to become invisible" do
|
172
|
+
watir_browser.should_receive(:present?).and_return(false)
|
173
|
+
watir_definition.when_not_visible(5)
|
174
|
+
end
|
175
|
+
|
176
|
+
it "should reference a web object when it is not visible" do
|
177
|
+
watir_browser.stub(:present?).and_return(false)
|
178
|
+
web_object = watir_definition.when_not_visible(5)
|
179
|
+
web_object.should === watir_definition
|
180
|
+
end
|
181
|
+
|
182
|
+
it "should scroll elements into view" do
|
183
|
+
watir_browser.should_receive(:wd).and_return(watir_browser)
|
184
|
+
watir_browser.should_receive(:location_once_scrolled_into_view)
|
185
|
+
watir_definition.scroll_into_view
|
186
|
+
end
|
187
|
+
|
188
|
+
it "should return no key for an unrecognized locator" do
|
189
|
+
[:invalid].each do |s|
|
190
|
+
locator = link.provide_locator_for s => 'value'
|
191
|
+
locator.keys.first.should == nil
|
192
|
+
end
|
193
|
+
end
|
194
|
+
end
|
@@ -1,30 +1,38 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Symbiont::WebObjects::Button do
|
4
|
-
describe "implementation" do
|
5
|
-
let(:button_object) { double('button_object') }
|
6
|
-
let(:button) { Symbiont::WebObjects::Button }
|
7
|
-
|
8
|
-
it "should reference standard usable selectors" do
|
9
|
-
[:class, :id, :name, :index, :xpath].each do |s|
|
10
|
-
locator = button.provide_locator_for s => 'value'
|
11
|
-
locator.keys.first.should == s
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
it "should reference specific usable selectors" do
|
16
|
-
[:value, :text].each do |s|
|
17
|
-
locator = button.provide_locator_for s => 'value'
|
18
|
-
locator.keys.first.should == s
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
it "should register with a submit type" do
|
23
|
-
::Symbiont::WebObjects.get_class_for(:input, :submit).should == ::Symbiont::WebObjects::Button
|
24
|
-
end
|
25
|
-
|
26
|
-
it "should register with a button type" do
|
27
|
-
::Symbiont::WebObjects.get_class_for(:input, :button).should == ::Symbiont::WebObjects::Button
|
28
|
-
end
|
29
|
-
|
30
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Symbiont::WebObjects::Button do
|
4
|
+
describe "implementation" do
|
5
|
+
let(:button_object) { double('button_object') }
|
6
|
+
let(:button) { Symbiont::WebObjects::Button }
|
7
|
+
|
8
|
+
it "should reference standard usable selectors" do
|
9
|
+
[:class, :id, :name, :index, :xpath, :value, :src, :alt, :text].each do |s|
|
10
|
+
locator = button.provide_locator_for s => 'value'
|
11
|
+
locator.keys.first.should == s
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should reference specific usable selectors" do
|
16
|
+
[:value, :text].each do |s|
|
17
|
+
locator = button.provide_locator_for s => 'value'
|
18
|
+
locator.keys.first.should == s
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should register with a submit type" do
|
23
|
+
::Symbiont::WebObjects.get_class_for(:input, :submit).should == ::Symbiont::WebObjects::Button
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should register with a button type" do
|
27
|
+
::Symbiont::WebObjects.get_class_for(:input, :button).should == ::Symbiont::WebObjects::Button
|
28
|
+
end
|
29
|
+
|
30
|
+
it "should register with an image type" do
|
31
|
+
::Symbiont::WebObjects.get_class_for(:input, :image).should == ::Symbiont::WebObjects::Button
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should register with an image type" do
|
35
|
+
::Symbiont::WebObjects.get_class_for(:input, :reset).should == ::Symbiont::WebObjects::Button
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -1,27 +1,27 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Symbiont::WebObjects::CheckBox do
|
4
|
-
describe "implementation" do
|
5
|
-
let(:checkbox_object) { double('checkbox_object') }
|
6
|
-
let(:checkbox_definition) { Symbiont::WebObjects::CheckBox.new(checkbox_object) }
|
7
|
-
|
8
|
-
it "should register with a submit type" do
|
9
|
-
::Symbiont::WebObjects.get_class_for(:input, :checkbox).should == ::Symbiont::WebObjects::CheckBox
|
10
|
-
end
|
11
|
-
|
12
|
-
it "should be able to check the definition" do
|
13
|
-
checkbox_object.should_receive(:set)
|
14
|
-
checkbox_definition.check
|
15
|
-
end
|
16
|
-
|
17
|
-
it "should be able to uncheck the definition" do
|
18
|
-
checkbox_object.should_receive(:clear)
|
19
|
-
checkbox_definition.uncheck
|
20
|
-
end
|
21
|
-
|
22
|
-
it "should be able to determine if the definition is checked" do
|
23
|
-
checkbox_object.should_receive(:set?).and_return(true)
|
24
|
-
checkbox_definition.checked?
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Symbiont::WebObjects::CheckBox do
|
4
|
+
describe "implementation" do
|
5
|
+
let(:checkbox_object) { double('checkbox_object') }
|
6
|
+
let(:checkbox_definition) { Symbiont::WebObjects::CheckBox.new(checkbox_object) }
|
7
|
+
|
8
|
+
it "should register with a submit type" do
|
9
|
+
::Symbiont::WebObjects.get_class_for(:input, :checkbox).should == ::Symbiont::WebObjects::CheckBox
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should be able to check the definition" do
|
13
|
+
checkbox_object.should_receive(:set)
|
14
|
+
checkbox_definition.check
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should be able to uncheck the definition" do
|
18
|
+
checkbox_object.should_receive(:clear)
|
19
|
+
checkbox_definition.uncheck
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should be able to determine if the definition is checked" do
|
23
|
+
checkbox_object.should_receive(:set?).and_return(true)
|
24
|
+
checkbox_definition.checked?
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -1,11 +1,18 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Symbiont::WebObjects::Div do
|
4
|
-
describe "implementation" do
|
5
|
-
let(:div_object) {
|
6
|
-
|
7
|
-
it "should
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
end
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Symbiont::WebObjects::Div do
|
4
|
+
describe "implementation" do
|
5
|
+
let(:div_object) { Symbiont::WebObjects::Div }
|
6
|
+
|
7
|
+
it "should allow locators to be used" do
|
8
|
+
[:class, :id, :text, :index, :xpath, :title, :name].each do |t|
|
9
|
+
locator = div_object.provide_locator_for t => 'value'
|
10
|
+
locator.keys.first.should == t
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should register with a div tag" do
|
15
|
+
::Symbiont::WebObjects.get_class_for(:div).should == ::Symbiont::WebObjects::Div
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Symbiont::WebObjects::Heading do
|
4
|
+
describe "implementation" do
|
5
|
+
let(:heading_object) { Symbiont::WebObjects::Heading }
|
6
|
+
|
7
|
+
it "should allow locators to be used" do
|
8
|
+
[:class, :id, :index, :xpath, :name].each do |t|
|
9
|
+
locator = heading_object.provide_locator_for t => 'value'
|
10
|
+
locator.keys.first.should == t
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should register with an h1 tag" do
|
15
|
+
::Symbiont::WebObjects.get_class_for(:h1).should == ::Symbiont::WebObjects::Heading
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should register with an h2 tag" do
|
19
|
+
::Symbiont::WebObjects.get_class_for(:h2).should == ::Symbiont::WebObjects::Heading
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Symbiont::WebObjects::HiddenField do
|
4
|
+
describe "implementation" do
|
5
|
+
let(:hidden_field_object) { Symbiont::WebObjects::HiddenField }
|
6
|
+
|
7
|
+
it "should reference standard usable selectors" do
|
8
|
+
[:class, :id, :name, :index, :xpath, :value, :text].each do |s|
|
9
|
+
locator = hidden_field_object.provide_locator_for s => 'value'
|
10
|
+
locator.keys.first.should == s
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should register with a hidden tag" do
|
15
|
+
::Symbiont::WebObjects.get_class_for(:hidden).should == ::Symbiont::WebObjects::HiddenField
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Symbiont::WebObjects::Label do
|
4
|
+
describe "implementation" do
|
5
|
+
let(:label_object) { Symbiont::WebObjects::Label }
|
6
|
+
|
7
|
+
it "should allow locators to be used" do
|
8
|
+
[:class, :id, :text, :index, :xpath].each do |t|
|
9
|
+
locator = label_object.provide_locator_for t => 'value'
|
10
|
+
locator.keys.first.should == t
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should register with a label tag" do
|
15
|
+
::Symbiont::WebObjects.get_class_for(:label).should == ::Symbiont::WebObjects::Label
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|