testcentricity_web 4.1.10 → 4.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +75 -1
  3. data/README.md +73 -35
  4. data/lib/testcentricity_web/data_objects/environment.rb +0 -1
  5. data/lib/testcentricity_web/version.rb +1 -1
  6. data/lib/testcentricity_web/web_core/page_objects_helper.rb +39 -2
  7. data/lib/testcentricity_web/web_core/webdriver_helper.rb +67 -61
  8. data/lib/testcentricity_web/web_elements/media.rb +108 -0
  9. data/lib/testcentricity_web/web_elements/textfield.rb +28 -0
  10. data/lib/testcentricity_web/web_elements/ui_elements_helper.rb +39 -1
  11. metadata +6 -150
  12. data/.gitignore +0 -39
  13. data/.idea/.name +0 -1
  14. data/.idea/encodings.xml +0 -6
  15. data/.idea/misc.xml +0 -4
  16. data/.idea/modules.xml +0 -8
  17. data/.idea/vcs.xml +0 -7
  18. data/.rspec +0 -4
  19. data/.rubocop.yml +0 -38
  20. data/.ruby-version +0 -1
  21. data/.simplecov +0 -9
  22. data/CODE_OF_CONDUCT.md +0 -13
  23. data/Gemfile +0 -6
  24. data/Rakefile +0 -115
  25. data/config/cucumber.yml +0 -171
  26. data/config/locales/en-US.yml +0 -56
  27. data/config/test_data/LOCAL_data.json +0 -15
  28. data/config/test_data/LOCAL_data.xls +0 -0
  29. data/config/test_data/LOCAL_data.yml +0 -11
  30. data/config/test_data/data.json +0 -25
  31. data/config/test_data/data.xls +0 -0
  32. data/config/test_data/data.yml +0 -20
  33. data/docker-compose.yml +0 -48
  34. data/features/basic_form_page_css.feature +0 -54
  35. data/features/basic_form_page_xpath.feature +0 -26
  36. data/features/custom_controls.feature +0 -29
  37. data/features/media_players.feature +0 -67
  38. data/features/step_definitions/generic_steps.rb.rb +0 -124
  39. data/features/step_definitions/media_steps.rb +0 -30
  40. data/features/support/data/form_data.rb +0 -43
  41. data/features/support/env.rb +0 -53
  42. data/features/support/hooks.rb +0 -270
  43. data/features/support/pages/base_test_page.rb +0 -22
  44. data/features/support/pages/basic_css_form_page.rb +0 -57
  45. data/features/support/pages/basic_form_page.rb +0 -500
  46. data/features/support/pages/basic_xpath_form_page.rb +0 -58
  47. data/features/support/pages/custom_controls_page.rb +0 -263
  48. data/features/support/pages/indexed_sections_page.rb +0 -57
  49. data/features/support/pages/media_test_page.rb +0 -207
  50. data/features/support/sections/header_nav.rb +0 -48
  51. data/features/support/sections/product_card.rb +0 -39
  52. data/features/support/world_data.rb +0 -12
  53. data/features/support/world_pages.rb +0 -18
  54. data/reports/.keep +0 -1
  55. data/spec/fixtures/page_object.rb +0 -22
  56. data/spec/fixtures/section_object.rb +0 -21
  57. data/spec/spec_helper.rb +0 -33
  58. data/spec/testcentricity_web/browser_spec.rb +0 -41
  59. data/spec/testcentricity_web/elements/audio_spec.rb +0 -68
  60. data/spec/testcentricity_web/elements/button_spec.rb +0 -18
  61. data/spec/testcentricity_web/elements/checkbox_spec.rb +0 -33
  62. data/spec/testcentricity_web/elements/file_field_spec.rb +0 -13
  63. data/spec/testcentricity_web/elements/image_spec.rb +0 -33
  64. data/spec/testcentricity_web/elements/label_spec.rb +0 -18
  65. data/spec/testcentricity_web/elements/link_spec.rb +0 -23
  66. data/spec/testcentricity_web/elements/list_spec.rb +0 -13
  67. data/spec/testcentricity_web/elements/radio_spec.rb +0 -28
  68. data/spec/testcentricity_web/elements/ui_element_spec.rb +0 -125
  69. data/spec/testcentricity_web/elements/video_spec.rb +0 -68
  70. data/spec/testcentricity_web/helper_specs/object_helpers_spec.rb +0 -39
  71. data/spec/testcentricity_web/helper_specs/string_helpers_spec.rb +0 -49
  72. data/spec/testcentricity_web/page_object_spec.rb +0 -90
  73. data/spec/testcentricity_web/section_object_spec.rb +0 -72
  74. data/spec/testcentricity_web/version_spec.rb +0 -7
  75. data/spec/testcentricity_web/webdriver_connect/grid_webdriver_spec.rb +0 -72
  76. data/spec/testcentricity_web/webdriver_connect/local_webdriver_spec.rb +0 -86
  77. data/spec/testcentricity_web/webdriver_connect/mobile_webdriver_spec.rb +0 -65
  78. data/test_site/basic_test_page.html +0 -269
  79. data/test_site/chosen/chosen-sprite.png +0 -0
  80. data/test_site/chosen/chosen-sprite@2x.png +0 -0
  81. data/test_site/chosen/chosen.css +0 -496
  82. data/test_site/chosen/chosen.jquery.js +0 -1359
  83. data/test_site/chosen/chosen.jquery.min.js +0 -3
  84. data/test_site/chosen/chosen.min.css +0 -11
  85. data/test_site/chosen/chosen.proto.js +0 -1399
  86. data/test_site/chosen/chosen.proto.min.js +0 -3
  87. data/test_site/chosen/composer.json +0 -36
  88. data/test_site/custom_controls_page.html +0 -629
  89. data/test_site/docsupport/chosen.png +0 -0
  90. data/test_site/docsupport/init.js +0 -11
  91. data/test_site/docsupport/init.proto.js +0 -16
  92. data/test_site/docsupport/jquery-1.12.4.min.js +0 -5
  93. data/test_site/docsupport/jquery-3.2.1.min.js +0 -4
  94. data/test_site/docsupport/oss-credit.png +0 -0
  95. data/test_site/docsupport/prism.css +0 -108
  96. data/test_site/docsupport/prism.js +0 -9
  97. data/test_site/docsupport/prototype-1.7.0.0.js +0 -6082
  98. data/test_site/docsupport/style.css +0 -219
  99. data/test_site/images/Blouse_Black.jpg +0 -0
  100. data/test_site/images/Granny.jpg +0 -0
  101. data/test_site/images/Printed_Dress.jpg +0 -0
  102. data/test_site/images/T-shirt.jpg +0 -0
  103. data/test_site/images/Wilder.jpg +0 -0
  104. data/test_site/images/You_Betcha.jpg +0 -0
  105. data/test_site/images/jeans3.jpg +0 -0
  106. data/test_site/indexed_sections_page.html +0 -215
  107. data/test_site/media/MIB2-subtitles-pt-BR.vtt +0 -49
  108. data/test_site/media/MIB2.mp4 +0 -0
  109. data/test_site/media/MP4_small.mp4 +0 -0
  110. data/test_site/media/MPS_sample.mp3 +0 -0
  111. data/test_site/media/bbc_scotland_report.mp3 +0 -0
  112. data/test_site/media/count_and_bars.mp4 +0 -0
  113. data/test_site/media_page.html +0 -86
  114. data/testcentricity_web.gemspec +0 -59
@@ -32,8 +32,10 @@ module TestCentricity
32
32
  # :nocov:
33
33
  Environ.parallel = true
34
34
  Environ.process_num = ENV['TEST_ENV_NUMBER']
35
- @downloads_path = "#{@downloads_path}/#{ENV['TEST_ENV_NUMBER']}"
36
- Dir.mkdir(@downloads_path) unless Dir.exist?(@downloads_path)
35
+ if Dir.exist?(@downloads_path)
36
+ @downloads_path = "#{@downloads_path}/#{ENV['TEST_ENV_NUMBER']}"
37
+ Dir.mkdir(@downloads_path) unless Dir.exist?(@downloads_path)
38
+ end
37
39
  # :nocov:
38
40
  else
39
41
  Environ.parallel = false
@@ -138,70 +140,74 @@ module TestCentricity
138
140
  private
139
141
 
140
142
  def self.initialize_appium
141
- Environ.platform = :mobile
143
+ Environ.platform = :mobile
144
+ Environ.device = :simulator
142
145
  Environ.device_name = ENV['APP_DEVICE']
143
- Environ.device_os = ENV['APP_PLATFORM_NAME'].downcase.to_sym
146
+ Environ.device_os = ENV['APP_PLATFORM_NAME'].downcase.to_sym
144
147
  Environ.device_type = ENV['DEVICE_TYPE'] if ENV['DEVICE_TYPE']
145
148
  Environ.device_os_version = ENV['APP_VERSION']
146
149
  Environ.device_orientation = ENV['ORIENTATION'] if ENV['ORIENTATION']
147
150
  Capybara.default_driver = :appium
148
151
  Environ.driver = :appium
