druid-s 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (219) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +7 -0
  3. data/.rspec +1 -0
  4. data/.rvmrc +1 -0
  5. data/.travis.yml +27 -0
  6. data/ChangeLog +541 -0
  7. data/Gemfile +8 -0
  8. data/README.md +78 -0
  9. data/Rakefile +33 -0
  10. data/cucumber.yml +6 -0
  11. data/druid.gemspec +30 -0
  12. data/features/area.feature +33 -0
  13. data/features/async.feature +16 -0
  14. data/features/audio.feature +61 -0
  15. data/features/bold.feature +20 -0
  16. data/features/button.feature +81 -0
  17. data/features/canvas.feature +34 -0
  18. data/features/checkbox.feature +48 -0
  19. data/features/div.feature +45 -0
  20. data/features/element.feature +281 -0
  21. data/features/file_field.feature +38 -0
  22. data/features/form.feature +37 -0
  23. data/features/frames.feature +76 -0
  24. data/features/generic_elements.feature +29 -0
  25. data/features/heading.feature +160 -0
  26. data/features/hidden_field.feature +39 -0
  27. data/features/html/async.html +31 -0
  28. data/features/html/frame_1.html +18 -0
  29. data/features/html/frame_2.html +16 -0
  30. data/features/html/frame_3.html +14 -0
  31. data/features/html/frames.html +12 -0
  32. data/features/html/hover.html +11 -0
  33. data/features/html/iframes.html +12 -0
  34. data/features/html/images/circle.png +0 -0
  35. data/features/html/images/img_pulpit.jpg +0 -0
  36. data/features/html/modal.html +17 -0
  37. data/features/html/modal_1.html +38 -0
  38. data/features/html/modal_2.html +27 -0
  39. data/features/html/multi_elements.html +145 -0
  40. data/features/html/nested_elements.html +75 -0
  41. data/features/html/nested_frame_1.html +1 -0
  42. data/features/html/nested_frame_2.html +11 -0
  43. data/features/html/nested_frame_3.html +14 -0
  44. data/features/html/nested_frames.html +10 -0
  45. data/features/html/planets.gif +0 -0
  46. data/features/html/static_elements.html +203 -0
  47. data/features/html/success.html +8 -0
  48. data/features/html/sun.gif +0 -0
  49. data/features/html/sun.html +7 -0
  50. data/features/image.feature +47 -0
  51. data/features/italic.feature +20 -0
  52. data/features/javascript.feature +28 -0
  53. data/features/label.feature +43 -0
  54. data/features/link.feature +56 -0
  55. data/features/list_item.feature +37 -0
  56. data/features/modal_dialog.feature +9 -0
  57. data/features/multi_elements.feature +498 -0
  58. data/features/nested_elements.feature +121 -0
  59. data/features/ordered_list.feature +46 -0
  60. data/features/page_level_actions.feature +116 -0
  61. data/features/paragraph.feature +33 -0
  62. data/features/populate_page_with.feature +25 -0
  63. data/features/radio_button.feature +51 -0
  64. data/features/radio_button_group.feature +28 -0
  65. data/features/sample-app/public/04-Death_Becomes_Fur.mp4 +0 -0
  66. data/features/sample-app/public/04-Death_Becomes_Fur.oga +0 -0
  67. data/features/sample-app/public/audio_video.html +19 -0
  68. data/features/sample-app/public/jquery-1.3.2.js +4376 -0
  69. data/features/sample-app/public/jquery.html +28 -0
  70. data/features/sample-app/public/movie.mp4 +0 -0
  71. data/features/sample-app/public/movie.ogg +0 -0
  72. data/features/sample-app/public/prototype-1.6.0.3.js +4320 -0
  73. data/features/sample-app/public/prototype.html +32 -0
  74. data/features/sample-app/sample_app.rb +35 -0
  75. data/features/section.feature +132 -0
  76. data/features/select_list.feature +84 -0
  77. data/features/span.feature +43 -0
  78. data/features/step_definations/area_steps.rb +23 -0
  79. data/features/step_definations/async_steps.rb +80 -0
  80. data/features/step_definations/audio_steps.rb +47 -0
  81. data/features/step_definations/bold_steps.rb +11 -0
  82. data/features/step_definations/button_steps.rb +52 -0
  83. data/features/step_definations/canvas_steps.rb +19 -0
  84. data/features/step_definations/checkbox_steps.rb +39 -0
  85. data/features/step_definations/div_steps.rb +28 -0
  86. data/features/step_definations/element_steps.rb +217 -0
  87. data/features/step_definations/file_field_steps.rb +31 -0
  88. data/features/step_definations/form_steps.rb +23 -0
  89. data/features/step_definations/frame_steps.rb +189 -0
  90. data/features/step_definations/generic_element_steps.rb +31 -0
  91. data/features/step_definations/heading_steps.rb +39 -0
  92. data/features/step_definations/hidden_field_steps.rb +27 -0
  93. data/features/step_definations/image_steps.rb +35 -0
  94. data/features/step_definations/italic_steps.rb +11 -0
  95. data/features/step_definations/javasript_steps.rb +52 -0
  96. data/features/step_definations/label_steps.rb +19 -0
  97. data/features/step_definations/link_steps.rb +42 -0
  98. data/features/step_definations/list_item_steps.rb +24 -0
  99. data/features/step_definations/modal_dialog_steps.rb +38 -0
  100. data/features/step_definations/multi_elements_steps.rb +557 -0
  101. data/features/step_definations/nested_elements_steps.rb +219 -0
  102. data/features/step_definations/ordered_list_steps.rb +49 -0
  103. data/features/step_definations/page_level_actions_steps.rb +172 -0
  104. data/features/step_definations/page_traversal_steps.rb +4 -0
  105. data/features/step_definations/paragraph_steps.rb +19 -0
  106. data/features/step_definations/populate_page_with_steps.rb +3 -0
  107. data/features/step_definations/radio_button_group_steps.rb +32 -0
  108. data/features/step_definations/radio_button_steps.rb +31 -0
  109. data/features/step_definations/section_steps.rb +271 -0
  110. data/features/step_definations/select_list_steps.rb +91 -0
  111. data/features/step_definations/span_steps.rb +23 -0
  112. data/features/step_definations/table_cell_steps.rb +27 -0
  113. data/features/step_definations/table_row_steps.rb +23 -0
  114. data/features/step_definations/table_steps.rb +109 -0
  115. data/features/step_definations/text_area_steps.rb +39 -0
  116. data/features/step_definations/text_field_steps.rb +39 -0
  117. data/features/step_definations/unordered_list_steps.rb +27 -0
  118. data/features/step_definations/video_steps.rb +27 -0
  119. data/features/support/ajax_test_environment.rb +26 -0
  120. data/features/support/audio_video_page.rb +23 -0
  121. data/features/support/env.rb +5 -0
  122. data/features/support/hooks.rb +3 -0
  123. data/features/support/page.rb +372 -0
  124. data/features/support/persistent_browser.rb +58 -0
  125. data/features/support/targets/firefox14_osx.rb +5 -0
  126. data/features/support/targets/firefox14_windows7.rb +5 -0
  127. data/features/support/url_helper.rb +50 -0
  128. data/features/table.feature +127 -0
  129. data/features/table_cell.feature +42 -0
  130. data/features/table_row.feature +30 -0
  131. data/features/text_area.feature +44 -0
  132. data/features/text_field.feature +53 -0
  133. data/features/unordered_list.feature +46 -0
  134. data/features/video.feature +66 -0
  135. data/lib/druid/accessors.rb +1082 -0
  136. data/lib/druid/assist.rb +653 -0
  137. data/lib/druid/element_locators.rb +21 -0
  138. data/lib/druid/elements/area.rb +9 -0
  139. data/lib/druid/elements/audio.rb +9 -0
  140. data/lib/druid/elements/bold.rb +8 -0
  141. data/lib/druid/elements/button.rb +12 -0
  142. data/lib/druid/elements/canvas.rb +9 -0
  143. data/lib/druid/elements/check_box.rb +9 -0
  144. data/lib/druid/elements/div.rb +9 -0
  145. data/lib/druid/elements/element.rb +187 -0
  146. data/lib/druid/elements/file_field.rb +9 -0
  147. data/lib/druid/elements/form.rb +9 -0
  148. data/lib/druid/elements/heading.rb +14 -0
  149. data/lib/druid/elements/hidden_field.rb +9 -0
  150. data/lib/druid/elements/image.rb +9 -0
  151. data/lib/druid/elements/italic.rb +9 -0
  152. data/lib/druid/elements/label.rb +8 -0
  153. data/lib/druid/elements/link.rb +9 -0
  154. data/lib/druid/elements/list_item.rb +9 -0
  155. data/lib/druid/elements/media.rb +11 -0
  156. data/lib/druid/elements/option.rb +9 -0
  157. data/lib/druid/elements/ordered_list.rb +29 -0
  158. data/lib/druid/elements/paragraph.rb +9 -0
  159. data/lib/druid/elements/radio_button.rb +9 -0
  160. data/lib/druid/elements/select_list.rb +30 -0
  161. data/lib/druid/elements/span.rb +9 -0
  162. data/lib/druid/elements/table.rb +92 -0
  163. data/lib/druid/elements/table_cell.rb +11 -0
  164. data/lib/druid/elements/table_row.rb +50 -0
  165. data/lib/druid/elements/text_area.rb +10 -0
  166. data/lib/druid/elements/text_field.rb +11 -0
  167. data/lib/druid/elements/unordered_list.rb +32 -0
  168. data/lib/druid/elements/video.rb +8 -0
  169. data/lib/druid/elements.rb +55 -0
  170. data/lib/druid/javascript/angularjs.rb +12 -0
  171. data/lib/druid/javascript/jquery.rb +12 -0
  172. data/lib/druid/javascript/prototype.rb +12 -0
  173. data/lib/druid/javascript/yui.rb +19 -0
  174. data/lib/druid/javascript_framework_facade.rb +76 -0
  175. data/lib/druid/locator_generator.rb +181 -0
  176. data/lib/druid/nested_elements.rb +56 -0
  177. data/lib/druid/page_factory.rb +115 -0
  178. data/lib/druid/page_populator.rb +104 -0
  179. data/lib/druid/section_collection.rb +17 -0
  180. data/lib/druid/version.rb +3 -0
  181. data/lib/druid.rb +452 -0
  182. data/spec/druid/accessors_spec.rb +1209 -0
  183. data/spec/druid/druid_spec.rb +295 -0
  184. data/spec/druid/element_locators_spec.rb +750 -0
  185. data/spec/druid/elements/bold_spec.rb +12 -0
  186. data/spec/druid/elements/button_spec.rb +23 -0
  187. data/spec/druid/elements/check_box_spec.rb +14 -0
  188. data/spec/druid/elements/div_spec.rb +10 -0
  189. data/spec/druid/elements/element_spec.rb +250 -0
  190. data/spec/druid/elements/file_field_spec.rb +13 -0
  191. data/spec/druid/elements/form_spec.rb +18 -0
  192. data/spec/druid/elements/heading_spec.rb +30 -0
  193. data/spec/druid/elements/hidden_field_spec.rb +10 -0
  194. data/spec/druid/elements/image_spec.rb +23 -0
  195. data/spec/druid/elements/itatic_spec.rb +11 -0
  196. data/spec/druid/elements/label_spec.rb +10 -0
  197. data/spec/druid/elements/link_spec.rb +10 -0
  198. data/spec/druid/elements/list_item_spec.rb +10 -0
  199. data/spec/druid/elements/media_spec.rb +12 -0
  200. data/spec/druid/elements/option_spec.rb +21 -0
  201. data/spec/druid/elements/ordered_list_spec.rb +38 -0
  202. data/spec/druid/elements/page_factory_spec.rb +40 -0
  203. data/spec/druid/elements/paragraph_spec.rb +12 -0
  204. data/spec/druid/elements/radio_button_spec.rb +14 -0
  205. data/spec/druid/elements/select_list_spec.rb +51 -0
  206. data/spec/druid/elements/span_spec.rb +10 -0
  207. data/spec/druid/elements/table_cell_spec.rb +14 -0
  208. data/spec/druid/elements/table_row_spec.rb +34 -0
  209. data/spec/druid/elements/table_spec.rb +47 -0
  210. data/spec/druid/elements/text_area_spec.rb +13 -0
  211. data/spec/druid/elements/text_field_spec.rb +22 -0
  212. data/spec/druid/elements/unordered_list_spec.rb +39 -0
  213. data/spec/druid/javascript_framework_facade_spec.rb +59 -0
  214. data/spec/druid/nested_element_spec.rb +128 -0
  215. data/spec/druid/page_factory_spec.rb +235 -0
  216. data/spec/druid/page_populator_spec.rb +173 -0
  217. data/spec/druid/page_section_spec.rb +70 -0
  218. data/spec/spec_helper.rb +9 -0
  219. metadata +517 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 0b09d4fbd7519d447203a1308bb7d3baf9d552f4715156b8fb855c561ed9d544
