testcentricity_web 3.2.24 → 3.2.25

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b21c47393a41751840d0332d9e2cda05a195da105ed77a420a08f8e5355d1b0a
4
- data.tar.gz: f1ab14a2692cb98a1034d854640720b7f0286aca92a6ac7bb75759fc0d357fb2
3
+ metadata.gz: 49868a5ac9a36308a250e4682750a7450c94f0bd297d8103d25170fbd067491e
4
+ data.tar.gz: bd80b70984d2646cf6d510be7517d9a2e5d353df69c30f367c89bfba7d29e011
5
5
  SHA512:
6
- metadata.gz: 5853adc39458b0deff3af6ee1e72146ce459a554f76beeea276131b666d4344b4d5630b95c76644db8e57d3576bff18502c6a0561480203d3fc33299b640a2f7
7
- data.tar.gz: 8614c1ff61a143bc2e83a499958143513dcd1b8abd33aa39539ef445f85ee6517e5453133719465d51541cff68f247df55b5259d047080d904e68eb3b1f629a4
6
+ metadata.gz: bb6029661e87b7528125a06dce284b149f09f538c31c24a2835c55f36b7f38a2699c7cd8c9b4768205496b409a2d7b7210ce5e99bdb5a7173c2677343af3def7
7
+ data.tar.gz: 384e430102526d15a43c35e2bcab9ff11df24497cb342767aacd4527694e06c1053d20ceb69d298841499932aefbca3945d528dfb10871a6b7e70e3268cf415b
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
4
 
5
+ ## [3.2.25] - 11-MAR-2021
6
+
7
+ ### Added
8
+ * Added `String.titlecase` method.
9
+
5
10
  ## [3.2.23] - 11-FEB-2021
6
11
 
7
12
  ### Changed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- testcentricity_web (3.2.24)
4
+ testcentricity_web (3.2.25)
5
5
  appium_lib
6
6
  browserstack-local
7
7
  capybara (>= 3.1, < 4)
@@ -56,13 +56,13 @@ GEM
56
56
  faye-websocket (0.11.0)
57
57
  eventmachine (>= 0.12.0)
58
58
  websocket-driver (>= 0.5.1)
59
- ffi (1.14.2)
59
+ ffi (1.15.0)
60
60
  i18n (1.8.9)
61
61
  concurrent-ruby (~> 1.0)
62
62
  ice_nine (0.11.2)
63
63
  mini_mime (1.0.2)
64
64
  mini_portile2 (2.5.0)
65
- nokogiri (1.11.1)
65
+ nokogiri (1.11.2)
66
66
  mini_portile2 (~> 2.5.0)
67
67
  racc (~> 1.4)
68
68
  os (1.1.1)
@@ -74,7 +74,7 @@ GEM
74
74
  rack (>= 1.0, < 3)
75
75
  rake (13.0.1)
76
76
  redcarpet (3.5.0)
77
- regexp_parser (2.1.0)
77
+ regexp_parser (2.1.1)
78
78
  ruby-ole (1.2.12.2)
79
79
  rubyzip (2.3.0)
80
80
  selenium-webdriver (3.142.7)
@@ -91,7 +91,7 @@ GEM
91
91
  coercible (~> 1.0)
92
92
  descendants_tracker (~> 0.0, >= 0.0.3)
93
93
  equalizer (~> 0.0, >= 0.0.9)
94
- webdrivers (4.5.0)
94
+ webdrivers (4.6.0)
95
95
  nokogiri (~> 1.6)
96
96
  rubyzip (>= 1.3.0)
97
97
  selenium-webdriver (>= 3.0, < 4.0)
@@ -36,11 +36,14 @@ module TestCentricity
36
36
  attr_accessor :device_name
37
37
  attr_accessor :device_type
38
38
  attr_accessor :device_os
39
+ attr_accessor :device_os_version
39
40
  attr_accessor :device_orientation
40
41
  attr_accessor :platform
41
42
  attr_accessor :driver
42
43
  attr_accessor :grid
43
44
  attr_accessor :tunneling
45
+ attr_accessor :locale
46
+ attr_accessor :language
44
47
 
45
48
  attr_accessor :parallel
46
49
  attr_accessor :process_num
@@ -85,6 +88,8 @@ module TestCentricity
85
88
  @db_username = data['DB_USERNAME']
86
89
  @db_password = data['DB_PASSWORD']
87
90
  @a11y_standard = ENV['ACCESSIBILITY_STANDARD'] || 'best-practice'
91
+ @locale = ENV['LOCALE'] || 'en'
92
+ @language = ENV['LANGUAGE'] || 'English'
88
93
 
89
94
  super
90
95
  end
@@ -213,6 +218,14 @@ module TestCentricity
213
218
  @device_os
214
219
  end
215
220
 
