druid-ts 1.1.7 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog +59 -0
- data/Gemfile +1 -0
- data/druid.gemspec +1 -0
- data/features/area.feature +1 -0
- data/features/audio.feature +1 -0
- data/features/canvas.feature +1 -0
- data/features/checkbox.feature +2 -0
- data/features/div.feature +1 -0
- data/features/element.feature +15 -0
- data/features/file_field.feature +2 -0
- data/features/form.feature +1 -0
- data/features/generic_elements.feature +5 -0
- data/features/heading.feature +6 -0
- data/features/hidden_field.feature +1 -0
- data/features/html/images/img_pulpit.jpg +0 -0
- data/features/html/static_elements.html +19 -1
- data/features/image.feature +1 -0
- data/features/label.feature +1 -0
- data/features/list_item.feature +1 -0
- data/features/multi_elements.feature +7 -0
- data/features/ordered_list.feature +1 -0
- data/features/paragraph.feature +1 -0
- data/features/radio_button.feature +2 -0
- data/features/select_list.feature +2 -2
- data/features/span.feature +2 -1
- data/features/step_definations/element_steps.rb +25 -0
- data/features/step_definations/generic_element_steps.rb +12 -0
- data/features/step_definations/multi_elements_steps.rb +5 -0
- data/features/support/page.rb +37 -2
- data/features/table.feature +1 -0
- data/features/table_cell.feature +1 -0
- data/features/text_area.feature +2 -0
- data/features/text_field.feature +2 -0
- data/features/unordered_list.feature +1 -0
- data/features/video.feature +1 -0
- data/lib/druid/accessors.rb +117 -84
- data/lib/druid/assist.rb +19 -1
- data/lib/druid/elements/canvas.rb +1 -1
- data/lib/druid/elements/check_box.rb +1 -1
- data/lib/druid/elements/element.rb +1 -1
- data/lib/druid/elements/file_field.rb +1 -1
- data/lib/druid/elements/radio_button.rb +1 -1
- data/lib/druid/elements/select_list.rb +1 -1
- data/lib/druid/elements/text_area.rb +3 -0
- data/lib/druid/locator_generator.rb +112 -58
- data/lib/druid/page_factory.rb +17 -83
- data/lib/druid/page_populator.rb +2 -1
- data/lib/druid/version.rb +1 -1
- data/spec/druid/druid_spec.rb +1 -1
- data/spec/druid/page_factory_spec.rb +12 -11
- data/spec/druid/page_populator_spec.rb +27 -0
- metadata +17 -1
data/lib/druid/version.rb
CHANGED
data/spec/druid/druid_spec.rb
CHANGED
@@ -229,7 +229,7 @@ describe Druid do
|
|
229
229
|
end
|
230
230
|
|
231
231
|
@page = CallbackPage.new(driver)
|
232
|
-
expect(@page.initialize_accessors.usec).to be
|
232
|
+
expect(@page.initialize_accessors.usec).to be <= @page.initialize_page.usec
|
233
233
|
end
|
234
234
|
|
235
235
|
it "should convert a modal popup to a window" do
|
@@ -179,13 +179,13 @@ describe Druid::PageFactory do
|
|
179
179
|
end
|
180
180
|
|
181
181
|
it "should raise an error when you do not provide a default route" do
|
182
|
-
expect { Druid::PageFactory.routes = {:another => []} }.to raise_error 'You must provide a :default route
|
182
|
+
expect { Druid::PageFactory.routes = {:another => []} }.to raise_error 'You must provide a :default route'
|
183
183
|
end
|
184
184
|
|
185
185
|
it "should store the routes" do
|
186
186
|
routes = ['a', 'b', 'c']
|
187
187
|
Druid::PageFactory.routes = {:default => routes}
|
188
|
-
expect(Druid::PageFactory.
|
188
|
+
expect(Druid::PageFactory.routes[:default]).to eql routes
|
189
189
|
end
|
190
190
|
|
191
191
|
it "should navigate to a page calling the default methods" do
|
@@ -220,15 +220,16 @@ describe Druid::PageFactory do
|
|
220
220
|
end
|
221
221
|
|
222
222
|
it "should know how to continue routing from a location" do
|
223
|
-
Druid::PageFactory.routes = {
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
223
|
+
Druid::PageFactory.routes = {:default => [[FactoryTestDruid, :a_method], [AnotherPage, :b_method], [YetAnotherPage, :c_method]]}
|
224
|
+
world.current_page = FactoryTestDruid.new(driver)
|
225
|
+
f_page = FactoryTestDruid.new(driver)
|
226
|
+
allow(FactoryTestDruid).to receive(:new).with(driver,false).and_return(f_page)
|
227
|
+
allow(f_page).to receive(:respond_to?).with(:a_method).and_return(true)
|
228
|
+
allow(f_page).to receive(:a_method)
|
229
|
+
a_page = AnotherPage.new(driver)
|
230
|
+
allow(AnotherPage).to receive(:new).with(driver,false).and_return(a_page)
|
231
|
+
allow(a_page).to receive(:respond_to?).with(:b_method).and_return(true)
|
232
|
+
allow(a_page).to receive(:b_method)
|
232
233
|
expect(world.continue_navigation_to(YetAnotherPage).class).to eql YetAnotherPage
|
233
234
|
end
|
234
235
|
end
|
@@ -26,6 +26,15 @@ describe Druid::PagePopulator do
|
|
26
26
|
druid.populate_page_with('coffee' => 'value')
|
27
27
|
end
|
28
28
|
|
29
|
+
it "should not populate a text field when it is not visible" do
|
30
|
+
expect(druid).not_to receive(:tf=)
|
31
|
+
expect(druid).to receive(:tf_element).twice.and_return(driver)
|
32
|
+
expect(driver).to receive(:enabled?).and_return(true)
|
33
|
+
expect(driver).to receive(:visible?).and_return(false)
|
34
|
+
expect(driver).to receive(:tag_name).and_return('input')
|
35
|
+
druid.populate_page_with('tf' => true)
|
36
|
+
end
|
37
|
+
|
29
38
|
it "should set a value in a text area" do
|
30
39
|
expect(druid).to receive(:ta=).with('value')
|
31
40
|
expect(druid).to receive(:ta_element).and_return(driver)
|
@@ -77,6 +86,15 @@ describe Druid::PagePopulator do
|
|
77
86
|
druid.populate_page_with('cb' => true)
|
78
87
|
end
|
79
88
|
|
89
|
+
it "should not populate a checkbox if it is not visible" do
|
90
|
+
expect(druid).not_to receive(:check_cb)
|
91
|
+
expect(druid).to receive(:cb_element).twice.and_return(driver)
|
92
|
+
expect(driver).to receive(:enabled?).and_return(true)
|
93
|
+
expect(driver).to receive(:visible?).and_return(false)
|
94
|
+
expect(driver).to receive(:tag_name).and_return('input')
|
95
|
+
druid.populate_page_with('cb' => true)
|
96
|
+
end
|
97
|
+
|
80
98
|
it "should not populate a radio button when it is disabled" do
|
81
99
|
expect(druid).not_to receive(:select_rb)
|
82
100
|
expect(druid).to receive(:rb_element).twice.and_return(driver)
|
@@ -93,4 +111,13 @@ describe Druid::PagePopulator do
|
|
93
111
|
druid.populate_page_with('tf' => 'test')
|
94
112
|
end
|
95
113
|
|
114
|
+
it "should not populate a radio button when it is not visible" do
|
115
|
+
expect(druid).not_to receive(:select_rb)
|
116
|
+
expect(druid).to receive(:rb_element).twice.and_return(driver)
|
117
|
+
expect(driver).to receive(:enabled?).and_return(true)
|
118
|
+
expect(driver).to receive(:visible?).and_return(false)
|
119
|
+
expect(driver).to receive(:tag_name).and_return('input')
|
120
|
+
druid.populate_page_with('rb' => true)
|
121
|
+
end
|
122
|
+
|
96
123
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: druid-ts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Sheng
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.9.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: page_navigation
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.10'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.10'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rspec
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -107,6 +121,7 @@ files:
|
|
107
121
|
- features/html/hover.html
|
108
122
|
- features/html/iframes.html
|
109
123
|
- features/html/images/circle.png
|
124
|
+
- features/html/images/img_pulpit.jpg
|
110
125
|
- features/html/modal.html
|
111
126
|
- features/html/modal_1.html
|
112
127
|
- features/html/modal_2.html
|
@@ -319,6 +334,7 @@ test_files:
|
|
319
334
|
- features/html/hover.html
|
320
335
|
- features/html/iframes.html
|
321
336
|
- features/html/images/circle.png
|
337
|
+
- features/html/images/img_pulpit.jpg
|
322
338
|
- features/html/modal.html
|
323
339
|
- features/html/modal_1.html
|
324
340
|
- features/html/modal_2.html
|