testcentricity_web 4.1.9 → 4.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +96 -1
  3. data/README.md +88 -48
  4. data/lib/testcentricity_web/browser_helper.rb +2 -1
  5. data/lib/testcentricity_web/data_objects/environment.rb +0 -1
  6. data/lib/testcentricity_web/version.rb +1 -1
  7. data/lib/testcentricity_web/web_core/page_objects_helper.rb +40 -3
  8. data/lib/testcentricity_web/web_core/webdriver_helper.rb +89 -80
  9. data/lib/testcentricity_web/web_elements/media.rb +108 -0
  10. data/lib/testcentricity_web/web_elements/textfield.rb +28 -0
  11. data/lib/testcentricity_web/web_elements/ui_elements_helper.rb +39 -1
  12. metadata +37 -181
  13. data/.gitignore +0 -39
  14. data/.idea/.name +0 -1
  15. data/.idea/encodings.xml +0 -6
  16. data/.idea/misc.xml +0 -4
  17. data/.idea/modules.xml +0 -8
  18. data/.idea/vcs.xml +0 -7
  19. data/.rspec +0 -4
  20. data/.rubocop.yml +0 -38
  21. data/.ruby-version +0 -1
  22. data/.simplecov +0 -9
  23. data/CODE_OF_CONDUCT.md +0 -13
  24. data/Gemfile +0 -6
  25. data/Rakefile +0 -115
  26. data/config/cucumber.yml +0 -171
  27. data/config/locales/en-US.yml +0 -56
  28. data/config/test_data/LOCAL_data.json +0 -15
  29. data/config/test_data/LOCAL_data.xls +0 -0
  30. data/config/test_data/LOCAL_data.yml +0 -11
  31. data/config/test_data/data.json +0 -25
  32. data/config/test_data/data.xls +0 -0
  33. data/config/test_data/data.yml +0 -20
  34. data/docker-compose.yml +0 -48
  35. data/features/basic_form_page_css.feature +0 -54
  36. data/features/basic_form_page_xpath.feature +0 -26
  37. data/features/custom_controls.feature +0 -29
  38. data/features/media_players.feature +0 -67
  39. data/features/step_definitions/generic_steps.rb.rb +0 -124
  40. data/features/step_definitions/media_steps.rb +0 -30
  41. data/features/support/data/form_data.rb +0 -43
  42. data/features/support/env.rb +0 -51
  43. data/features/support/hooks.rb +0 -270
  44. data/features/support/pages/base_test_page.rb +0 -22
  45. data/features/support/pages/basic_css_form_page.rb +0 -53
  46. data/features/support/pages/basic_form_page.rb +0 -429
  47. data/features/support/pages/basic_xpath_form_page.rb +0 -54
  48. data/features/support/pages/custom_controls_page.rb +0 -263
  49. data/features/support/pages/indexed_sections_page.rb +0 -57
  50. data/features/support/pages/media_test_page.rb +0 -207
  51. data/features/support/sections/header_nav.rb +0 -48
  52. data/features/support/sections/product_card.rb +0 -39
  53. data/features/support/world_data.rb +0 -12
  54. data/features/support/world_pages.rb +0 -18
  55. data/reports/.keep +0 -1
  56. data/spec/fixtures/page_object.rb +0 -22
  57. data/spec/fixtures/section_object.rb +0 -21
  58. data/spec/spec_helper.rb +0 -31
  59. data/spec/testcentricity_web/browser_spec.rb +0 -41
  60. data/spec/testcentricity_web/elements/audio_spec.rb +0 -68
  61. data/spec/testcentricity_web/elements/button_spec.rb +0 -18
  62. data/spec/testcentricity_web/elements/checkbox_spec.rb +0 -33
  63. data/spec/testcentricity_web/elements/file_field_spec.rb +0 -13
  64. data/spec/testcentricity_web/elements/image_spec.rb +0 -33
  65. data/spec/testcentricity_web/elements/label_spec.rb +0 -18
  66. data/spec/testcentricity_web/elements/link_spec.rb +0 -23
  67. data/spec/testcentricity_web/elements/list_spec.rb +0 -13
  68. data/spec/testcentricity_web/elements/radio_spec.rb +0 -28
  69. data/spec/testcentricity_web/elements/ui_element_spec.rb +0 -125
  70. data/spec/testcentricity_web/elements/video_spec.rb +0 -68
  71. data/spec/testcentricity_web/helper_specs/object_helpers_spec.rb +0 -39
  72. data/spec/testcentricity_web/helper_specs/string_helpers_spec.rb +0 -49
  73. data/spec/testcentricity_web/page_object_spec.rb +0 -90
  74. data/spec/testcentricity_web/section_object_spec.rb +0 -72
  75. data/spec/testcentricity_web/version_spec.rb +0 -7
  76. data/spec/testcentricity_web/webdriver_connect/grid_webdriver_spec.rb +0 -72
  77. data/spec/testcentricity_web/webdriver_connect/local_webdriver_spec.rb +0 -86
  78. data/spec/testcentricity_web/webdriver_connect/mobile_webdriver_spec.rb +0 -65
  79. data/test_site/basic_test_page.html +0 -290
  80. data/test_site/chosen-sprite.png +0 -0
  81. data/test_site/chosen-sprite@2x.png +0 -0
  82. data/test_site/chosen.css +0 -496
  83. data/test_site/chosen.jquery.js +0 -1359
  84. data/test_site/chosen.jquery.min.js +0 -3
  85. data/test_site/chosen.min.css +0 -11
  86. data/test_site/chosen.proto.js +0 -1399
  87. data/test_site/chosen.proto.min.js +0 -3
  88. data/test_site/composer.json +0 -36
  89. data/test_site/custom_controls_page.html +0 -629
  90. data/test_site/docsupport/chosen.png +0 -0
  91. data/test_site/docsupport/init.js +0 -11
  92. data/test_site/docsupport/init.proto.js +0 -16
  93. data/test_site/docsupport/jquery-1.12.4.min.js +0 -5
  94. data/test_site/docsupport/jquery-3.2.1.min.js +0 -4
  95. data/test_site/docsupport/oss-credit.png +0 -0
  96. data/test_site/docsupport/prism.css +0 -108
  97. data/test_site/docsupport/prism.js +0 -9
  98. data/test_site/docsupport/prototype-1.7.0.0.js +0 -6082
  99. data/test_site/docsupport/style.css +0 -219
  100. data/test_site/images/Blouse_Black.jpg +0 -0
  101. data/test_site/images/Granny.jpg +0 -0
  102. data/test_site/images/Printed_Dress.jpg +0 -0
  103. data/test_site/images/T-shirt.jpg +0 -0
  104. data/test_site/images/Wilder.jpg +0 -0
  105. data/test_site/images/You_Betcha.jpg +0 -0
  106. data/test_site/images/jeans3.jpg +0 -0
  107. data/test_site/indexed_sections_page.html +0 -215
  108. data/test_site/media/MIB2-subtitles-pt-BR.vtt +0 -49
  109. data/test_site/media/MIB2.mp4 +0 -0
  110. data/test_site/media/MP4_small.mp4 +0 -0
  111. data/test_site/media/MPS_sample.mp3 +0 -0
  112. data/test_site/media/bbc_scotland_report.mp3 +0 -0
  113. data/test_site/media/count_and_bars.mp4 +0 -0
  114. data/test_site/media_page.html +0 -86
  115. data/testcentricity_web.gemspec +0 -57
