druid-ts 1.1.7 → 1.1.8
Sign up to get free protection for your applications and to get access to all the features.
- 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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 223b927cff511fe3738931183652014d9fdbda26
|
4
|
+
data.tar.gz: 3a537221dd35b55e76e041c5843c9edc578e50ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 185b221ecef0f768a161ad3eeeb66d6f627050e264225942e12691fccba97cfd41f12043d60d0dfb1cc05d64d162c50d3b5d1908ff14dea9617bfdc2eb6df9a1
|
7
|
+
data.tar.gz: 3180f4ad4980423dcf9571a6a73ff9e7169758797a1dd9e9c3cafbab2fdc256cd5a8918bc3b159870ebb779fb7e9e4b30aaffc02703d7cd18552428f3da0055c
|
data/ChangeLog
CHANGED
@@ -1,3 +1,62 @@
|
|
1
|
+
=== 2017-01-19
|
2
|
+
* Enhancements
|
3
|
+
* Added elements method to accessor so one can generate methods for generic collections of elements
|
4
|
+
=== Version 1.1.8/2017-01-18
|
5
|
+
* Enhancements
|
6
|
+
* Added ability to find elements using any valid attribute
|
7
|
+
* Updated populate_page_with to also check if the element is visible prior to setting value
|
8
|
+
* Added plural _elements methods for the following types:
|
9
|
+
* area
|
10
|
+
* canvas
|
11
|
+
* audio
|
12
|
+
* video
|
13
|
+
* svg
|
14
|
+
* Added basic element support for the following types:
|
15
|
+
* as
|
16
|
+
* blockquote
|
17
|
+
* body
|
18
|
+
* br
|
19
|
+
* caption
|
20
|
+
* col
|
21
|
+
* colgroup
|
22
|
+
* command
|
23
|
+
* data
|
24
|
+
* datalist
|
25
|
+
* del
|
26
|
+
* details
|
27
|
+
* dialog
|
28
|
+
* dl
|
29
|
+
* embed
|
30
|
+
* fieldset
|
31
|
+
* head
|
32
|
+
* hr
|
33
|
+
* ins
|
34
|
+
* keygen
|
35
|
+
* legend
|
36
|
+
* map
|
37
|
+
* menu
|
38
|
+
* meta
|
39
|
+
* meter
|
40
|
+
* object
|
41
|
+
* optgroup
|
42
|
+
* output
|
43
|
+
* param
|
44
|
+
* pre
|
45
|
+
* progress
|
46
|
+
* small
|
47
|
+
* strong
|
48
|
+
* style
|
49
|
+
* time
|
50
|
+
* title
|
51
|
+
* track
|
52
|
+
* Fixes
|
53
|
+
* Fixed issue when using the page and element accessors for html 5 elements
|
54
|
+
=== 2017-01-17
|
55
|
+
* Enhancements
|
56
|
+
* Added :using_params parameter to both on_page and if_page methods
|
57
|
+
* Fixed issue with generic element calls
|
58
|
+
* Added support for the svg element
|
59
|
+
* Support label locators on TextArea, SelectList, RadioButton and FileField
|
1
60
|
=== Version-1.1.7/2017-01-16
|
2
61
|
* Enhancements
|
3
62
|
* Updated expected_element to use the global default element wait by default
|
data/Gemfile
CHANGED
data/druid.gemspec
CHANGED
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.require_paths = ["lib"]
|
21
21
|
|
22
22
|
s.add_dependency "watir-webdriver", ">= 0.9.1"
|
23
|
+
s.add_dependency "page_navigation", ">= 0.10"
|
23
24
|
s.add_development_dependency "rspec", ">= 3.4.0"
|
24
25
|
s.add_development_dependency "cucumber", ">= 1.3.20"
|
25
26
|
s.add_development_dependency "rack", ">= 1.0"
|
data/features/area.feature
CHANGED
data/features/audio.feature
CHANGED
data/features/canvas.feature
CHANGED
data/features/checkbox.feature
CHANGED
data/features/div.feature
CHANGED
data/features/element.feature
CHANGED
@@ -24,6 +24,7 @@ Feature: Elements
|
|
24
24
|
And I should know it is equal to itself
|
25
25
|
And I should know its' tag name is "a"
|
26
26
|
And I should know the attribute "readonly" is false
|
27
|
+
And I should know the attribute "href" includes "success.html"
|
27
28
|
And I should know its' value is ""
|
28
29
|
And I should be able to click it
|
29
30
|
|
@@ -237,3 +238,17 @@ Feature: Elements
|
|
237
238
|
When I retrieve a heading element
|
238
239
|
And I scroll the heading element into view
|
239
240
|
Then the heading element should be visible
|
241
|
+
|
242
|
+
Scenario: Expanding how we find elemnts to include non-stardard locators
|
243
|
+
When I retrieve a div using data-entity
|
244
|
+
Then I should know it exists
|
245
|
+
And I should know it is visible
|
246
|
+
And I should know the text is "found using data-entity"
|
247
|
+
|
248
|
+
Scenario: Accessing an HTML 5 element using the declaration
|
249
|
+
When I retrieve the figure uisng the declaration
|
250
|
+
Then I should see the figure contains an image
|
251
|
+
|
252
|
+
Scenario: Accessing an HTML 5 element using the element method
|
253
|
+
When I retrieve the figure using the element
|
254
|
+
Then I should see the figure contains an image
|
data/features/file_field.feature
CHANGED
data/features/form.feature
CHANGED
@@ -22,3 +22,8 @@ Feature: Generic Elements
|
|
22
22
|
Scenario: Getting the text from the details element
|
23
23
|
When I get the text from the details
|
24
24
|
Then the text should be "The summary The details"
|
25
|
+
|
26
|
+
Scenario: Getting properties from a svg element
|
27
|
+
When I get the svg element
|
28
|
+
Then the svg width should be "100"
|
29
|
+
And the svg height should be "100"
|
data/features/heading.feature
CHANGED
@@ -29,6 +29,7 @@ Feature: Headings
|
|
29
29
|
| name |
|
30
30
|
| xpath |
|
31
31
|
| index |
|
32
|
+
| css |
|
32
33
|
|
33
34
|
@multi
|
34
35
|
Scenario Outline: Locating h1 using multiple parameters
|
@@ -56,6 +57,7 @@ Feature: Headings
|
|
56
57
|
| name |
|
57
58
|
| xpath |
|
58
59
|
| index |
|
60
|
+
| css |
|
59
61
|
|
60
62
|
@multi
|
61
63
|
Scenario Outline: Locating h2 using multiple parameters
|
@@ -83,6 +85,7 @@ Feature: Headings
|
|
83
85
|
| name |
|
84
86
|
| xpath |
|
85
87
|
| index |
|
88
|
+
| css |
|
86
89
|
|
87
90
|
@multi
|
88
91
|
Scenario Outline: Locating h3 using multiple parameters
|
@@ -111,6 +114,7 @@ Feature: Headings
|
|
111
114
|
| name |
|
112
115
|
| xpath |
|
113
116
|
| index |
|
117
|
+
| css |
|
114
118
|
|
115
119
|
@multi
|
116
120
|
Scenario Outline: Locating h4 using multiple parameters
|
@@ -139,6 +143,7 @@ Feature: Headings
|
|
139
143
|
| name |
|
140
144
|
| xpath |
|
141
145
|
| index |
|
146
|
+
| css |
|
142
147
|
|
143
148
|
@locator
|
144
149
|
Scenario: Finding a h5 dynamically
|
@@ -157,6 +162,7 @@ Feature: Headings
|
|
157
162
|
| name |
|
158
163
|
| xpath |
|
159
164
|
| index |
|
165
|
+
| css |
|
160
166
|
|
161
167
|
@locator
|
162
168
|
Scenario: Finding a h6 dynamically
|
Binary file
|
@@ -6,13 +6,15 @@
|
|
6
6
|
<p id="p_id" name="p_name" class="p_class">Static Elements Page</p>
|
7
7
|
<label for="text_field_id">Text Field</label>
|
8
8
|
<input id="text_field_id" name="text_field_name" class="text_field_class" title="text_field_title"
|
9
|
-
size="40" type="text"
|
9
|
+
data-field="title" size="40" type="text"/>
|
10
10
|
|
11
11
|
<input id="hidden_field_id" name="hidden_field_name" class="hidden_field_class"
|
12
12
|
size="40" type="hidden" value="12345" />
|
13
13
|
|
14
|
+
<label for="text_area_id">Text Area</label>
|
14
15
|
<textarea rows="2" cols="20" id="text_area_id" class="text_area_class" name="text_area_name"></textarea>
|
15
16
|
|
17
|
+
<label for="sel_list_id">Select List</label>
|
16
18
|
<select name="sel_list_name" id="sel_list_id" class="sel_list_class">
|
17
19
|
<option value="option1">Test 1</option>
|
18
20
|
<option value="option2">Test 2</option>
|
@@ -49,10 +51,16 @@
|
|
49
51
|
Your Browser does not support the video tag.
|
50
52
|
</video>
|
51
53
|
|
54
|
+
<svg width="100" height="100" id="the_svg">
|
55
|
+
<circle cx="50" cy="50" r="40" fill="red" stroke="blue" stroke-width="5" />
|
56
|
+
</svg>
|
57
|
+
|
52
58
|
<a href="success.html" id="link_id" name="link_name" class="link_class" title="link_title" >Google Search</a>
|
53
59
|
|
60
|
+
<label for="cb_id">Checkbox</label>
|
54
61
|
<input id="cb_id" name="cb_name" class="cb_class" type="checkbox" value="1" />
|
55
62
|
|
63
|
+
<label for="milk_id">Radio</label>
|
56
64
|
<input type="radio" id="milk_id" name="milk_name" class="milk_class" value="Milk"> Milk <br />
|
57
65
|
<input type="radio" id="butter_id" name="butter_name" class="butter_class" value="Butter">Butter
|
58
66
|
|
@@ -60,6 +68,10 @@
|
|
60
68
|
page-object rocks!
|
61
69
|
</div>
|
62
70
|
|
71
|
+
<div data-entity="test">
|
72
|
+
found using data-entity
|
73
|
+
</div>
|
74
|
+
|
63
75
|
<span id="span_id" name="span_name" class="span_class" title="span_title">
|
64
76
|
My alert
|
65
77
|
</span>
|
@@ -111,6 +123,8 @@
|
|
111
123
|
|
112
124
|
<form id="form_id" class="form_class" name="form_name" action="/">
|
113
125
|
</form>
|
126
|
+
|
127
|
+
<label for="file_field_id">File Field</label>
|
114
128
|
<input type="file" name="file_field_name" id="file_field_id" class="file_field_class" title="file_field_title" />
|
115
129
|
|
116
130
|
<ul id="ul_id" name="ul_name" class="ul_class">
|
@@ -159,5 +173,9 @@
|
|
159
173
|
The details
|
160
174
|
</details>
|
161
175
|
|
176
|
+
<figure id='figure_id'>
|
177
|
+
<img src="images/img_pulpit.jpg" alt="The Pulpit Rock" width="304" height="228">
|
178
|
+
</figure>
|
179
|
+
|
162
180
|
</body>
|
163
181
|
</html>
|
data/features/image.feature
CHANGED
data/features/label.feature
CHANGED
data/features/list_item.feature
CHANGED
@@ -477,3 +477,10 @@ Feature: Multi Elements
|
|
477
477
|
And the text of div 1 should be "Div 1"
|
478
478
|
And the text of div 2 should be "Div 2"
|
479
479
|
And the text of div 3 should be "Div 3"
|
480
|
+
|
481
|
+
Scenario: Selecting multiple generic element types
|
482
|
+
When I select the multiple elements with a tag label
|
483
|
+
Then I should have 3 labels
|
484
|
+
And the text for label 1 should be "Label 1"
|
485
|
+
And the text for label 2 should be "Label 2"
|
486
|
+
And the text for label 3 should be "Label 3"
|
data/features/paragraph.feature
CHANGED
data/features/span.feature
CHANGED
@@ -142,3 +142,28 @@ end
|
|
142
142
|
Then(/^the heading element should be visible$/) do
|
143
143
|
expect(@element).to be_visible
|
144
144
|
end
|
145
|
+
|
146
|
+
When(/^I retrieve a div using data\-entity$/) do
|
147
|
+
@element = @page.div_data_entity_element
|
148
|
+
end
|
149
|
+
|
150
|
+
Then(/^I should know the text is "([^"]*)"$/) do |text|
|
151
|
+
expect(@element.text).to eql text
|
152
|
+
end
|
153
|
+
|
154
|
+
When(/^I retrieve the figure uisng the declaration$/) do
|
155
|
+
@element = @page.figure_id_element
|
156
|
+
end
|
157
|
+
|
158
|
+
Then(/^I should see the figure contains an image$/) do
|
159
|
+
expect(@element.image_element).not_to be nil
|
160
|
+
end
|
161
|
+
|
162
|
+
When(/^I retrieve the figure using the element$/) do
|
163
|
+
@element = @page.figure_element(:id => 'figure_id')
|
164
|
+
end
|
165
|
+
|
166
|
+
Then(/^I should know the attribute "([^"]*)" includes "([^"]*)"$/) do |attribute, included|
|
167
|
+
@attr = @element.attribute(attribute)
|
168
|
+
expect(@attr).to include included
|
169
|
+
end
|
@@ -17,3 +17,15 @@ end
|
|
17
17
|
When(/^I get the text from the details$/) do
|
18
18
|
@text = @page.details_id
|
19
19
|
end
|
20
|
+
|
21
|
+
When(/^I get the svg element$/) do
|
22
|
+
@svg= @page.svg_id_element
|
23
|
+
end
|
24
|
+
|
25
|
+
Then(/^the svg width should be "([^"]*)"$/) do |width|
|
26
|
+
expect(@svg.attribute('width')).to eql width
|
27
|
+
end
|
28
|
+
|
29
|
+
Then(/^the svg height should be "([^"]*)"$/) do |height|
|
30
|
+
expect(@svg.attribute('height')).to eql height
|
31
|
+
end
|
@@ -27,6 +27,7 @@ class MultiElementsPage
|
|
27
27
|
paragraphs(:the_paragraphs, :class => 'p')
|
28
28
|
labels(:the_labels, :class => 'label')
|
29
29
|
file_fields(:the_file_fields, :class => 'file_field_class')
|
30
|
+
elements(:generic_label, :label, :css => '.label')
|
30
31
|
divs(:block_divs) do |page|
|
31
32
|
page.div_elements(:class => 'div')
|
32
33
|
end
|
@@ -520,3 +521,7 @@ end
|
|
520
521
|
When(/^I select the divs using a block$/) do
|
521
522
|
@elements = @page.block_divs_elements
|
522
523
|
end
|
524
|
+
|
525
|
+
When(/^I select the multiple elements with a tag label$/) do
|
526
|
+
@elements = @page.generic_label_elements
|
527
|
+
end
|