4
+ data.tar.gz: 311276d42192ec7967ec33ddd44d7e9dd8babc0e0f922889f700472858a19016
5
+ SHA512:
6
+ metadata.gz: 5a336ff08053e75934ec6ab743b4322940e1fa92c561bedebf614b4f4ad496e0fe7955600fa252cb68303cf3c6adc391fef4a61b95b334f9502152b00105e4e0
7
+ data.tar.gz: a8f449fba8a94408275c81f61b9c5d180aeff5fadd063e1bdf192701ed56401ae93316629e58ffecea09fd3138dc60c107817e74385197b87be009155043bb4a
data/.gitignore ADDED
@@ -0,0 +1,7 @@
1
+ Gemfile.lock
2
+ coverage
3
+ druid*.gem
4
+ .idea/
5
+ pkg
6
+ *.swp
7
+ .DS_Store
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color --format doc
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm 2.3.0
data/.travis.yml ADDED
@@ -0,0 +1,27 @@
1
+ sudo: required
2
+ dist: trusty
3
+ rvm:
4
+ - 2.2.5
5
+ - 2.2.7
6
+ - 2.3.4
7
+ - 2.3.1
8
+ - 2.4.1
9
+ - 3.2.2
10
+ cache: bundler
11
+ before_script:
12
+ - export CHROME_BIN=/usr/bin/google-chrome
13
+ - "export DISPLAY=:99.0"
14
+ - "sh -e /etc/init.d/xvfb start"
15
+ - sudo apt-get update
16
+ - sudo apt-get install -y libappindicator1 fonts-liberation
17
+ - wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
18
+ - sudo dpkg -i google-chrome*.deb
19
+ - CHROMEDRIVER_VERSION=$(curl -s http://chromedriver.storage.googleapis.com/LATEST_RELEASE)
20
+ - curl -L -O "http://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip"
21
+ - unzip chromedriver_linux64.zip
22
+ - chmod +x chromedriver
23
+ - sudo mv chromedriver /usr/local/bin
24
+ script: bundle exec rake $RAKE_TASK
25
+ env:
26
+ - RAKE_TASK=spec
27
+ - RAKE_TASK=features:watir
data/ChangeLog ADDED
@@ -0,0 +1,541 @@
1
+ === Version 1.2.6/ 2019-04-09
2
+ * Enhancements
3
+ * populate_page_with will work with anything that can be converted to a Hash
4
+ * Fixes
5
+ * Fixed present? when using with ActiveSupport
6
+ * Fixed issues with when_visible and when_not_visible
7
+ === Version 1.2.5/ 2017-10-16
8
+ * Enhancements
9
+ * Added the ability to get the values of a table column
10
+ * Added the ability to populate sections with a nested entry from data_magic
11
+ === 2017-10-15
12
+ * Enhancements
13
+ * Added the preceding_sibling method to Element
14
+ * Added the following_sibling method to Element
15
+ * Added the siblings method to Element
16
+ * Added the children method to Element
17
+ * Added the preceding_siblings method to Element
18
+ * Added the following_siblings method to Element
19
+ * Fixes
20
+ * Fixed issue that occurred when things were moved around in Watir 6.8
21
+ === 2017-10-12
22
+ * Enhancements
23
+ * Fix bug in integration of frames and sections
24
+ * delegate select list text method directly to watir
25
+ * optimize the way to generate a array of symbol
26
+ === Version 1.2.4/ 2017-06-12
27
+ * Add cookies method to druid
28
+ === Version 1.2.3/ 2017-04-24
29
+ * Removed all direct delegateds. Now relies on method_missing to call Watir methods.
30
+ * You may have to change RSpec matchers to use method instead of predicate.
31
+ === Version 1.2.2/ 2017/02-14
32
+ * Enhancements
33
+ * Added wait method to page class(wait document readystate as complete)
34
+ * When_visible and when_not_visible now wait for element to be present before checking
35
+ * Populate_page_with can populate select_list using values
36
+ * Remove all custom locator mappings
37
+ === Version 1.2.1/ 2017-01-26
38
+ * Enhancements
39
+ * Added array methods to section collections
40
+ * Added ability to call style method with no parameters
41
+ * clean up frame and iframe nesting
42
+ * Update travis.yml
43
+ * Added numerous missing element types
44
+ * Added two new methods that check without throwing exception
45
+ * Update to use watir 6 instead of watir-webdriver
46
+ === 2017-01-25
47
+ * Enhancements
48
+ * Added list_items method to UnorderedList to get an array of children.
49
+ * Speed optimizations for UnorderedList
50
+ * Added list_items method to OrderedList to get an array of children
51
+ * Speed optimization for OrderedList
52
+ * Added support for the Italic(i) element
53
+ * Added size and location methods to all elements
54
+ * Added width, height, and centre methods for elements
55
+ ===Version 1.2.0/ 2017-01-24
56
+ * Enhancements
57
+ * Added new page_section/ page_sections method to accessor
58
+ * Added row accessors method and support for finding row elements directly
59
+ * Default element tag to element
60
+ === Version 1.1.9/2017-01-22
61
+ * Enhancements
62
+ * Populate_page_with now supports radio groups
63
+ * Added new page_url_value mehod that is created when you define page_url to return the value
64
+ * Checking the name of accessors to ensure it does not conflict with an existing druid method name
65
+ * Added support for dynamically finding elements inside iframes
66
+ * Reverted the method name check due to unintended consequences
67
+ * Added support to use multiple identifiers when locating nested frames / iframes
68
+ * Remove methods for clearing radio buttons
69
+ * Add support bold tag
70
+ * Fixed wait_for_expected_title so it detects if the title changes
71
+ === 2017-01-20
72
+ * Enhancements
73
+ * Super called when factory method invoked with non Druid class
74
+ * populate_page_with
75
+ === 2017-01-19
76
+ * Enhancements
77
+ * Added elements method to accessor so one can generate methods for generic collections of elements
78
+ * Added class_name method to Element
79
+ * Added wait_for_expected_title and expected_element_visible methods
80
+ * Added select_text method to Element
81
+ * Added ability for execute_scripts to accept arguments
82
+ * Added ability to identify frame using a regular expression when using Watir
83
+ * Added href method to Link
84
+ * Added generation of plural version of basic types on class
85
+ * added accessor to support radio_button_group method
86
+ * Updated in_iframe methods to match the updates to the watir-webdriver gem
87
+ === Version 1.1.8/2017-01-18
88
+ * Enhancements
89
+ * Added ability to find elements using any valid attribute
90
+ * Updated populate_page_with to also check if the element is visible prior to setting value
91
+ * Added plural _elements methods for the following types:
92
+ * area
93
+ * canvas
94
+ * audio
95
+ * video
96
+ * svg
97
+ * Added basic element support for the following types:
98
+ * as
99
+ * blockquote
100
+ * body
101
+ * br
102
+ * caption
103
+ * col
104
+ * colgroup
105
+ * command
106
+ * data
107
+ * datalist
108
+ * del
109
+ * details
110
+ * dialog
111
+ * dl
112
+ * embed
113
+ * fieldset
114
+ * head
115
+ * hr
116
+ * ins
117
+ * keygen
118
+ * legend
119
+ * map
120
+ * menu
121
+ * meta
122
+ * meter
123
+ * object
124
+ * optgroup
125
+ * output
126
+ * param
127
+ * pre
128
+ * progress
129
+ * small
130
+ * strong
131
+ * style
132
+ * time
133
+ * title
134
+ * track
135
+ * Fixes
136
+ * Fixed issue when using the page and element accessors for html 5 elements
137
+ === 2017-01-17
138
+ * Enhancements
139
+ * Added :using_params parameter to both on_page and if_page methods
140
+ * Fixed issue with generic element calls
141
+ * Added support for the svg element
142
+ * Support label locators on TextArea, SelectList, RadioButton and FileField
143
+ === Version-1.1.7/2017-01-16
144
+ * Enhancements
145
+ * Updated expected_element to use the global default element wait by default
146
+ * Added scroll_into_view method to Element
147
+ * Updated routes to accept more than two entries in the array which are passed as arguments
148
+ * Added *_element and *_elements methods to Druid and Element for the following types
149
+ * addr
150
+ * address
151
+ * article
152
+ * aside
153
+ * bdi
154
+ * bdo
155
+ * cite
156
+ * code
157
+ * dd
158
+ * dfn
159
+ * dt
160
+ * em
161
+ * figcaption
162
+ * figure
163
+ * footer
164
+ * header
165
+ * hgroup
166
+ * kbd
167
+ * mark
168
+ * nav
169
+ * noscript
170
+ * rp
171
+ * rt
172
+ * ruby
173
+ * samp
174
+ * section
175
+ * sub
176
+ * summary
177
+ * sup
178
+ * var
179
+ * wbr
180
+ === 2017-01-15
181
+ * Fixes
182
+ * Fixed issue when calling new multi-element class methods using a block
183
+ === Version 1.1.6/2017-01-13
184
+ * Enhancement
185
+ * Added callback to initialize_accessors method during initialization
186
+ * Added html method to Element
187
+ * Added generated method to return text for a table
188
+ * Added generated method to return text for an unordered list
189
+ * Added generated method to return text for an ordered list
190
+ * Added the following class level methods to return all elements matching the locator
191
+ * divs
192
+ * buttons
193
+ * text_fields
194
+ * hidden_fields
195
+ * text_areas
196
+ * select_lists
197
+ * links
198
+ * checkboxes
199
+ * radio_buttons
200
+ * spans
201
+ * tables
202
+ * cells
203
+ * images
204
+ * forms
205
+ * list_items
206
+ * unordered_lists
207
+ * ordered_lists
208
+ * h1s
209
+ * h2s
210
+ * h3s
211
+ * h4s
212
+ * h5s
213
+ * h6s
214
+ * paragraphs
215
+ * labels
216
+ * file_fields
217
+ === 2017-01-09
218
+ * Enhancement
219
+ * Added params class instance variable to hold hash values that can be used in the page
220
+ * Added ability to insert ERB into page_url string and have it access params
221
+ * Fixes
222
+ * Fixed issue when passing symbol to page_url and calling multiple times
223
+ === 2017-01-03
224
+ * Enhancement
225
+ * Added selected_values method to SelectList to get values of all selected elements
226
+ * Added ability to pass classname as string to visit_page, on_page, and if_page methods
227
+ === Version v1.1.5/ 2016-12-31
228
+ * Enhancement
229
+ * Added method to get the id of an Element
230
+ === 2016-12-30
231
+ * Enhancement
232
+ * Added hover method to Element. Browser support is limited
233
+ === 2016-12-28
234
+ * Enhancement
235
+ * Updated Table [] method to return a row that has matching partial text in any column
236
+ * Updated TableRow [] method to return column that matching partial text in any column
237
+ * Added the following aliased methods to their corresponding Accessors method
238
+ a => link
239
+ hidden => hidden_field
240
+ img => image
241
+ li => list_item
242
+ ol => ordered_list
243
+ p => paragraph
244
+ radio => radio_button
245
+ select => select_list
246
+ td => cell
247
+ textarea => text_area
248
+ ul => unordered_list
249
+ * Added support for the following new elements
250
+ Area
251
+ Canvas
252
+ Audio
253
+ Video
254
+ * Added ability to find list_item by :text
255
+ ===Version v1.1.4/ 2016-12-27
256
+ * Enhancement
257
+ * Added ability to find span's by title
258
+ * Changed order of initialization so initialize_page is called after goto
259
+ * Added flash method to Element to temporarily change the background color
260
+ * Added when_not_present method to Element
261
+ * Added default override of page level waits - Druid.default_page_wait
262
+ * Added default override of element level waits - Druid.default_element_wait
263
+ * Added the ability to find a TableRow by providing a String to the [] method
264
+ * Added the ability to find a TableCell by providing a String to the [] method from TableRow
265
+ * Updated link to be able to identify by title
266
+ * Updated div to be able to identify by title
267
+ * Added ability to find text_field by :text and :label
268
+ * Added select_value method to SelectList
269
+ * Fixes
270
+ * Modified text area methods so it clears before setting new text
271
+ * Updated [] method on Table to return nil when bad row header is provided
272
+ * Updated [] method on TableRow to return nil when bad column header is provided
273
+ * Fixed populate_page_with to work with text areas
274
+ === 2016-12-26
275
+ * Enhancement
276
+ * Changed page_url to accept a symbol that will cause it to call a corresponding method
277
+ * Updated all accessor methods to take a default identifier of {:index => 0}
278
+ * Added a page level element method to return a generic Element object
279
+ * Updated all page level element locators to take a default identifier of {:index => 0}
280
+ * Added a method to retrieve all file fields on a page
281
+ === 2016-12-23
282
+ * Enhancement
283
+ * Added #execute_script method to Druid
284
+ * Added support for finding the following using :css
285
+ Button
286
+ Link
287
+ * Added method to fetch generic element
288
+ * Support alias method 'on' for 'on_page', 'visit' for 'visit_page' on PageFactory
289
+ * Changed Elements.element_class_for so parameters can be strings or symbols
290
+ * Added element_with_focus method to return the element that has focus
291
+ * Added support for the label element
292
+ === 2016-12-20
293
+ * Fixes
294
+ WARNING: This change breaks existing code
295
+ * Changed the generated getter for select_list to return the text instead of the value
296
+ * Enhancements
297
+ * Added #expected_title method to Druid
298
+ * Added #expected_element method to Druid
299
+ === Version 1.1.2 /2016-12-19
300
+ * Enhancements
301
+ * Added #include? and #selected? to SelectList
302
+ * Added #append to TextField
303
+ * Added #wait_for_ajax support for the jQuery framework
304
+ * Added #wait_for_ajax support for the Prototype framework
305
+ * Added the ability to add new Javascript Frameworks to Druid via the #add_framework method
306
+ * Fixes
307
+ * Fixed [] methods on OrderedList and UnOrderedList so it only gets direct children
308
+ * Fixed items methods on OrderedList and UnOrderedList so it returns count of direct children
309
+ === 2016-12-14
310
+ * Enhancements
311
+ * Added shortcut method to check element exists
312
+ * Added #disabled? method to Element
313
+ * Added #selected_options method to SelectList
314
+ === Version 1.1.1 / 2016-12-13
315
+ * Enhancements
316
+ * Added ?_elements to ElementLocators so you can find all elements that match an identifier
317
+ * Added ?_elements to NestedElements so you can find all elements nested within others
318
+
319
+ === 2016-11-15
320
+ * Enhancements
321
+ * Added #navigate_to method to PageFactory to navigate to a page through previous pages
322
+ * Added routes to PageFactory to collect routes through the site
323
+ * Added #continue_navigation_to method to PageFactory which begins at @current_page
324
+ ******1.1.0******
325
+ === 2016-11-14
326
+ * Enhancements
327
+ * Added ability to find a parent of an Element
328
+ * Added #focus method to Element
329
+ === 2016-08-05
330
+ * Enhancements
331
+ * Added ability to find Checkbox by :value
332
+ * Added ability to find HiddenField by :value
333
+ * Added #fire_event method to Element
334
+ * Fixes
335
+ * Updated #populate_page_with to no longer attempt to set a value in a field that is disabled
336
+ === 2016-08-04
337
+ * Enhancements
338
+ * Added ability to find TextField by :title
339
+ * Added ability to find Image by :alt
340
+ * Added ability to find Form by :action
341
+ * Added ability to find Image by :src
342
+ === 2016-08-03
343
+ * Enhancements
344
+ * Added ability to find image buttons by src
345
+ * Added ability to find image buttons by alt
346
+ * Added first_row and last_row methods to table
347
+ * Added new module PagePopulator with single method populate_page_with
348
+ * Added deprecation warning to the method_missing method on Element.
349
+ * Added all of the file_field locators
350
+ * Added full support for file_field element
351
+ === 2016-08-02
352
+ * Enhancements
353
+ * Added all of the h5 locators
354
+ * Added all of the h6 locators
355
+ * Added all of the paragraph locators
356
+ * Added the Paragraph class
357
+ * Added #current_url to Druid
358
+ * Added #style to Element
359
+ * Added #inspect to Element
360
+ * Added #clear_cookies to Druid
361
+ * Added #save_screenshot to Druid
362
+ * Changed PageFactory so it also sets and instance variable @current_page to the newly created page
363
+ * now can find radio buttons by value
364
+ * Added instance level in_frame, in_iframe method
365
+ * Support for nesting all *_element instance methods inside in_frame call
366
+ * Support for nesting alerts inside an in_frame call
367
+ * Support for nesting confirms inside an in_frame call
368
+ * Support for nesting prompts inside an in_frame call
369
+ === 2016-08-01
370
+ * Enhancements
371
+ * Added #clear method for TextArea
372
+ * Element#when_present now returns the element object
373
+ * Element#when_visible now returns the element object
374
+ * Element#when_not_visible now returns the element object
375
+ * Added all of the h2 locators
376
+ * Added all of the h3 locators
377
+ * Added all of the h4 locators
378
+ === 2016-07-31
379
+ * Enhancements
380
+ * Added support for Heading element
381
+ * Added all of the h1 locators
382
+ === 2016-07-29
383
+ * Enhancements
384
+ * Support for locating the following elements when nested
385
+ * Link
386
+ * Button
387
+ * TextField
388
+ * HiddenField
389
+ * TextArea
390
+ * SelectList
391
+ * CheckBox
392
+ * RadioButton
393
+ * Div
394
+ * Span
395
+ * Table
396
+ * TableCell
397
+ * Image
398
+ * Form
399
+ * OrderedList
400
+ * UnOrderedList
401
+ * ListItem
402
+ * Added #modal_dialog to Druid to override the default modal dialog behavior
403
+ === 2016-07-11
404
+ * Enhancements
405
+ * Added the following instance methods to Druid via ElementLocators
406
+ * #button_element
407
+ * #text_field_element
408
+ * #hidden_field_element
409
+ * #text_area_element
410
+ * #select_list_element
411
+ * #link_element
412
+ * #checkbox_element
413
+ * #radio_button_element
414
+ * #div_element
415
+ * #span_element
416
+ * #table_element
417
+ * #cell_element
418
+ * #image_element
419
+ * #form_element
420
+ * #list_item_element
421
+ * #unordered_list_element
422
+ * #ordered_list_element
423
+ === 2016-07-05
424
+ * Enhancements
425
+ * Added #value= to TextField and TextArea
426
+ * Added #select to SelectList
427
+ * Added #check, #uncheck, and #checked? to CheckBox
428
+ * Added #select, #clear, and #selected? to RadioButton
429
+ === 2016-07-04
430
+ * Enhancements
431
+ * Can now find span by :text
432
+ * Can now find button by :value
433
+ * Added #forward and #back methods to druid object
434
+ * Added #right_click and #double_click methods to Element
435
+ === 2016-07-03
436
+ * Enhancements
437
+ * Will call callback method #initialize_page method if it exists on a page object
438
+ * Renamed all *_<element_type> methods to *_element. Created alias for backward compatibility
439
+ * Delegating unknown method calls on Element to the driver element object
440
+
441
+ === 2016-06-30
442
+ * Enhancements
443
+ * Can now find a TableCell by its' text
444
+ * If we receive an error calling #attach_to_window, wait one second and try again
445
+ === 2016-06-29
446
+ * Enhancements
447
+ * Added ability to locate div by the contained text
448
+ * Added #attach_to_window so a page object can operate on another window
449
+ * Added #send_keys to Druid::Elements::Element
450
+ * Added #refresh to page object
451
+ * Added #clear method to Element
452
+ * Added #in_frame to Accessors to handle frame and iframe access
453
+ === 2016-06-21
454
+ * Enhancements
455
+ * Handling popups
456
+ * Added #alert to page object to override default alert popup behavior
457
+ * Added #confirm to page object to override default confirm popup behavior
458
+ * Added #prompt to page object to override default prompt popup behavior
459
+ === 2016-06-20
460
+ * Enhancements
461
+ * Async handling
462
+ * Added #wait_until to page object to support for async events at page level
463
+ * Added the following methods to Druid::Elements::Element
464
+ * #when_present
465
+ * #when_visible
466
+ * #when_not_visible
467
+ * #wait_until
468
+ === Version 1.0.0
469
+ === 2016-06-04
470
+ * Enhancements
471
+ * Support for using multiple identifiers when locating the following element:
472
+ * Link
473
+ * TextField
474
+ * HiddenField
475
+ * TextArea
476
+ * SelectList
477
+ * CheckBox
478
+ * RadioButton
479
+ * Button
480
+ * Div
481
+ * Span
482
+ * Table
483
+ * TableCell
484
+ * Image
485
+ * Form
486
+ * ListItem
487
+ * UnorderedList
488
+ * OrderedList
489
+
490
+ * Support name for identification across all elements in Watir
491
+ * Added [] method to SelectList to index Options
492
+ * Added options method to Select
493
+
494
+ === 2016-06-2
495
+ * Enhancements
496
+ * Added rows method to Table to return number of rows
497
+ * Added [] method to Table to index table row element
498
+ * Added columns method to TableRow to return the number of columns
499
+ * Added [] method to TableRow to index table cell element
500
+ * Added each method to Table to iterate over the TableRows
501
+ * Added each method to TableRow to iterate over TableCells
502
+ * Added items method to UnorderedList to return number of ListItems
503
+ * Added items method to OrderedList to return number of ListItems
504
+ * Added each method to UnorderedList to iterate over the ListItems
505
+ * Added each method to OrderedList to iterate over the ListItems
506
+ * Created PageFactory module to add factory methods to your step definitions
507
+
508
+
509
+ === 2016-05-31
510
+ * Enhancements
511
+ * Added support for the following elements
512
+ * hidden field
513
+ * form
514
+ * list item
515
+ * unordered list
516
+ * ordered list
517
+ * text area
518
+
519
+ === 2016-05-30
520
+ * Enhancements
521
+ * Added support for the following elements
522
+ * div
523
+ * button
524
+ * table
525
+ * table row
526
+ * table cell
527
+ * span
528
+ * image
529
+
530
+ === 2016-05-22
531
+ * Enhancements
532
+ * Support for the following elements
533
+ * check box
534
+ * link
535
+ * radio button
536
+ * select list
537
+ * text field
538
+ * Support for the following page level functions
539
+ * text
540
+ * html
541
+ * title
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source "https://rubygems.org"
2
+
3
+ # adding rake so travis-ci will build properly
4
+ gem 'rake'
5
+ gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
6
+ gem 'listen', '~> 3.8'
7
+
8
+ gemspec
data/README.md ADDED
@@ -0,0 +1,78 @@
1
+ # druid
2
+ [![Build Status](https://travis-ci.org/timsheng/druid.png)](https://travis-ci.org/timsheng)
3
+
4
+
5
+ A simple gem that assists in creating flexible page objects for testing browser based applications. The goal is to facilitate creating abstraction layers in your tests to decouple the tests from the item they are testing and to provide a simple interface to the elements on a page. It works with watir
6
+
7
+ ### Defining your page object
8
+
9
+ You define a new druid by including the Druid module:
10
+
11
+ ````ruby
12
+ class LoginPage
13
+ include Druid
14
+ end
15
+ ````
16
+
17
+ When you include this module numerous methods are added to your class that allow you to easily define your page. For the login page you might add the following:
18
+
19
+ ````ruby
20
+ class LoginPage
21
+ include Druid
22
+
23
+ text_field(:username, :id => 'username')
24
+ text_field(:password, :id => 'password')
25
+ button(:login, :id => 'login')
26
+ end
27
+ ````
28
+
29
+ Calling the _text_field_ and _button_ methods adds several methods to our druid that allow us to interact with the items on the page. To login using this page we could simply write the following code:
30
+
31
+ ````ruby
32
+ login_page.username = 'cheezy'
33
+ login_page.password = 'secret'
34
+ login_page.login
35
+ ````
36
+
37
+ Another approach might be to create higher level methods on our druid that hide the implementation details even further. Our druid might look like this:
38
+
39
+ ````ruby
40
+ class LoginPage
41
+ include Druid
42
+
43
+ text_field(:username, :id => 'username')
44
+ text_field(:password, :id => 'password')
45
+ button(:login, :id => 'login')
46
+
47
+ def login_with(username, password)
48
+ self.username = username
49
+ self.password = password
50
+ login
51
+ end
52
+ end
53
+ ````
54
+ and your usage of the page would become:
55
+
56
+ ````ruby
57
+ login_page.login_with 'cheezy', 'secret'
58
+ ````
59
+
60
+ ### Creating your druid
61
+ druid supports [watir](https://github.com/watir/watir)
62
+ The page object can be create like this:
63
+
64
+ ````ruby
65
+ browser = Watir::Browser.new :firefox
66
+ my_druid = MyDruid.new(browser)
67
+ ````
68
+
69
+
70
+
71
+ ## Contribute
72
+
73
+ * Fork the project.
74
+ * Test drive your feature addition or bug fix. Adding specs is important and I will not accept a pull request that does not have tests
75
+ * Make sure you describe your new feature with a cucumber feature.
76
+ * Commit, do not mess with rakefile, version, or history.
77
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
78
+ * Send me a pull request. Bonus points for topic branches.