149
- desired_capabilities = {
150
- platformName: Environ.device_os,
151
- platformVersion: Environ.device_os_version,
152
- browserName: ENV['APP_BROWSER'],
153
- deviceName: Environ.device_name
154
- }
155
- desired_capabilities[:avd] = ENV['APP_DEVICE'] if Environ.device_os == :android
156
- desired_capabilities[:automationName] = ENV['AUTOMATION_ENGINE'] if ENV['AUTOMATION_ENGINE']
157
- if ENV['UDID']
158
- # :nocov:
159
- Environ.device = :device
160
- desired_capabilities[:udid] = ENV['UDID']
161
- desired_capabilities[:xcodeOrgId] = ENV['TEAM_ID'] if ENV['TEAM_ID']
162
- desired_capabilities[:xcodeSigningId] = ENV['TEAM_NAME'] if ENV['TEAM_NAME']
163
- # :nocov:
164
- else
165
- Environ.device = :simulator
166
- desired_capabilities[:orientation] = Environ.device_orientation.upcase if Environ.device_orientation
167
- if Environ.device_os == :ios
168
- desired_capabilities[:language] = Environ.language if Environ.language
169
- desired_capabilities[:locale] = Environ.locale.gsub('-', '_') if Environ.locale
170
- end
171
- end
172
- desired_capabilities[:safariIgnoreFraudWarning] = ENV['APP_IGNORE_FRAUD_WARNING'] if ENV['APP_IGNORE_FRAUD_WARNING']
173
- desired_capabilities[:safariInitialUrl] = ENV['APP_INITIAL_URL'] if ENV['APP_INITIAL_URL']
174
- desired_capabilities[:safariAllowPopups] = ENV['APP_ALLOW_POPUPS'] if ENV['APP_ALLOW_POPUPS']
175
- desired_capabilities[:shutdownOtherSimulators] = ENV['SHUTDOWN_OTHER_SIMS'] if ENV['SHUTDOWN_OTHER_SIMS']
176
- desired_capabilities[:forceSimulatorSoftwareKeyboardPresence] = ENV['SHOW_SIM_KEYBOARD'] if ENV['SHOW_SIM_KEYBOARD']
177
-
178
- desired_capabilities[:autoAcceptAlerts] = ENV['AUTO_ACCEPT_ALERTS'] if ENV['AUTO_ACCEPT_ALERTS']
179
- desired_capabilities[:autoDismissAlerts] = ENV['AUTO_DISMISS_ALERTS'] if ENV['AUTO_DISMISS_ALERTS']
180
- desired_capabilities[:isHeadless] = ENV['HEADLESS'] if ENV['HEADLESS']
181
-
182
- desired_capabilities[:newCommandTimeout] = ENV['NEW_COMMAND_TIMEOUT'] if ENV['NEW_COMMAND_TIMEOUT']
183
- desired_capabilities[:noReset] = ENV['APP_NO_RESET'] if ENV['APP_NO_RESET']
184
- desired_capabilities[:fullReset] = ENV['APP_FULL_RESET'] if ENV['APP_FULL_RESET']
185
- desired_capabilities[:webkitDebugProxyPort] = ENV['WEBKIT_DEBUG_PROXY_PORT'] if ENV['WEBKIT_DEBUG_PROXY_PORT']
186
- desired_capabilities[:webDriverAgentUrl] = ENV['WEBDRIVER_AGENT_URL'] if ENV['WEBDRIVER_AGENT_URL']
187
- desired_capabilities[:usePrebuiltWDA] = ENV['USE_PREBUILT_WDA'] if ENV['USE_PREBUILT_WDA']
188
- desired_capabilities[:useNewWDA] = ENV['USE_NEW_WDA'] if ENV['USE_NEW_WDA']
189
- desired_capabilities[:chromedriverExecutable] = ENV['CHROMEDRIVER_EXECUTABLE'] if ENV['CHROMEDRIVER_EXECUTABLE']
190
- # set wdaLocalPort (iOS) or systemPort (Android) if PARALLEL_PORT is true
191
- if ENV['PARALLEL'] && ENV['PARALLEL_PORT']
192
- # :nocov:
193
- if Environ.device_os == :ios
194
- desired_capabilities[:wdaLocalPort] = 8100 + ENV['TEST_ENV_NUMBER'].to_i
195
- else
196
- desired_capabilities[:systemPort] = 8200 + ENV['TEST_ENV_NUMBER'].to_i
197
- end
198
- # :nocov:
199
- else
200
- desired_capabilities[:wdaLocalPort] = ENV['WDA_LOCAL_PORT'] if ENV['WDA_LOCAL_PORT']
201
- desired_capabilities[:systemPort] = ENV['SYSTEM_PORT'] if ENV['SYSTEM_PORT']
202
- end
203
-
204
- desired_capabilities = @capabilities unless @capabilities.nil?
152
+ # define capabilites
153
+ desired_capabilities = if @capabilities.nil?
154
+ desired_capabilities = {
155
+ platformName: Environ.device_os,
156
+ platformVersion: Environ.device_os_version,
157
+ browserName: ENV['APP_BROWSER'],
158
+ deviceName: Environ.device_name
159
+ }
160
+ desired_capabilities[:avd] = ENV['APP_DEVICE'] if Environ.device_os == :android
161
+ desired_capabilities[:automationName] = ENV['AUTOMATION_ENGINE'] if ENV['AUTOMATION_ENGINE']
162
+ if ENV['UDID']
163
+ # :nocov:
164
+ Environ.device = :device
165
+ desired_capabilities[:udid] = ENV['UDID']
166
+ desired_capabilities[:xcodeOrgId] = ENV['TEAM_ID'] if ENV['TEAM_ID']
167
+ desired_capabilities[:xcodeSigningId] = ENV['TEAM_NAME'] if ENV['TEAM_NAME']
168
+ # :nocov:
169
+ else
170
+ desired_capabilities[:orientation] = Environ.device_orientation.upcase if Environ.device_orientation
171
+ if Environ.device_os == :ios
172
+ desired_capabilities[:language] = Environ.language if Environ.language
173
+ desired_capabilities[:locale] = Environ.locale.gsub('-', '_') if Environ.locale
174
+ end
175
+ end
176
+ desired_capabilities[:safariIgnoreFraudWarning] = ENV['APP_IGNORE_FRAUD_WARNING'] if ENV['APP_IGNORE_FRAUD_WARNING']
177
+ desired_capabilities[:safariInitialUrl] = ENV['APP_INITIAL_URL'] if ENV['APP_INITIAL_URL']
178
+ desired_capabilities[:safariAllowPopups] = ENV['APP_ALLOW_POPUPS'] if ENV['APP_ALLOW_POPUPS']
179
+ desired_capabilities[:shutdownOtherSimulators] = ENV['SHUTDOWN_OTHER_SIMS'] if ENV['SHUTDOWN_OTHER_SIMS']
180
+ desired_capabilities[:forceSimulatorSoftwareKeyboardPresence] = ENV['SHOW_SIM_KEYBOARD'] if ENV['SHOW_SIM_KEYBOARD']
181
+
182
+ desired_capabilities[:autoAcceptAlerts] = ENV['AUTO_ACCEPT_ALERTS'] if ENV['AUTO_ACCEPT_ALERTS']
183
+ desired_capabilities[:autoDismissAlerts] = ENV['AUTO_DISMISS_ALERTS'] if ENV['AUTO_DISMISS_ALERTS']
184
+ desired_capabilities[:isHeadless] = ENV['HEADLESS'] if ENV['HEADLESS']
185
+
186
+ desired_capabilities[:newCommandTimeout] = ENV['NEW_COMMAND_TIMEOUT'] if ENV['NEW_COMMAND_TIMEOUT']
187
+ desired_capabilities[:noReset] = ENV['APP_NO_RESET'] if ENV['APP_NO_RESET']
188
+ desired_capabilities[:fullReset] = ENV['APP_FULL_RESET'] if ENV['APP_FULL_RESET']
189
+ desired_capabilities[:webkitDebugProxyPort] = ENV['WEBKIT_DEBUG_PROXY_PORT'] if ENV['WEBKIT_DEBUG_PROXY_PORT']
190
+ desired_capabilities[:webDriverAgentUrl] = ENV['WEBDRIVER_AGENT_URL'] if ENV['WEBDRIVER_AGENT_URL']
191
+ desired_capabilities[:usePrebuiltWDA] = ENV['USE_PREBUILT_WDA'] if ENV['USE_PREBUILT_WDA']
192
+ desired_capabilities[:useNewWDA] = ENV['USE_NEW_WDA'] if ENV['USE_NEW_WDA']
193
+ desired_capabilities[:chromedriverExecutable] = ENV['CHROMEDRIVER_EXECUTABLE'] if ENV['CHROMEDRIVER_EXECUTABLE']
194
+ # set wdaLocalPort (iOS) or systemPort (Android) if PARALLEL_PORT is true
195
+ if ENV['PARALLEL'] && ENV['PARALLEL_PORT']
196
+ # :nocov:
197
+ if Environ.device_os == :ios
198
+ desired_capabilities[:wdaLocalPort] = 8100 + ENV['TEST_ENV_NUMBER'].to_i
199
+ else
200
+ desired_capabilities[:systemPort] = 8200 + ENV['TEST_ENV_NUMBER'].to_i
201
+ end
202
+ # :nocov:
203
+ else
204
+ desired_capabilities[:wdaLocalPort] = ENV['WDA_LOCAL_PORT'] if ENV['WDA_LOCAL_PORT']
205
+ desired_capabilities[:systemPort] = ENV['SYSTEM_PORT'] if ENV['SYSTEM_PORT']
206
+ end
207
+ desired_capabilities
208
+ else
209
+ @capabilities
210
+ end
205
211
  # specify endpoint url
206
212
  @endpoint = 'http://localhost:4723/wd/hub' if @endpoint.nil?
207
213
 
@@ -488,7 +494,7 @@ module TestCentricity
488
494
  # define mobile device options
489
495
  if ENV['SL_PLATFORM']
490
496
  sl_options[:deviceOrientation] = ENV['ORIENTATION'].upcase if ENV['ORIENTATION']
491
- sl_options[:appiumVersion] = '1.22.0'
497
+ sl_options[:appiumVersion] = '1.22.3'
492
498
  {
493
499
  browserName: browser,
494
500
  platformName: ENV['SL_PLATFORM'],
@@ -213,6 +213,114 @@ module TestCentricity
213
213
  obj.native.attribute('volume').to_f
214
214
  end
215
215
 
216
+ # Return number of text tracks of associated media
217
+ #
218
+ # @return [Integer] number of text tracks
219
+ # @example
220
+ # num_tracks = media_player.track_count
221
+ #
222
+ def track_count
223
+ obj, = find_element(visible = :all)
224
+ object_not_found_exception(obj, @type)
225
+ page.execute_script('return arguments[0].textTracks.length', obj)
226
+ end
227
+
228
+ # Return index of active text track of associated media
229
+ #
230
+ # @return [Integer] number of active text track
231
+ # @example
232
+ # track_num = media_player.active_track
233
+ #
234
+ def active_track
235
+ num_tracks = track_count
236
+ return 0 if num_tracks.zero?
237
+
238
+ obj, = find_element(visible = :all)
239
+ object_not_found_exception(obj, @type)
240
+ (0..num_tracks).each do |track|
241
+ track_info = page.execute_script("return arguments[0].textTracks[#{track}].mode", obj)
242
+ return track + 1 if track_info == 'showing'
243
+ end
244
+ 0
245
+ end
246
+
247
+ # Return properties of active text track of associated media
248
+ #
249
+ # @return [Hash] properties of active text track (:kind, :label, :language, :mode)
250
+ # @example
251
+ # track_info = media_player.active_track_data
252
+ #
253
+ def active_track_data
254
+ active = active_track
255
+ return nil if active.zero?
256
+
257
+ track_data(active)
258
+ end
259
+
260
+ # Return properties of all text tracks of associated media
261
+ #
262
+ # @return [Array of Hash] properties of active text track (:kind, :label, :language, :mode)
263
+ # @example
264
+ # all_track_info = media_player.all_tracks_data
265
+ #
266
+ def all_tracks_data
267
+ num_tracks = track_count
268
+ return 0 if num_tracks.zero?
269
+
270
+ all_data = []
271
+ (1..num_tracks).each do |track|
272
+ all_data.push( { track => track_data(track) })
273
+ end
274
+ all_data
275
+ end
276
+
277
+ # Return properties of specified text track of associated media
278
+ #
279
+ # @param track [Integer] index of requested track
280
+ # @return [Hash] properties of requested text track (:kind, :label, :language, :mode)
281
+ # @example
282
+ # track_info = media_player.track_data(1)
283
+ #
284
+ def track_data(track)
285
+ obj, = find_element(visible = :all)
286
+ object_not_found_exception(obj, @type)
287
+ track_mode = page.execute_script("return arguments[0].textTracks[#{track - 1}].mode", obj)
288
+ track_obj = obj.find(:css, "track:nth-of-type(#{track})", visible: :all, wait: 1)
289
+ {
290
+ kind: track_obj[:kind],
291
+ label: track_obj[:label],
292
+ language: track_obj[:srclang],
293
+ mode: track_mode
294
+ }
295
+ end
296
+
297
+ # Return src property of active text track of associated media
298
+ #
299
+ # @return [String] src property of active text track
300
+ # @example
301
+ # track_src = media_player.active_track_source
302
+ #
303
+ def active_track_source
304
+ active = active_track
305
+ return nil if active.zero?
306
+
307
+ track_source(active)
308
+ end
309
+
310
+ # Return srv property of specified text track of associated media
311
+ #
312
+ # @param track [Integer] index of requested track
313
+ # @return [String] src property of requested text track
314
+ # @example
315
+ # track_src = media_player.track_source(2)
316
+ #
317
+ def track_source(track)
318
+ obj, = find_element(visible = :all)
319
+ object_not_found_exception(obj, @type)
320
+ track_obj = obj.find(:css, "track:nth-of-type(#{track})", visible: :all, wait: 1)
321
+ track_obj[:src]
322
+ end
323
+
216
324
  # Set the media currentTime property
217
325
  #
218
326
  # @param value [Float] time in seconds
@@ -42,6 +42,34 @@ module TestCentricity
42
42
  obj.native.attribute('placeholder')
43
43
  end
44
44
 
45
+ # Return validationMessage property of a textfield, which is the message the browser displays to the user when a textfield's
46
+ # validity is checked and fails. Note that each web browser provides a default localized message for this property, and message
47
+ # strings can vary between different browsers (Chrome/Edge vs Firefox vs Safari).
48
+ #
49
+ # @return [String]
50
+ # @example
51
+ # message = username_field.validation_message
52
+ #
53
+ def validation_message
54
+ obj, = find_element
55
+ object_not_found_exception(obj, nil)
56
+ obj.native.attribute('validationMessage')
57
+ end
58
+
59
+ # Return Boolean value representing
60
+ #
61
+ # @param validity_state [Symbol] property to verify
62
+ # @return [Boolean]
63
+ # @example
64
+ # username_field.validity?(:valid)
65
+ # username_field.validity?(:valueMissing)
66
+ #
67
+ def validity?(validity_state)
68
+ obj, = find_element
69
+ object_not_found_exception(obj, nil)
70
+ page.execute_script("return arguments[0].validity.#{validity_state}", obj)
71
+ end
72
+
45
73
  # Return min attribute of a number type text field.
46
74
  #
47
75
  # @return [Integer]
@@ -47,7 +47,7 @@ module TestCentricity
47
47
  attr_accessor :base_object
48
48
 
49
49
  XPATH_SELECTORS = ['//', '[@', '[contains(']
50
- CSS_SELECTORS = ['#', ':nth-child(', ':first-child', ':last-child', ':nth-of-type(', ':first-of-type', ':last-of-type', '^=', '$=', '*=', ':contains(']
50
+ CSS_SELECTORS = %w[# :nth-child( :first-child :last-child :nth-of-type( :first-of-type :last-of-type ^= $= *= :contains(]
51
51
 
52
52
  def initialize(name, parent, locator, context)
53
53
  @name = name
@@ -390,6 +390,44 @@ module TestCentricity
390
390
  end
391
391
  end
392
392
 
393
+ # Wait until the object is enabled, or until the specified wait time has expired. If the wait time is nil, then the
394
+ # wait time will be Capybara.default_max_wait_time.
395
+ #
396
+ # @param seconds [Integer or Float] wait time in seconds
397
+ # @example
398
+ # run_button.wait_until_enabled(10)
399
+ #
400
+ def wait_until_enabled(seconds = nil, post_exception = true)
401
+ timeout = seconds.nil? ? Capybara.default_max_wait_time : seconds
402
+ wait = Selenium::WebDriver::Wait.new(timeout: timeout)
403
+ wait.until { enabled? }
404
+ rescue StandardError
405
+ if post_exception
406
+ raise "UI #{object_ref_message} remained disabled after #{timeout} seconds" unless enabled?
407
+ else
408
+ enabled?
409
+ end
410
+ end
411
+
412
+ # Wait until the object is no longer in a busy state, or until the specified wait time has expired. If the wait time
413
+ # is nil, then the wait time will be Capybara.default_max_wait_time.
414
+ #
415
+ # @param seconds [Integer or Float] wait time in seconds
416
+ # @example
417
+ # login_button.wait_while_busy(10)
418
+ #
419
+ def wait_while_busy(seconds = nil, post_exception = true)
420
+ timeout = seconds.nil? ? Capybara.default_max_wait_time : seconds
421
+ wait = Selenium::WebDriver::Wait.new(timeout: timeout)
422
+ wait.until { aria_busy? }
423
+ rescue StandardError
424
+ if post_exception
425
+ raise "UI #{object_ref_message} remained in busy state after #{timeout} seconds" if aria_busy?
426
+ else
427
+ aria_busy?
428
+ end
429
+ end
430
+
393
431
  # Wait until the object's value equals the specified value, or until the specified wait time has expired. If the wait
394
432
  # time is nil, then the wait time will be Capybara.default_max_wait_time.
395
433
  #
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testcentricity_web
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.10
4
+ version: 4.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - A.J. Mrozinski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-19 00:00:00.000000000 Z
11
+ date: 2022-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appium_capybara
@@ -387,52 +387,10 @@ executables: []
387
387
  extensions: []
388
388
  extra_rdoc_files: []
389
389
  files:
390
- - ".gitignore"
391
- - ".idea/.name"
392
- - ".idea/encodings.xml"
393
- - ".idea/misc.xml"
394
- - ".idea/modules.xml"
395
- - ".idea/vcs.xml"
396
- - ".rspec"
397
- - ".rubocop.yml"
398
- - ".ruby-version"
399
- - ".simplecov"
400
390
  - ".yardopts"
401
391
  - CHANGELOG.md
402
- - CODE_OF_CONDUCT.md
403
- - Gemfile
404
392
  - LICENSE.md
405
393
  - README.md
406
- - Rakefile
407
- - config/cucumber.yml
408
- - config/locales/en-US.yml
409
- - config/test_data/LOCAL_data.json
410
- - config/test_data/LOCAL_data.xls
411
- - config/test_data/LOCAL_data.yml
412
- - config/test_data/data.json
413
- - config/test_data/data.xls
414
- - config/test_data/data.yml
415
- - docker-compose.yml
416
- - features/basic_form_page_css.feature
417
- - features/basic_form_page_xpath.feature
418
- - features/custom_controls.feature
419
- - features/media_players.feature
420
- - features/step_definitions/generic_steps.rb.rb
421
- - features/step_definitions/media_steps.rb
422
- - features/support/data/form_data.rb
423
- - features/support/env.rb
424
- - features/support/hooks.rb
425
- - features/support/pages/base_test_page.rb
426
- - features/support/pages/basic_css_form_page.rb
427
- - features/support/pages/basic_form_page.rb
428
- - features/support/pages/basic_xpath_form_page.rb
429
- - features/support/pages/custom_controls_page.rb
430
- - features/support/pages/indexed_sections_page.rb
431
- - features/support/pages/media_test_page.rb
432
- - features/support/sections/header_nav.rb
433
- - features/support/sections/product_card.rb
434
- - features/support/world_data.rb
435
- - features/support/world_pages.rb
436
394
  - lib/devices/devices.yml
437
395
  - lib/testcentricity_web.rb
438
396
  - lib/testcentricity_web/appium_server.rb
@@ -465,71 +423,12 @@ files:
465
423
  - lib/testcentricity_web/web_elements/ui_elements_helper.rb
466
424
  - lib/testcentricity_web/web_elements/video.rb
467
425
  - lib/testcentricity_web/world_extensions.rb
468
- - reports/.keep
469
- - spec/fixtures/page_object.rb
470
- - spec/fixtures/section_object.rb
471
- - spec/spec_helper.rb
472
- - spec/testcentricity_web/browser_spec.rb
473
- - spec/testcentricity_web/elements/audio_spec.rb
474
- - spec/testcentricity_web/elements/button_spec.rb
475
- - spec/testcentricity_web/elements/checkbox_spec.rb
476
- - spec/testcentricity_web/elements/file_field_spec.rb
477
- - spec/testcentricity_web/elements/image_spec.rb
478
- - spec/testcentricity_web/elements/label_spec.rb
479
- - spec/testcentricity_web/elements/link_spec.rb
480
- - spec/testcentricity_web/elements/list_spec.rb
481
- - spec/testcentricity_web/elements/radio_spec.rb
482
- - spec/testcentricity_web/elements/ui_element_spec.rb
483
- - spec/testcentricity_web/elements/video_spec.rb
484
- - spec/testcentricity_web/helper_specs/object_helpers_spec.rb
485
- - spec/testcentricity_web/helper_specs/string_helpers_spec.rb
486
- - spec/testcentricity_web/page_object_spec.rb
487
- - spec/testcentricity_web/section_object_spec.rb
488
- - spec/testcentricity_web/version_spec.rb
489
- - spec/testcentricity_web/webdriver_connect/grid_webdriver_spec.rb
490
- - spec/testcentricity_web/webdriver_connect/local_webdriver_spec.rb
491
- - spec/testcentricity_web/webdriver_connect/mobile_webdriver_spec.rb
492
- - test_site/basic_test_page.html
493
- - test_site/chosen/chosen-sprite.png
494
- - test_site/chosen/chosen-sprite@2x.png
495
- - test_site/chosen/chosen.css
496
- - test_site/chosen/chosen.jquery.js
497
- - test_site/chosen/chosen.jquery.min.js
498
- - test_site/chosen/chosen.min.css
499
- - test_site/chosen/chosen.proto.js
500
- - test_site/chosen/chosen.proto.min.js
501
- - test_site/chosen/composer.json
502
- - test_site/custom_controls_page.html
503
- - test_site/docsupport/chosen.png
504
- - test_site/docsupport/init.js
505
- - test_site/docsupport/init.proto.js
506
- - test_site/docsupport/jquery-1.12.4.min.js
507
- - test_site/docsupport/jquery-3.2.1.min.js
508
- - test_site/docsupport/oss-credit.png
509
- - test_site/docsupport/prism.css
510
- - test_site/docsupport/prism.js
511
- - test_site/docsupport/prototype-1.7.0.0.js
512
- - test_site/docsupport/style.css
513
- - test_site/images/Blouse_Black.jpg
514
- - test_site/images/Granny.jpg
515
- - test_site/images/Printed_Dress.jpg
516
- - test_site/images/T-shirt.jpg
517
- - test_site/images/Wilder.jpg
518
- - test_site/images/You_Betcha.jpg
519
- - test_site/images/jeans3.jpg
520
- - test_site/indexed_sections_page.html
521
- - test_site/media/MIB2-subtitles-pt-BR.vtt
522
- - test_site/media/MIB2.mp4
523
- - test_site/media/MP4_small.mp4
524
- - test_site/media/MPS_sample.mp3
525
- - test_site/media/bbc_scotland_report.mp3
526
- - test_site/media/count_and_bars.mp4
527
- - test_site/media_page.html
528
- - testcentricity_web.gemspec
529
426
  homepage: https://github.com/TestCentricity/testcentricity_web
530
427
  licenses:
531
428
  - BSD-3-Clause
532
- metadata: {}
429
+ metadata:
430
+ changelog_uri: https://github.com/TestCentricity/testcentricity_web/blob/main/CHANGELOG.md
431
+ documentation_uri: https://www.rubydoc.info/gems/testcentricity_web
533
432
  post_install_message:
534
433
  rdoc_options: []
535
434
  require_paths:
@@ -550,47 +449,4 @@ rubygems_version: 3.1.6
550
449
  signing_key:
551
450
  specification_version: 4
552
451
  summary: A Page Object Model Framework for desktop and mobile web testing
553
- test_files:
554
- - features/basic_form_page_css.feature
555
- - features/basic_form_page_xpath.feature
556
- - features/custom_controls.feature
557
- - features/media_players.feature
558
- - features/step_definitions/generic_steps.rb.rb
559
- - features/step_definitions/media_steps.rb
560
- - features/support/data/form_data.rb
561
- - features/support/env.rb
562
- - features/support/hooks.rb
563
- - features/support/pages/base_test_page.rb
564
- - features/support/pages/basic_css_form_page.rb
565
- - features/support/pages/basic_form_page.rb
566
- - features/support/pages/basic_xpath_form_page.rb
567
- - features/support/pages/custom_controls_page.rb
568
- - features/support/pages/indexed_sections_page.rb
569
- - features/support/pages/media_test_page.rb
570
- - features/support/sections/header_nav.rb
571
- - features/support/sections/product_card.rb
572
- - features/support/world_data.rb
573
- - features/support/world_pages.rb
574
- - spec/fixtures/page_object.rb
575
- - spec/fixtures/section_object.rb
576
- - spec/spec_helper.rb
577
- - spec/testcentricity_web/browser_spec.rb
578
- - spec/testcentricity_web/elements/audio_spec.rb
579
- - spec/testcentricity_web/elements/button_spec.rb
580
- - spec/testcentricity_web/elements/checkbox_spec.rb
581
- - spec/testcentricity_web/elements/file_field_spec.rb
582
- - spec/testcentricity_web/elements/image_spec.rb
583
- - spec/testcentricity_web/elements/label_spec.rb
584
- - spec/testcentricity_web/elements/link_spec.rb
585
- - spec/testcentricity_web/elements/list_spec.rb
586
- - spec/testcentricity_web/elements/radio_spec.rb
587
- - spec/testcentricity_web/elements/ui_element_spec.rb
588
- - spec/testcentricity_web/elements/video_spec.rb
589
- - spec/testcentricity_web/helper_specs/object_helpers_spec.rb
590
- - spec/testcentricity_web/helper_specs/string_helpers_spec.rb
591
- - spec/testcentricity_web/page_object_spec.rb
592
- - spec/testcentricity_web/section_object_spec.rb
593
- - spec/testcentricity_web/version_spec.rb
594
- - spec/testcentricity_web/webdriver_connect/grid_webdriver_spec.rb
595
- - spec/testcentricity_web/webdriver_connect/local_webdriver_spec.rb
596
- - spec/testcentricity_web/webdriver_connect/mobile_webdriver_spec.rb
452
+ test_files: []
data/.gitignore DELETED
@@ -1,39 +0,0 @@
1
- # OSX folder stuff
2
- .DS_Store
3
- Thumbs.db
4
-
5
- #IDE project files
6
- /.idea
7
- .settings
8
- .project
9
-
10
- /.bundle/
11
- /.yardoc
12
- /_yardoc/
13
- /coverage/
14
- /doc/
15
- /pkg/
16
- /spec/reports/
17
- /tmp/
18
- Gemfile*.lock
19
-
20
- # rspec failure tracking
21
- .rspec_status
22
-
23
- # Ignore test-reports
24
- reports/*.html
25
- reports/*.xml
26
- reports/*.json
27
- reports/screenshots/
28
- test-reports
29
- capybara-*.html
30
- debug.log
31
-
32
- BrowserStackLocal
33
- cbttunnel.jar
34
-
35
- /.yardoc/
36
- /local.log
37
- .run/*.xml
38
-
39
- echo coverage >> .gitignore
data/.idea/.name DELETED
@@ -1 +0,0 @@
1
- testcentricity_web
data/.idea/encodings.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="Encoding">
4
- <file url="PROJECT" charset="UTF-8" />
5
- </component>
6
- </project>
data/.idea/misc.xml DELETED
@@ -1,4 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectRootManager" version="2" project-jdk-name="ruby-2.0.0-p481" project-jdk-type="RUBY_SDK" />
4
- </project>
data/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/testcentricity_web.iml" filepath="$PROJECT_DIR$/.idea/testcentricity_web.iml" />
6
- </modules>
7
- </component>
8
- </project>
data/.idea/vcs.xml DELETED
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
5
- <mapping directory="$PROJECT_DIR$" vcs="Git" />
6
- </component>
7
- </project>
data/.rspec DELETED
@@ -1,4 +0,0 @@
1
- # General configuration options
2
- --color
3
- --require spec_helper
4
- --format documentation