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
@@ -0,0 +1,281 @@
1
+ Feature: Elements
2
+
3
+ Background:
4
+ Given I am on the static elements page
5
+
6
+ Scenario: Elements enbaled?
7
+ When I click an enabled button
8
+ Then it should know it is enabled
9
+ And it should know that it is not disabled
10
+ When I check a disabled button
11
+ Then it should know it is not enabled
12
+ And it should know that it is disabled
13
+
14
+ Scenario: Setting focus and finding the element with focus
15
+ When I set the focus to the test text_field
16
+ Then I should know that the text_field has the focus
17
+
18
+ Scenario: Checking focus of the element with focus
19
+ And I set the focus to the test text_field
20
+ When I retrieve the focus state of the text_field
21
+ Then I should know that the text_field is focused
22
+
23
+ Scenario: Checking focus of the element without focus
24
+ And I set the focus off the test text_field
25
+ When I retrieve the focus state of the text_field
26
+ Then I should know that the text_field is not focused
27
+
28
+ Scenario: Link element methods
29
+ When I retrieve a link element
30
+ Then I should know it exists
31
+ And I should know it is visible
32
+ And I should know its' text is "Google Search"
33
+ And I should know the html is "<a href="success.html" id="link_id" name="link_name" class="link_class" title="link_title">Google Search</a>"
34
+ And I should know it is equal to itself
35
+ And I should know its' tag name is "a"
36
+ And I should know the attribute "readonly" is false
37
+ And I should know the attribute "href" includes "success.html"
38
+ And I should be able to click it
39
+
40
+ Scenario: Button element methods
41
+ When I retrieve a button element
42
+ Then I should know it exists
43
+ And I should know it is visible
44
+ And I should know its' value is "Click Me"
45
+ And I should know its' text is "Click Me"
46
+ And I should know it is equal to itself
47
+ And I should know its' tag name is "input"
48
+ And I should know the attribute "readonly" is false
49
+ And I should be able to click it
50
+
51
+ Scenario: Check Box element methods
52
+ When I retrieve a check box element
53
+ Then I should know it exists
54
+ And I should know it is visible
55
+ And I should know its' text is ""
56
+ And I should know its' value is "1"
57
+ And I should know it is equal to itself
58
+ And I should know its' tag name is "input"
59
+ And I should know the attribute "readonly" is false
60
+ And I should be able to click it
61
+
62
+ Scenario: Div element methods
63
+ When I retrieve the div element
64
+ Then I should know it exists
65
+ And I should know it is visible
66
+ And I should know its' text is "page-object rocks!"
67
+ And I should know it is equal to itself
68
+ And I should know its' tag name is "div"
69
+ And I should know the attribute "readonly" is false
70
+ And I should be able to click it
71
+
72
+ Scenario: Radio Button element methods
73
+ When I retrieve a radio button
74
+ Then I should know it exists
75
+ And I should know it is visible
76
+ And I should know its' text is ""
77
+ And I should know its' value is "Milk"
78
+ And I should know it is equal to itself
79
+ And I should know its' tag name is "input"
80
+ And I should know the attribute "readonly" is false
81
+ And I should be able to click it
82
+
83
+ Scenario: Select List element methods
84
+ When I retrieve a select list
85
+ Then I should know it exists
86
+ And I should know it is visible
87
+ And I should know its' text includes "Test 1"
88
+ And I should know its' value is "option1"
89
+ And I should know it is equal to itself
90
+ And I should know its' tag name is "select"
91
+ And I should know the attribute "readonly" is false
92
+ And I should be able to click it
93
+
94
+ Scenario: Table element methods
95
+ When I retrieve a table element
96
+ Then I should know it is visible
97
+ Then I should know it exists
98
+ And I should know its' text includes "Data1"
99
+ And I should know it is equal to itself
100
+ And I should know its' tag name is "table"
101
+ And I should know the attribute "readonly" is false
102
+ And I should be able to click it
103
+
104
+ Scenario: Table Cell element methods
105
+ When I retrieve table cell
106
+ Then I should know it exists
107
+ And I should know it is visible
108
+ And I should know its' text includes "Data4"
109
+ And I should know it is equal to itself
110
+ And I should know its' tag name is "td"
111
+ And I should know the attribute "readonly" is false
112
+ And I should be able to click it
113
+
114
+ Scenario: Text Field element methods
115
+ When I retrieve a text field
116
+ Then I should know it exists
117
+ And I should know it is visible
118
+ And I should know its' text includes ""
119
+ And I should know its' value is ""
120
+ And I should know it is equal to itself
121
+ And I should know its' tag name is "input"
122
+ And I should know the attribute "readonly" is false
123
+ And I should be able to click it
124
+
125
+ Scenario: Image element methods
126
+ When I get the image element
127
+ Then I should know it exists
128
+ And I should know it is visible
129
+ And I should know its' text includes ""
130
+ And I should know it is equal to itself
131
+ And I should know its' tag name is "img"
132
+ And I should know the attribute "readonly" is false
133
+ And I should be able to click it
134
+
135
+ Scenario: Hidden Field element methods
136
+ When I retrieve the hidden field element
137
+ Then I should know it exists
138
+ And I should know it is not visible
139
+ And I should know its' text includes ""
140
+ And I should know its' value is "12345"
141
+ And I should know it is equal to itself
142
+ And I should know its' tag name is "input"
143
+ And I should know the attribute "readonly" is false
144
+
145
+ Scenario: Form element methods
146
+ When I locate the form
147
+ Then I should know it exists
148
+ And I should know it is visible
149
+ And I should know its' text includes ""
150
+ And I should know it is equal to itself
151
+ And I should know its' tag name is "form"
152
+ And I should know the attribute "readonly" is false
153
+
154
+ Scenario: Text Area element methods
155
+ When I retrieve the text area
156
+ Then I should know it exists
157
+ And I should know it is visible
158
+ And I should know its' text includes ""
159
+ And I should know its' value is ""
160
+ And I should know it is equal to itself
161
+ And I should know its' tag name is "textarea"
162
+ And I should know the attribute "readonly" is false
163
+ And I should be able to click it
164
+
165
+ Scenario: List item element methods
166
+ When I retrieve a list item element
167
+ Then I should know it exists
168
+ And I should know it is visible
169
+ And I should know its' text is "Item One"
170
+ And I should know it is equal to itself
171
+ And I should know its' tag name is "li"
172
+ And I should know the attribute "readonly" is false
173
+ And I should be able to click it
174
+
175
+ Scenario: Unordered List element methods
176
+ When I retrieve a unordered list element
177
+ Then I should know it exists
178
+ And I should know it is visible
179
+ And I should know its' text includes "Item One"
180
+ And I should know its' text includes "Item Two"
181
+ And I should know its' text includes "Item Three"
182
+ And I should know it is equal to itself
183
+ And I should know its' tag name is "ul"
184
+ And I should know the attribute "readonly" is false
185
+ And I should be able to click it
186
+
187
+ Scenario: Ordered List element methods
188
+ When I retrieve a ordered list element
189
+ Then I should know it exists
190
+ And I should know it is visible
191
+ And I should know its' text includes "Number One"
192
+ And I should know its' text includes "Number Two"
193
+ And I should know its' text includes "Number Three"
194
+ And I should know it is equal to itself
195
+ And I should know its' tag name is "ol"
196
+ And I should know the attribute "readonly" is false
197
+ And I should be able to click it
198
+
199
+ Scenario: Clear an element
200
+ When I type "abcDEF" into the text field
201
+ Then the text field should contain "abcDEF"
202
+ When I clear the text field
203
+ Then the text field should contain ""
204
+
205
+ Scenario: Heading element methods
206
+ When I retrieve a heading element
207
+ Then I should know it exists
208
+ And I should know it is visible
209
+ And I should know its' text is "h1's are cool"
210
+ And I should know it is equal to itself
211
+ And I should know its' tag name is "h1"
212
+ And I should know the attribute "readonly" is false
213
+ And I should be able to click it
214
+
215
+ Scenario: Firing an event
216
+ When I set the focus to the test text_field using the onfocus event
217
+ Then I should see the onfocus text "changed by onfocus event"
218
+
219
+ Scenario: Setting focus on an element
220
+ When I set the focus on the test text_field
221
+ Then I should see the onfocus text "changed by onfocus event"
222
+
223
+ Scenario: Finding a parent element
224
+ When I find the child link element
225
+ And ask for the parent element
226
+ Then I should have a div parent
227
+
228
+ Scenario: Flashing an element
229
+ When I retrieve a button element
230
+ Then I should be able to flash it
231
+
232
+ Scenario: Hovering over an element
233
+ Given I am on the hover page
234
+ When I hover over the hello link
235
+ Then the font size should be "20px"
236
+
237
+ Scenario: Getting an element's id
238
+ When I retrieve a button element
239
+ Then I should know its id is "button_id"
240
+
241
+ Scenario: Expanding how we find elemnts to include non-stardard locators
242
+ When I retrieve a div using data-entity
243
+ Then I should know it exists
244
+ And I should know it is visible
245
+ And I should know the text is "found using data-entity"
246
+
247
+ Scenario: Accessing an HTML 5 element using the declaration
248
+ When I retrieve the figure uisng the declaration
249
+ Then I should see the figure contains an image
250
+
251
+ Scenario: Accessing an HTML 5 element using the element method
252
+ When I retrieve the figure using the element
253
+ Then I should see the figure contains an image
254
+
255
+ Scenario: Getting the class name for an element
256
+ When I search for the paragraph by "id"
257
+ Then I should know the paragraph class is "p_class"
258
+
259
+ Scenario: Selecting the text for an element
260
+ Then I should be able to select "Elements" from the paragraph
261
+
262
+ Scenario: Element location
263
+ When I retrieve a link element
264
+ Then I should be able to know its location
265
+
266
+ Scenario: Element size
267
+ When I retrieve a link element
268
+ Then I should be able to know its size
269
+
270
+ Scenario: Getting the height of an element
271
+ When I retrieve a link element
272
+ Then the element height is not 0
273
+
274
+ Scenario: Getting the width of an element
275
+ When I retrieve a link element
276
+ Then the element width is not 0
277
+
278
+ Scenario: Getting the centre of an element
279
+ When I retrieve a button element
280
+ Then the element centre should be greater than element y position
281
+ And the element centre should be greater than element x position
@@ -0,0 +1,38 @@
1
+ Feature: File Field
2
+
3
+ Background:
4
+ Given I am on the static elements page
5
+
6
+ Scenario: Setting the value on the file Field
7
+ When I set the file field to the step definition file
8
+ Then This filefield element should exist
9
+
10
+ Scenario Outline: Locating file fields on the Page
11
+ When I search for the file field by "<search_by>"
12
+ Then I should be able to set the file field
13
+
14
+ Examples:
15
+ | search_by |
16
+ | id |
17
+ | class |
18
+ | name |
19
+ | xpath |
20
+ | title |
21
+ | index |
22
+ | label |
23
+ | css |
24
+
25
+ Scenario Outline: Locating file fields using multiple parameters
26
+ When I search for the file field by "<param1>" and "<param2>"
27
+ Then I should be able to set the file field
28
+
29
+ Examples:
30
+ | param1 | param2 |
31
+ | class | index |
32
+ | name | index |
33
+
34
+ @locator
35
+ Scenario: Finding a file field dynamically
36
+ When I locate a file field while the script is executing
37
+ Then I should see that the file field element exists
38
+ And The file field should exist
@@ -0,0 +1,37 @@
1
+ Feature: Form
2
+
3
+ Background:
4
+ Given I am on the static elements page
5
+
6
+ Scenario: Submitting a form
7
+ When I locate the form by "id"
8
+ Then I should be able to submit the form
9
+
10
+ Scenario Outline: Locating a form on the page
11
+ When I locate the form by "<locate_by>"
12
+ Then I should be able to submit the form
13
+
14
+ Examples:
15
+ | locate_by |
16
+ | id |
17
+ | class |
18
+ | xpath |
19
+ | index |
20
+ | action |
21
+ | css |
22
+
23
+ @multi
24
+ Scenario Outline: Locating table using multiple parameters
25
+ When I locate the form using "<param1>" and "<param2>"
26
+ Then I should be able to submit the form
27
+
28
+ Examples:
29
+ | param1 | param2 |
30
+ | class | index |
31
+ | name | index |
32
+
33
+ @locator
34
+ Scenario: Finding a form dynamically
35
+ When I locate a form while the script is executing
36
+ Then I should see that the form exists
37
+ And I should be able to submit the form
@@ -0,0 +1,76 @@
1
+ Feature: Handling frames
2
+
3
+ Scenario: Accessing elements within the frame
4
+ Given I am on the frame elements page
5
+ When I type "page-object" into the text field for frame 2 using "id"
6
+ Then I should verify "page-object" is in the text field for frame 2 using "id"
7
+ When I type "page-object" into the text field for frame 2 using "name"
8
+ Then I should verify "page-object" is in the text field for frame 2 using "name"
9
+ When I type "page-object" into the text field for frame 2 using "index"
10
+ Then I should verify "page-object" is in the text field for frame 2 using "index"
11
+
12
+ Scenario: Switching between frames
13
+ Given I am on the frame elements page
14
+ When I type "page-object" into the text field for frame 2 using "id"
15
+ And I type "page-object" into the text field from frame 1 using "id"
16
+ Then I should verify "page-object" is in the text field for frame 2 using "id"
17
+ And I should verify "page-object" is in the text field for frame 1 using "id"
18
+
19
+ Scenario: Accessing elements within the iframe
20
+ Given I am on the iframe elements page
21
+ When I type "page-object" into the text field for frame 2 using "id"
22
+ Then I should verify "page-object" is in the text field for frame 2 using "id"
23
+ When I type "page-object" into the text field for frame 2 using "name"
24
+ Then I should verify "page-object" is in the text field for frame 2 using "name"
25
+ When I type "page-object" into the text field for frame 2 using "index"
26
+ Then I should verify "page-object" is in the text field for frame 2 using "index"
27
+
28
+ Scenario: Switching between iframes
29
+ Given I am on the iframe elements page
30
+ When I type "page-object" into the text field for frame 2 using "id"
31
+ And I type "page-object" into the text field from frame 1 using "id"
32
+ Then I should verify "page-object" is in the text field for frame 2 using "id"
33
+ And I should verify "page-object" is in the text field for frame 1 using "id"
34
+
35
+ Scenario: Nested frames
36
+ Given I am on the nested frame elements page
37
+ Then I should be able to click the link in the frame
38
+
39
+ Scenario: Identifying items in frames at runtime
40
+ Given I am on the frame elements page
41
+ When I type "page-object" into the text field from frame 1 identified dynamically
42
+ Then I should verify "page-object" in the text field for frame 1 identified dynamically
43
+
44
+ Scenario: Identifying items in iframes at runtime
45
+ Given I am on the iframe elements page
46
+ When I type "page-object" into the text field from iframe 1 identified dynamically
47
+ Then I should verify "page-object" in the text field for iframe 1 identified dynamically
48
+
49
+ Scenario: Handling alerts inside frames
50
+ Given I am on the frame elements page
51
+ When I trigger an alert within a frame
52
+ Then I should be able to get the alert's message
53
+
54
+ Scenario: Handling confirms inside frames
55
+ Given I am on the frame elements page
56
+ When I trigger an confirm within a frame
57
+ Then I should be able to get the confirm's message
58
+
59
+ Scenario: Handling prompts inside frames
60
+ Given I am on the frame elements page
61
+ When I trigger an prompt within a frame
62
+ Then I should be able to get the message and default value
63
+
64
+ Scenario: Accessing elements within the frame using Regexp
65
+ Given I am on the frame elements page
66
+ When I type "page-object" into the text field for frame 2 using "regex"
67
+ Then I should verify "page-object" is in the text field for frame 2 using "regex"
68
+
69
+ Scenario: Accessing elements within the frame using multiple identifiers
70
+ Given I am on the iframe elements page
71
+ When I type "page-object" into the text field for frame 2 using "multiple identifiers"
72
+ Then I should verify "page-object" is in the text field for frame 2 using "multiple identifiers"
73
+
74
+ Scenario: Frames in sections
75
+ Given I am on the frame section page
76
+ Then I should be able to access an element in the frame in the section repeatedly
@@ -0,0 +1,29 @@
1
+ Feature: Generic Elements
2
+
3
+ Background:
4
+ Given I am on the static elements page
5
+
6
+ Scenario: Getting the text from the article element
7
+ When I get the text from the article
8
+ Then the text should be "HTML 5 Article"
9
+
10
+ Scenario: Getting the text from the header element
11
+ When I get the text from the header
12
+ Then the text should be "HTML 5 Header"
13
+
14
+ Scenario: Getting the text from the footer element
15
+ When I get the text from the footer
16
+ Then the text should be "HTML 5 Footer"
17
+
18
+ Scenario: Getting the text from the summary element
19
+ When I get the text from the summary
20
+ Then the text should be "The summary"
21
+
22
+ Scenario: Getting the text from the details element
23
+ When I get the text from the details
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"
@@ -0,0 +1,160 @@
1
+ Feature: Headings
2
+
3
+ Background:
4
+ Given I am on the static elements page
5
+
6
+ Scenario: Getting the text of headings
7
+ When I get the text for the "h1" element
8
+ Then I should see "h1's are cool"
9
+ When I get the text for the "h2" element
10
+ Then I should see "h2's are cool"
11
+ When I get the text for the "h3" element
12
+ Then I should see "h3's are cool"
13
+ When I get the text for the "h4" element
14
+ Then I should see "h4's are cool"
15
+ When I get the text for the "h5" element
16
+ Then I should see "h5's are cool"
17
+ When I get the text for the "h6" element
18
+ Then I should see "h6's are cool"
19
+
20
+
21
+ Scenario Outline: Locating h1s on the Page
22
+ When I search for the heading1 by "<search_by>"
23
+ Then I should see "h1's are cool"
24
+
25
+ Examples:
26
+ | search_by |
27
+ | id |
28
+ | class |
29
+ | xpath |
30
+ | index |
31
+ | css |
32
+
33
+ @multi
34
+ Scenario Outline: Locating h1 using multiple parameters
35
+ When I locate the h1 using "<param1>" and "<param2>"
36
+ Then the text should be "h1's are cool"
37
+
38
+ Examples:
39
+ | param1 | param2 |
40
+ | class | index |
41
+
42
+ @locator
43
+ Scenario: Finding a h1 dynamically
44
+ When I locate a h1 while the script is executing
45
+ Then the text should be "h1's are cool"
46
+
47
+ Scenario Outline: Locating h2s on the Page
48
+ When I search for the heading2 by "<search_by>"
49
+ Then I should see "h2's are cool"
50
+
51
+ Examples:
52
+ | search_by |
53
+ | id |
54
+ | class |
55
+ | xpath |
56
+ | index |
57
+ | css |
58
+
59
+ @multi
60
+ Scenario Outline: Locating h2 using multiple parameters
61
+ When I locate the h2 using "<param1>" and "<param2>"
62
+ Then the text should be "h2's are cool"
63
+
64
+ Examples:
65
+ | param1 | param2 |
66
+ | class | index |
67
+
68
+ @locator
69
+ Scenario: Finding a h2 dynamically
70
+ When I locate a h2 while the script is executing
71
+ Then the text should be "h2's are cool"
72
+
73
+ Scenario Outline: Locating h3s on the Page
74
+ When I search for the heading3 by "<search_by>"
75
+ Then I should see "h3's are cool"
76
+
77
+ Examples:
78
+ | search_by |
79
+ | id |
80
+ | class |
81
+ | xpath |
82
+ | index |
83
+ | css |
84
+
85
+ @multi
86
+ Scenario Outline: Locating h3 using multiple parameters
87
+ When I locate the h3 using "<param1>" and "<param2>"
88
+ Then the text should be "h3's are cool"
89
+
90
+ Examples:
91
+ | param1 | param2 |
92
+ | class | index |
93
+
94
+ @locator
95
+ Scenario: Finding a h3 dynamically
96
+ When I locate a h3 while the script is executing
97
+ Then the text should be "h3's are cool"
98
+
99
+
100
+ Scenario Outline: Locating h4s on the Page
101
+ When I search for the heading4 by "<search_by>"
102
+ Then I should see "h4's are cool"
103
+
104
+ Examples:
105
+ | search_by |
106
+ | id |
107
+ | class |
108
+ | xpath |
109
+ | index |
110
+ | css |
111
+
112
+ @multi
113
+ Scenario Outline: Locating h4 using multiple parameters
114
+ When I locate the h4 using "<param1>" and "<param2>"
115
+ Then the text should be "h4's are cool"
116
+
117
+ Examples:
118
+ | param1 | param2 |
119
+ | class | index |
120
+
121
+
122
+ @locator
123
+ Scenario: Finding a h4 dynamically
124
+ When I locate a h4 while the script is executing
125
+ Then the text should be "h4's are cool"
126
+
127
+ Scenario Outline: Locating h5s on the Page
128
+ When I search for the heading5 by "<search_by>"
129
+ Then I should see "h5's are cool"
130
+
131
+ Examples:
132
+ | search_by |
133
+ | id |
134
+ | class |
135
+ | xpath |
136
+ | index |
137
+ | css |
138
+
139
+ @locator
140
+ Scenario: Finding a h5 dynamically
141
+ When I locate a h5 while the script is executing
142
+ Then the text should be "h5's are cool"
143
+
144
+
145
+ Scenario Outline: Locating h6s on the Page
146
+ When I search for the heading6 by "<search_by>"
147
+ Then I should see "h6's are cool"
148
+
149
+ Examples:
150
+ | search_by |
151
+ | id |
152
+ | class |
153
+ | xpath |
154
+ | index |
155
+ | css |
156
+
157
+ @locator
158
+ Scenario: Finding a h6 dynamically
159
+ When I locate a h6 while the script is executing
160
+ Then the text should be "h6's are cool"
@@ -0,0 +1,39 @@
1
+ Feature: Hidden Fields
2
+
3
+ Background:
4
+ Given I am on the static elements page
5
+
6
+ Scenario: Getting a value from a hidden field
7
+ When I retrieve the hidden field element
8
+ Then I should see the hidden field contains "12345"
9
+
10
+ Scenario Outline: Locating hidden fields on the Page
11
+ When I locate the hidden field by "<locate_by>"
12
+ Then hidden field element should contains "12345"
13
+
14
+ Examples:
15
+ | locate_by |
16
+ | id |
17
+ | class |
18
+ | name |
19
+ | xpath |
20
+ | index |
21
+ | text |
22
+ | value |
23
+ | css |
24
+
25
+ @multi
26
+ Scenario Outline: Locating a hidden field using multiple parameters
27
+ When I search for the hidden field by "<param1>" and "<param2>"
28
+ Then hidden field element should contains "12345"
29
+
30
+ Examples:
31
+ | param1 | param2 |
32
+ | class | index |
33
+ | name | index |
34
+
35
+ @locator
36
+ Scenario: Finding a hidden field dynamically
37
+ When I find a hidden field while the script is executing
38
+ Then I should see that the hidden field exists
39
+ And hidden field element should contains "12345"
@@ -0,0 +1,31 @@
1
+ <html>
2
+ <head>
3
+ <title>Async Page</title>
4
+ <script type="text/javascript">
5
+ function unhide() {
6
+ document.getElementById("target").style.display="block";
7
+ }
8
+ function hide() {
9
+ document.getElementById("target").style.display="none";
10
+ }
11
+ function addDiv() {
12
+ var button = document.createElement("input");
13
+ button.setAttribute("type", "button");
14
+ button.setAttribute("value", "New Button");
15
+ button.setAttribute("id", "new_button");
16
+ document.body.appendChild(button);
17
+ }
18
+ function removeDiv() {
19
+ var button = document.getElementById("new_button");
20
+ document.body.removeChild(button);
21
+ }
22
+ </script>
23
+ </head>
24
+ <body>
25
+ <input type="button" id="target" value="Target"/>
26
+ <input type="button" onclick="setTimeout(function() {hide();}, 2000);" value="Hide Button"/>
27
+ <input type="button" onclick="setTimeout(function() {unhide();}, 2000);" value="Unhide Button"/>
28
+ <input type="button" onclick="setTimeout(function() {addDiv();}, 2000);" value="Create Button"/>
29
+ <input type="button" onclick="setTimeout(function() {removeDiv();}, 2000);" value="Remove Button"/>
30
+ </body>
31
+ </html>