221
+ def self.device_os_version=(version)
222
+ @device_os_version = version
223
+ end
224
+
225
+ def self.device_os_version
226
+ @device_os_version
227
+ end
228
+
216
229
  def self.is_ios?
217
230
  @device_os == :ios
218
231
  end
@@ -253,6 +266,22 @@ module TestCentricity
253
266
  @tunneling
254
267
  end
255
268
 
269
+ def self.language=(language)
270
+ @language = language
271
+ end
272
+
273
+ def self.language
274
+ @language
275
+ end
276
+
277
+ def self.locale=(locale)
278
+ @locale = locale
279
+ end
280
+
281
+ def self.locale
282
+ @locale
283
+ end
284
+
256
285
  def self.platform=(platform)
257
286
  @platform = platform
258
287
  end
@@ -313,13 +342,13 @@ module TestCentricity
313
342
  report_header = "\n<b><u>TEST ENVIRONMENT</u>:</b> #{ENV['TEST_ENVIRONMENT']}\n"\
314
343
  " <b>Browser:</b>\t #{Environ.browser.capitalize}\n"
315
344
  report_header = "#{report_header} <b>Device:</b>\t\t #{Environ.device_name}\n" if Environ.device_name
316
- report_header = "#{report_header} <b>Device OS:</b>\t #{Environ.device_os}\n" if Environ.device_os
345
+ report_header = "#{report_header} <b>Device OS:</b>\t #{Environ.device_os} #{Environ.device_os_version}\n" if Environ.device_os
317
346
  report_header = "#{report_header} <b>Device type:</b>\t #{Environ.device_type}\n" if Environ.device_type
318
347
  report_header = "#{report_header} <b>Driver:</b>\t\t #{Environ.driver}\n" if Environ.driver
319
348
  report_header = "#{report_header} <b>Grid:</b>\t\t #{Environ.grid}\n" if Environ.grid
320
349
  report_header = "#{report_header} <b>OS:</b>\t\t\t #{Environ.os}\n" if Environ.os
321
- report_header = "#{report_header} <b>Locale:</b>\t\t #{ENV['LOCALE']}\n" if ENV['LOCALE']
322
- report_header = "#{report_header} <b>Language:</b>\t #{ENV['LANGUAGE']}\n" if ENV['LANGUAGE']
350
+ report_header = "#{report_header} <b>Locale:</b>\t\t #{Environ.locale}\n" if Environ.locale
351
+ report_header = "#{report_header} <b>Language:</b>\t #{Environ.language}\n" if Environ.language
323
352
  report_header = "#{report_header} <b>Country:</b>\t #{ENV['COUNTRY']}\n" if ENV['COUNTRY']
324
353
  report_header = "#{report_header} <b>WCAG Accessibility Standard:</b>\t #{ENV['ACCESSIBILITY_STANDARD']}\n" if ENV['ACCESSIBILITY_STANDARD']
325
354
  "#{report_header}\n\n"
@@ -34,6 +34,10 @@ class String
34
34
  end
35
35
  end
36
36
 
37
+ def titlecase
38
+ "#{self.split.each{ |text| text.capitalize! }.join(' ')}"
39
+ end
40
+
37
41
  def is_int?
38
42
  Integer(self) && true rescue false
39
43
  end
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '3.2.24'
2
+ VERSION = '3.2.25'
3
3
  end
@@ -127,18 +127,19 @@ module TestCentricity
127
127
  def self.initialize_appium
128
128
  Environ.platform = :mobile
129
129
  Environ.device_name = ENV['APP_DEVICE']
130
- Environ.device_os = ENV['APP_PLATFORM_NAME']
130
+ Environ.device_os = ENV['APP_PLATFORM_NAME'].downcase.to_sym
131
131
  Environ.device_type = ENV['DEVICE_TYPE'] if ENV['DEVICE_TYPE']
132
+ Environ.device_os_version = ENV['APP_VERSION']
132
133
  Environ.device_orientation = ENV['ORIENTATION'] if ENV['ORIENTATION']
133
134
  Capybara.default_driver = :appium
134
135
  endpoint = 'http://localhost:4723/wd/hub'
135
136
  desired_capabilities = {
136
- platformName: ENV['APP_PLATFORM_NAME'],
137
- platformVersion: ENV['APP_VERSION'],
137
+ platformName: Environ.device_os,
138
+ platformVersion: Environ.device_os_version,
138
139
  browserName: ENV['APP_BROWSER'],
139
- deviceName: ENV['APP_DEVICE']
140
+ deviceName: Environ.device_name
140
141
  }
141
- desired_capabilities[:avd] = ENV['APP_DEVICE'] if ENV['APP_PLATFORM_NAME'].downcase.to_sym == :android
142
+ desired_capabilities[:avd] = ENV['APP_DEVICE'] if Environ.device_os == :android
142
143
  desired_capabilities[:automationName] = ENV['AUTOMATION_ENGINE'] if ENV['AUTOMATION_ENGINE']