@@ -1,429 +0,0 @@
1
- # Page Object class definition for Basic HTML Form page
2
-
3
- class BasicFormPage < BaseTestPage
4
- trait(:page_url) { '/basic_test_page.html' }
5
- trait(:navigator) { header_nav.open_form_page }
6
- trait(:page_title) { 'Basic HTML Form'}
7
- trait(:tab_order) {
8
- [
9
- header_nav.form_link,
10
- header_nav.media_link,
11
- header_nav.indexed_sections_link,
12
- header_nav.custom_controls_link,
13
- username_field,
14
- password_field,
15
- max_length_field,
16
- read_only_field,
17
- number_field,
18
- color_picker,
19
- slider,
20
- comments_field,
21
- upload_file,
22
- check_1,
23
- check_2,
24
- check_3,
25
- radio_1,
26
- [
27
- radio_2,
28
- radio_3
29
- ],
30
- multi_select,
31
- drop_down_select,
32
- link_1,
33
- link_2,
34
- cancel_button,
35
- submit_button
36
- ]
37
- }
38
- trait(:firefox_order) {
39
- [
40
- username_field,
41
- password_field,
42
- max_length_field,
43
- read_only_field,
44
- number_field,
45
- color_picker,
46
- slider,
47
- comments_field,
48
- upload_file,
49
- check_1,
50
- check_2,
51
- check_3,
52
- radio_1,
53
- [
54
- radio_2,
55
- radio_3
56
- ],
57
- multi_select,
58
- drop_down_select,
59
- cancel_button,
60
- submit_button
61
- ]
62
- }
63
- trait(:safari_tab_order) {
64
- [
65
- username_field,
66
- password_field,
67
- max_length_field,
68
- read_only_field,
69
- number_field,
70
- comments_field,
71
- multi_select,
72
- drop_down_select
73
- ]
74
- }
75
-
76
- def verify_page_ui
77
- super
78
-
79
- verify_page_contains(page_title)
80
- image_1.wait_until_loaded(5)
81
- username_field.scroll_to(:center) if username_field.obscured?
82
- ui = {
83
- username_label => { visible: true, caption: 'Username:' },
84
- username_field => {
85
- name: 'username',
86
- exists: true,
87
- displayed: true,
88
- obscured: false,
89
- visible: true,
90
- hidden: false,
91
- enabled: true,
92
- disabled: false,
93
- required: true,
94
- value: '',
95
- placeholder: 'User name'
96
- },
97
- password_label => { visible: true, caption: 'Password:' },
98
- password_field => {
99
- name: 'password',
100
- visible: true,
101
- displayed: true,
102
- obscured: false,
103
- focused: false,
104
- enabled: true,
105
- required: true,
106
- value: '',
107
- placeholder: 'Password'
108
- },
109
- max_length_label => { visible: true, caption: 'Max Length:' },
110
- max_length_field => {
111
- visible: true,
112
- obscured: false,
113
- enabled: true,
114
- focused: false,
115
- placeholder: 'up to 64 characters',
116
- value: '',
117
- maxlength: 64
118
- },
119
- read_only_label => { visible: true, caption: 'Read Only:' },
120
- read_only_field => {
121
- visible: true,
122
- enabled: true,
123
- readonly: true,
124
- value: 'I am a read only text field'
125
- },
126
- number_label => { visible: true, caption: 'Number:' },
127
- number_field => {
128
- visible: true,
129
- enabled: true,
130
- value: '41',
131
- min: 10,
132
- max: 1024,
133
- step: 1
134
- },
135
- color_label => { visible: true, caption: 'Color:' },
136
- color_picker => { visible: true, enabled: true, value: '#000000' },
137
- slider_label => { visible: true, caption: 'Range:' },
138
- slider => {
139
- visible: true,
140
- enabled: true,
141
- value: 25,
142
- min: 0,
143
- max: 50,
144
- },
145
- comments_label => { visible: true, caption: 'TextArea:' },
146
- comments_field => { visible: true, enabled: true, value: '' },
147
- filename_label => { visible: true, caption: 'Filename:' },
148
- upload_file => { visible: true, enabled: true, value: '' },
149
- checkboxes_label => { visible: true, caption: 'Checkbox Items:' },
150
- check_1 => {
151
- exists: true,
152
- visible: true,
153
- hidden: false,
154
- enabled: true,
155
- disabled: false,
156
- checked: false,
157
- indeterminate: false
158
- },
159
- check_2 => {
160
- exists: true,
161
- visible: true,
162
- hidden: false,
163
- enabled: true,
164
- disabled: false,
165
- checked: false,
166
- indeterminate: false
167
- },
168
- check_3 => {
169
- exists: true,
170
- visible: true,
171
- hidden: false,
172
- enabled: true,
173
- disabled: false,
174
- checked: false,
175
- indeterminate: false
176
- },
177
- check_4 => {
178
- exists: true,
179
- visible: true,
180
- hidden: false,
181
- enabled: false,
182
- disabled: true,
183
- checked: false,
184
- indeterminate: false
185
- },
186
- radios_label => { visible: true, caption: 'Radio Items:' },
187
- radio_1 => {
188
- exists: true,
189
- visible: true,
190
- hidden: false,
191
- enabled: true,
192
- disabled: false,
193
- selected: false
194
- },
195
- radio_2 => {
196
- exists: true,
197
- visible: true,
198
- hidden: false,
199
- enabled: true,
200
- disabled: false,
201
- selected: false
202
- },
203
- radio_3 => {
204
- exists: true,
205
- visible: true,
206
- hidden: false,
207
- enabled: true,
208
- disabled: false,
209
- selected: false
210
- },
211
- radio_4 => {
212
- exists: true,
213
- visible: true,
214
- hidden: false,
215
- enabled: false,
216
- disabled: true,
217
- selected: false
218
- },
219
- multiselect_label => { visible: true, caption: 'Multiple Select Values:' },
220
- multi_select => {
221
- visible: true,
222
- enabled: true,
223
- optioncount: 4,
224
- options: ['Selection Item 1', 'Selection Item 2', 'Selection Item 3', 'Selection Item 4'],
225
- selected: ''
226
- },
227
- dropdown_label => { visible: true, caption: 'Dropdown:' },
228
- drop_down_select => {
229
- visible: true,
230
- enabled: true,
231
- optioncount: 6,
232
- options: ['Drop Down Item 1', 'Drop Down Item 2', 'Drop Down Item 3', 'Drop Down Item 4', 'Drop Down Item 5', 'Drop Down Item 6'],
233
- selected: 'Drop Down Item 1'
234
- },
235
- link_label => { visible: true, caption: 'Links:' },
236
- links_list => {
237
- visible: true,
238
- enabled: true,
239
- itemcount: 3,
240
- items: ['Open Media Page in same window/tab', 'Open Media Page in a new window/tab', 'Disabled Link']
241
- },
242
- link_1 => {
243
- visible: true,
244
- href: { ends_with: 'media_page.html' },
245
- caption: 'Open Media Page in same window/tab'
246
- },
247
- link_2 => {
248
- visible: true,
249
- href: { ends_with: 'media_page.html' },
250
- caption: 'Open Media Page in a new window/tab'
251
- },
252
- link_3 => {
253
- visible: true,
254
- aria_disabled: true,
255
- role: 'link',
256
- caption: 'Disabled Link'
257
- },
258
- table_label => { visible: true, caption: 'Table:' },
259
- static_table => {
260
- visible: true,
261
- columncount: 3,
262
- rowcount: 4,
263
- column_headers: %w[Company Contact Country],
264
- { row: 1 } => [['Alfreds Futterkiste', 'Maria Anders', 'Germany']],
265
- { row: 2 } => [['Centro comercial Moctezuma', 'Francisco Chang', 'Mexico']],
266
- { row: 3 } => [['Ernst Handel', 'Roland Mendel', 'Austria']],
267
- { row: 4 } => [['Island Trading', 'Helen Bennett', 'UK']],
268
- { cell: [1, 3] } => ['Germany'],
269
- { cell: [2, 3] } => ['Mexico'],
270
- { column: 3 } => [['Germany', 'Mexico', 'Austria', 'UK']]
271
- },
272
- images_label => { visible: true, caption: 'Images:' },
273
- image_1 => {
274
- visible: true,
275
- loaded: true,
276
- broken: false,
277
- src: { ends_with: 'images/Wilder.jpg' },
278
- alt: "It's alive"
279
- },
280
- image_2 => {
281
- visible: true,
282
- loaded: true,
283
- broken: false,
284
- src: { ends_with: 'images/You_Betcha.jpg' },
285
- alt: 'You Betcha'
286
- },
287
- image_3 => {
288
- visible: true,
289
- broken: true,
290
- src: { ends_with: 'wrongname.gif' },
291
- alt: 'A broken image'
292
- },
293
- cancel_button => { visible: true, enabled: true, caption: 'Cancel' },
294
- submit_button => { visible: true, enabled: true, caption: 'Submit' }
295
- }
296
- verify_ui_states(ui)
297
- end
298
-
299
- def form_data
300
- data = form_data_source.read_form_data
301
-
302
- if Environ.platform == :mobile
303
- file_path = nil
304
- file_name = ''
305
- color_value = '#000000'
306
- else
307
- file_path = "#{Dir.pwd}/test_site/images/#{data.image_filename}"
308
- file_name = data.image_filename
309
- color_value = Faker::Color.hex_color
310
- end
311
- {
312
- username: data.username,
313
- password: data.password,
314
- maxlength: Faker::Marketing.buzzwords,
315
- number: Faker::Number.between(from: 10, to: 1024),
316
- color: color_value,
317
- slider: 50,
318
- comments: Faker::Hipster.paragraph,
319
- filepath: file_path,
320
- filename: file_name,
321
- check1: data.check1,
322
- check2: data.check2,
323
- check3: data.check3,
324
- radio_select: data.radio_select,
325
- multi_select: data.multi_select,
326
- drop_select: data.drop_down_item
327
- }
328
- end
329
-
330
- def populate_form
331
- # toggle checks and radios and verify
332
- check_2.check
333
- check_2.verify_check_state(true)
334
- check_2.uncheck
335
- check_2.verify_check_state(false)
336
- radio_2.select
337
- radio_2.unselect
338
- # populate fields and controls with externally sourced data
339
- @data = form_data
340
- fields = {
341
- username_field => @data[:username],
342
- password_field => @data[:password],
343
- max_length_field => @data[:maxlength],
344
- number_field => @data[:number],
345
- color_picker => @data[:color],
346
- slider => @data[:slider],
347
- comments_field => @data[:comments],
348
- upload_file => @data[:filepath],
349
- check_1 => @data[:check1],
350
- check_2 => @data[:check2],
351
- check_3 => @data[:check3],
352
- radio_1 => @data[:radio_select] == 1,
353
- radio_2 => @data[:radio_select] == 2,
354
- radio_3 => @data[:radio_select] == 3,
355
- multi_select => @data[:multi_select],
356
- drop_down_select => @data[:drop_select]
357
- }
358
- populate_data_fields(fields)
359
- end
360
-
361
- def verify_form_data
362
- ui = {
363
- username_field => { value: @data[:username] },
364
- password_field => { value: @data[:password] },
365
- max_length_field => { value: @data[:maxlength] },
366
- number_field => { value: @data[:number].to_s },
367
- color_picker => { value: @data[:color] },
368
- slider => { value: @data[:slider] },
369
- comments_field => { value: @data[:comments] },
370
- upload_file => { value: { ends_with: @data[:filename] } },
371
- check_1 => { checked: @data[:check1] },
372
- check_2 => { checked: @data[:check2] },
373
- check_3 => { checked: @data[:check3] },
374
- radio_1 => { selected: @data[:radio_select] == 1 },
375
- radio_2 => { selected: @data[:radio_select] == 2 },
376
- radio_3 => { selected: @data[:radio_select] == 3 },
377
- multi_select => { selected: @data[:multi_select] },
378
- drop_down_select => { selected: @data[:drop_select] }
379
- }
380
- verify_ui_states(ui)
381
- end
382
-
383
- def perform_action(action)
384
- case action
385
- when :submit
386
- submit_button.click
387
- when :cancel
388
- cancel_button.click
389
- else
390
- raise "#{action} is not a valid selector"
391
- end
392
- end
393
-
394
- def verify_tab_order
395
- order = case Environ.browser
396
- when :safari
397
- safari_tab_order
398
- when :firefox
399
- firefox_order
400
- else
401
- tab_order
402
- end
403
- verify_focus_order(order)
404
- end
405
-
406
- def choose_options_by(method)
407
- case method.downcase.to_sym
408
- when :index
409
- multi_select.choose_option(index: 2)
410
- drop_down_select.choose_option(index: 3)
411
- when :value
412
- multi_select.choose_option(value: 'ms2')
413
- drop_down_select.choose_option(value: 'dd3')
414
- when :text
415
- multi_select.choose_option(text: 'Selection Item 2')
416
- drop_down_select.choose_option(text: 'Drop Down Item 3')
417
- else
418
- raise "#{method} is not a valid selector"
419
- end
420
- end
421
-
422
- def verify_chosen_options
423
- ui = {
424
- multi_select => { selected: 'Selection Item 2' },
425
- drop_down_select => { selected: 'Drop Down Item 3' }
426
- }
427
- verify_ui_states(ui)
428
- end
429
- end
@@ -1,54 +0,0 @@
1
- # Page Object class definition for Basic HTML Form page with Xpath locators
2
-
3
- class BasicXpathFormPage < BasicFormPage
4
- trait(:page_name) { 'Basic Xpath Form' }
5
- trait(:page_locator) { "//form[@id='HTMLFormElements']" }
6
-
7
- # Basic HTML Test page UI elements
8
- textfields username_field: "//input[@id='username']",
9
- password_field: "//input[@id='password']",
10
- max_length_field: "//input[@id='maxlength']",
11
- read_only_field: "//input[@id='readonly']",
12
- number_field: "//input[@id='number-field']",
13
- comments_field: "//textarea[@id='comments']",
14
- color_picker: "//input[@id='color-picker']"
15
- ranges slider: "//input[@id='slider']"
16
- filefields upload_file: "//input[@id='filename']"
17
- checkboxes check_1: "//input[@id='check1']",
18
- check_2: "//input[@id='check2']",
19
- check_3: "//input[@id='check3']",
20
- check_4: "//input[@id='check4']"
21
- radios radio_1: "//input[@id='radio1']",
22
- radio_2: "//input[@id='radio2']",
23
- radio_3: "//input[@id='radio3']",
24
- radio_4: "//input[@id='radio4']"
25
- selectlists multi_select: "//select[@id='multipleselect']",
26
- drop_down_select: "//select[@id='dropdown']"
27
- lists links_list: "//ul[@id='links_list']"
28
- links link_1: "//a[@id='link1']",
29
- link_2: "//a[@id='link2']",
30
- link_3: "//a[@id='link3']"
31
- tables static_table: "//table[@id='table']"
32
- images image_1: "//img[@id='image1']",
33
- image_2: "//img[@id='image2']",
34
- image_3: "//img[@id='image3']"
35
- buttons cancel_button: "//input[@id='cancel']",
36
- submit_button: "//input[@id='submit']"
37
- labels header_label: '//h2',
38
- username_label: "//label[@for='username']",
39
- password_label: "//label[@for='password']",
40
- max_length_label: "//label[@for='maxlength']",
41
- read_only_label: "//label[@for='readonly']",
42
- number_label: "//label[@for='number-field']",
43
- color_label: "//label[@for='color-picker']",
44
- slider_label: "//label[@for='slider']",
45
- comments_label: "//label[@for='comments']",
46
- filename_label: "//label[@for='filename']",
47
- checkboxes_label: "//label[@id='checkboxes']",
48
- radios_label: "//label[@id='radios']",
49
- multiselect_label: "//label[@for='multipleselect']",
50
- dropdown_label: "//label[@for='dropdown']",
51
- link_label: "//label[@id='links']",
52
- table_label: "//label[@for='table']",
53
- images_label: "//label[@id='images']"
54
- end