143
144
  if ENV['UDID']
144
145
  Environ.device = :device
@@ -148,30 +149,45 @@ module TestCentricity
148
149
  desired_capabilities[:xcodeSigningId] = ENV['TEAM_NAME'] if ENV['TEAM_NAME']
149
150
  else
150
151
  Environ.device = :simulator
151
- desired_capabilities[:orientation] = ENV['ORIENTATION'].upcase if ENV['ORIENTATION']
152
+ desired_capabilities[:orientation] = Environ.device_orientation.upcase if Environ.device_orientation
152
153
  if Environ.device_os == :ios
153
- desired_capabilities[:language] = ENV['LANGUAGE'] if ENV['LANGUAGE']
154
- desired_capabilities[:locale] = ENV['LOCALE'].gsub('-', '_') if ENV['LOCALE']
154
+ desired_capabilities[:language] = Environ.language if Environ.language
155
+ desired_capabilities[:locale] = Environ.locale.gsub('-', '_') if Environ.locale
155
156
  end
156
157
  end
157
158
  desired_capabilities[:safariIgnoreFraudWarning] = ENV['APP_IGNORE_FRAUD_WARNING'] if ENV['APP_IGNORE_FRAUD_WARNING']
158
159
  desired_capabilities[:safariInitialUrl] = ENV['APP_INITIAL_URL'] if ENV['APP_INITIAL_URL']
159
160
  desired_capabilities[:safariAllowPopups] = ENV['APP_ALLOW_POPUPS'] if ENV['APP_ALLOW_POPUPS']
161
+
162
+ desired_capabilities[:autoAcceptAlerts] = ENV['AUTO_ACCEPT_ALERTS'] if ENV['AUTO_ACCEPT_ALERTS']
163
+ desired_capabilities[:autoDismissAlerts] = ENV['AUTO_DISMISS_ALERTS'] if ENV['AUTO_DISMISS_ALERTS']
164
+ desired_capabilities[:isHeadless] = ENV['HEADLESS'] if ENV['HEADLESS']
165
+
160
166
  desired_capabilities[:newCommandTimeout] = ENV['NEW_COMMAND_TIMEOUT'] if ENV['NEW_COMMAND_TIMEOUT']
161
167
  desired_capabilities[:noReset] = ENV['APP_NO_RESET'] if ENV['APP_NO_RESET']
162
168
  desired_capabilities[:fullReset] = ENV['APP_FULL_RESET'] if ENV['APP_FULL_RESET']
163
169
  desired_capabilities[:webkitDebugProxyPort] = ENV['WEBKIT_DEBUG_PROXY_PORT'] if ENV['WEBKIT_DEBUG_PROXY_PORT']
164
170
  desired_capabilities[:webDriverAgentUrl] = ENV['WEBDRIVER_AGENT_URL'] if ENV['WEBDRIVER_AGENT_URL']
165
- desired_capabilities[:wdaLocalPort] = ENV['WDA_LOCAL_PORT'] if ENV['WDA_LOCAL_PORT']
166
171
  desired_capabilities[:usePrebuiltWDA] = ENV['USE_PREBUILT_WDA'] if ENV['USE_PREBUILT_WDA']
167
172
  desired_capabilities[:useNewWDA] = ENV['USE_NEW_WDA'] if ENV['USE_NEW_WDA']
168
173
  desired_capabilities[:chromedriverExecutable] = ENV['CHROMEDRIVER_EXECUTABLE'] if ENV['CHROMEDRIVER_EXECUTABLE']
174
+ # set wdaLocalPort (iOS) or systemPort (Android) if PARALLEL_PORT is true
175
+ if ENV['PARALLEL'] && ENV['PARALLEL_PORT']
176
+ if Environ.device_os == :ios
177
+ desired_capabilities[:wdaLocalPort] = 8100 + ENV['TEST_ENV_NUMBER'].to_i
178
+ else
179
+ desired_capabilities[:systemPort] = 8200 + ENV['TEST_ENV_NUMBER'].to_i
180
+ end
181
+ else
182
+ desired_capabilities[:wdaLocalPort] = ENV['WDA_LOCAL_PORT'] if ENV['WDA_LOCAL_PORT']
183
+ desired_capabilities[:systemPort] = ENV['SYSTEM_PORT'] if ENV['SYSTEM_PORT']
184
+ end
169
185
 
170
186
  Capybara.register_driver :appium do |app|
171
187
  appium_lib_options = { server_url: endpoint }
172
188
  all_options = {
173
- appium_lib: appium_lib_options,
174
- caps: desired_capabilities
189
+ appium_lib: appium_lib_options,
190
+ caps: desired_capabilities
175
191
  }
176
192
  Appium::Capybara::Driver.new app, all_options
177
193
  end
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: 3.2.24
4
+ version: 3.2.25
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: 2021-02-23 00:00:00.000000000 Z
11
+ date: 2021-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler