testcentricity_web 2.3.11 → 2.3.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -1
  3. data/lib/testcentricity_web.rb +22 -21
  4. data/lib/testcentricity_web/environment.rb +41 -12
  5. data/lib/testcentricity_web/version.rb +1 -1
  6. data/lib/testcentricity_web/{elements → web_elements}/button.rb +0 -0
  7. data/lib/testcentricity_web/{elements → web_elements}/cell_button.rb +0 -0
  8. data/lib/testcentricity_web/{elements → web_elements}/cell_checkbox.rb +0 -0
  9. data/lib/testcentricity_web/{elements → web_elements}/cell_element.rb +0 -0
  10. data/lib/testcentricity_web/{elements → web_elements}/cell_image.rb +0 -0
  11. data/lib/testcentricity_web/{elements → web_elements}/cell_radio.rb +0 -0
  12. data/lib/testcentricity_web/{elements → web_elements}/checkbox.rb +0 -0
  13. data/lib/testcentricity_web/{elements → web_elements}/file_field.rb +0 -0
  14. data/lib/testcentricity_web/{elements → web_elements}/image.rb +0 -0
  15. data/lib/testcentricity_web/{elements → web_elements}/label.rb +0 -0
  16. data/lib/testcentricity_web/{elements → web_elements}/link.rb +0 -0
  17. data/lib/testcentricity_web/{elements → web_elements}/list.rb +0 -0
  18. data/lib/testcentricity_web/{elements → web_elements}/list_button.rb +0 -0
  19. data/lib/testcentricity_web/{elements → web_elements}/list_checkbox.rb +0 -0
  20. data/lib/testcentricity_web/{elements → web_elements}/list_element.rb +0 -0
  21. data/lib/testcentricity_web/{elements → web_elements}/list_radio.rb +0 -0
  22. data/lib/testcentricity_web/{elements → web_elements}/radio.rb +0 -0
  23. data/lib/testcentricity_web/{elements → web_elements}/select_list.rb +0 -0
  24. data/lib/testcentricity_web/{elements → web_elements}/table.rb +0 -0
  25. data/lib/testcentricity_web/{elements → web_elements}/textfield.rb +0 -0
  26. data/lib/testcentricity_web/{ui_elements_helper.rb → web_elements/ui_elements_helper.rb} +0 -0
  27. data/lib/testcentricity_web/webdriver_helper.rb +23 -19
  28. data/testcentricity_web.gemspec +2 -2
  29. metadata +26 -26
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f0ebd3e074d6ef9f3e21157cac9312d5f5799298
4
- data.tar.gz: 00a6defd472904a934af381489f1195d26fd19a4
3
+ metadata.gz: 982d0553ec5b4a2185dfb9d4765c68effda6f086
4
+ data.tar.gz: e6a5ebd02a02ff05e0e4915423d6d79b36683958
5
5
  SHA512:
6
- metadata.gz: 755b085367196a0c0e6edf1c41411019eb6d15faaec8ed532278a9afcd400adbafdccd42210d415314b111b43f39dbdeb9241a91579a37bbf796ea369511b6b8
7
- data.tar.gz: c9e5c47fc5b5f69873434485bb3b39e7593399de0268c8bed4e9a4992e4bad06ec1c2fc40c6341b4b7a3dc6bba069f0206552a5e48da0e08b2af4ede72012680
6
+ metadata.gz: f6f7cec00a765749ad9a93be59cd64a24ed98f2a701de6960b927a5a5944a0330e11c1227adb417964dc50d7de71e81af7ab8d10f4137a870944972edb4284e5
7
+ data.tar.gz: 612f51617b5e5ab74e01051a11a11c57442cde08a305e335c752d5535961947bd1a8d694e145ba01207269b12f9d7095b8ded384520daed97a3d08470dd7d5f8
data/README.md CHANGED
@@ -28,10 +28,14 @@ hosted instances of Chrome, Firefox, Safari, and IE web browsers.
28
28
 
29
29
 
30
30
  ## What's New
31
+ ###Version 2.3.12
32
+
33
+ * Added `Environ.is_simulator?` and `Environ.is_web?` methods.
34
+
31
35
  ###Version 2.3.11
32
36
 
33
37
  * Added support for running tests in Mobile Safari browser on physical iOS devices.
34
- * Updated device profiles for iPhone 7 (iOS 10) with Mobile Firefox browser and iPad (iOS 10) with Mobile Firefox browser
38
+ * Updated device profiles for iPhone 7 (iOS 10) with Mobile Firefox browser and iPad (iOS 10) with Mobile Firefox browser.
35
39
 
36
40
  ###Version 2.3.10
37
41
 
@@ -11,32 +11,33 @@ require 'testcentricity_web/exception_queue_helper'
11
11
  require 'testcentricity_web/page_objects_helper'
12
12
  require 'testcentricity_web/page_sections_helper'
13
13
  require 'testcentricity_web/siebel_open_ui_helper'
14
- require 'testcentricity_web/ui_elements_helper'
15
14
  require 'testcentricity_web/utility_helpers'
16
15
  require 'testcentricity_web/environment'
17
16
  require 'testcentricity_web/webdriver_helper'
18
17
  require 'testcentricity_web/version'
19
18
 
20
- require 'testcentricity_web/elements/button'
21
- require 'testcentricity_web/elements/checkbox'
22
- require 'testcentricity_web/elements/file_field'
23
- require 'testcentricity_web/elements/image'
24
- require 'testcentricity_web/elements/label'
25
- require 'testcentricity_web/elements/link'
26
- require 'testcentricity_web/elements/radio'
27
- require 'testcentricity_web/elements/select_list'
28
- require 'testcentricity_web/elements/list'
29
- require 'testcentricity_web/elements/table'
30
- require 'testcentricity_web/elements/textfield'
31
- require 'testcentricity_web/elements/cell_element'
32
- require 'testcentricity_web/elements/cell_button'
33
- require 'testcentricity_web/elements/cell_checkbox'
34
- require 'testcentricity_web/elements/cell_radio'
35
- require 'testcentricity_web/elements/cell_image'
36
- require 'testcentricity_web/elements/list_element'
37
- require 'testcentricity_web/elements/list_button'
38
- require 'testcentricity_web/elements/list_checkbox'
39
- require 'testcentricity_web/elements/list_radio'
19
+ require 'testcentricity_web/web_elements/ui_elements_helper'
20
+ require 'testcentricity_web/web_elements/button'
21
+ require 'testcentricity_web/web_elements/checkbox'
22
+ require 'testcentricity_web/web_elements/file_field'
23
+ require 'testcentricity_web/web_elements/image'
24
+ require 'testcentricity_web/web_elements/label'
25
+ require 'testcentricity_web/web_elements/link'
26
+ require 'testcentricity_web/web_elements/radio'
27
+ require 'testcentricity_web/web_elements/select_list'
28
+ require 'testcentricity_web/web_elements/list'
29
+ require 'testcentricity_web/web_elements/table'
30
+ require 'testcentricity_web/web_elements/textfield'
31
+ require 'testcentricity_web/web_elements/cell_element'
32
+ require 'testcentricity_web/web_elements/cell_button'
33
+ require 'testcentricity_web/web_elements/cell_checkbox'
34
+ require 'testcentricity_web/web_elements/cell_radio'
35
+ require 'testcentricity_web/web_elements/cell_image'
36
+ require 'testcentricity_web/web_elements/list_element'
37
+ require 'testcentricity_web/web_elements/list_button'
38
+ require 'testcentricity_web/web_elements/list_checkbox'
39
+ require 'testcentricity_web/web_elements/list_radio'
40
+
40
41
 
41
42
  module TestCentricity
42
43
  class PageManager
@@ -37,6 +37,7 @@ module TestCentricity
37
37
  attr_accessor :device_os
38
38
  attr_accessor :device_orientation
39
39
  attr_accessor :platform
40
+ attr_accessor :driver
40
41
  attr_accessor :tunneling
41
42
 
42
43
  attr_accessor :signed_in
@@ -57,17 +58,17 @@ module TestCentricity
57
58
  attr_accessor :db_password
58
59
 
59
60
  def initialize(data)
60
- @protocol = data['PROTOCOL']
61
- @hostname = data['HOST_NAME']
62
- @base_url = data['BASE_URL']
63
- @user_id = data['USER_ID']
64
- @password = data['PASSWORD']
65
- @append = data['APPEND']
66
- @option1 = data['OPTIONAL_1']
67
- @option2 = data['OPTIONAL_2']
68
- @dns = data['DNS']
69
- @db_username = data['DB_USERNAME']
70
- @db_password = data['DB_PASSWORD']
61
+ @protocol = data['PROTOCOL']
62
+ @hostname = data['HOST_NAME']
63
+ @base_url = data['BASE_URL']
64
+ @user_id = data['USER_ID']
65
+ @password = data['PASSWORD']
66
+ @append = data['APPEND']
67
+ @option1 = data['OPTIONAL_1']
68
+ @option2 = data['OPTIONAL_2']
69
+ @dns = data['DNS']
70
+ @db_username = data['DB_USERNAME']
71
+ @db_password = data['DB_PASSWORD']
71
72
  super
72
73
  end
73
74
 
@@ -149,10 +150,22 @@ module TestCentricity
149
150
  @device = device
150
151
  end
151
152
 
152
- def self.is_device?
153
+ def self.device
153
154
  @device
154
155
  end
155
156
 
157
+ def self.is_device?
158
+ @device == :device
159
+ end
160
+
161
+ def self.is_simulator?
162
+ @device == :simulator
163
+ end
164
+
165
+ def self.is_web?
166
+ @device == :web
167
+ end
168
+
156
169
  # @deprecated Please use {#device_type=} instead
157
170
  def self.set_device_type(type)
158
171
  warn "[DEPRECATION] 'TestCentricity::Environ.set_device_type' is deprecated. Please use 'Environ.device_type =' instead."
@@ -183,6 +196,14 @@ module TestCentricity
183
196
  @device_os
184
197
  end
185
198
 
199
+ def self.is_ios?
200
+ @device_os == :ios
201
+ end
202
+
203
+ def self.is_android?
204
+ @device_os == :android
205
+ end
206
+
186
207
  def self.device_orientation=(orientation)
187
208
  @device_orientation = orientation.downcase.to_sym
188
209
  end
@@ -191,6 +212,14 @@ module TestCentricity
191
212
  @device_orientation
192
213
  end
193
214
 
215
+ def self.driver=(type)
216
+ @driver = type
217
+ end
218
+
219
+ def self.driver
220
+ @driver
221
+ end
222
+
194
223
  def self.tunneling=(state)
195
224
  @tunneling = state
196
225
  end
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '2.3.11'
2
+ VERSION = '2.3.12'
3
3
  end
@@ -15,9 +15,10 @@ module TestCentricity
15
15
  browser = ENV['WEB_BROWSER']
16
16
 
17
17
  # assume that we're testing within a local desktop web browser
18
+ Environ.driver = :webdriver
18
19
  Environ.platform = :desktop
19
20
  Environ.browser = browser
20
- Environ.device = false
21
+ Environ.device = :web
21
22
  Environ.device_name = 'browser'
22
23
 
23
24
  case browser.downcase.to_sym
@@ -166,7 +167,6 @@ module TestCentricity
166
167
  private
167
168
 
168
169
  def self.initialize_appium
169
- Environ.device = true
170
170
  Environ.platform = :mobile
171
171
  Environ.device_name = ENV['APP_DEVICE']
172
172
  Environ.device_os = ENV['APP_PLATFORM_NAME']
@@ -180,21 +180,24 @@ module TestCentricity
180
180
  browserName: ENV['APP_BROWSER'],
181
181
  deviceName: ENV['APP_DEVICE']
182
182
  }
183
- desired_capabilities['avd'] = ENV['APP_DEVICE'] if ENV['APP_PLATFORM_NAME'].downcase.to_sym == :android
184
- desired_capabilities['automationName'] = ENV['AUTOMATION_ENGINE'] if ENV['AUTOMATION_ENGINE']
185
- desired_capabilities['orientation'] = ENV['ORIENTATION'].upcase if ENV['ORIENTATION']
186
- if ENV['APP_UDID']
187
- desired_capabilities['udid'] = ENV['APP_UDID']
188
- desired_capabilities['startIWDP'] = true
189
- desired_capabilities['xcodeOrgId'] = ENV['TEAM_ID']
190
- desired_capabilities['xcodeSigningId'] = ENV['TEAM_NAME']
183
+ desired_capabilities[:avd] = ENV['APP_DEVICE'] if ENV['APP_PLATFORM_NAME'].downcase.to_sym == :android
184
+ desired_capabilities[:automationName] = ENV['AUTOMATION_ENGINE'] if ENV['AUTOMATION_ENGINE']
185
+ desired_capabilities[:orientation] = ENV['ORIENTATION'].upcase if ENV['ORIENTATION']
186
+ if ENV['UDID']
187
+ Environ.device = :device
188
+ desired_capabilities[:udid] = ENV['UDID']
189
+ desired_capabilities[:startIWDP] = true
190
+ desired_capabilities[:xcodeOrgId] = ENV['TEAM_ID'] if ENV['TEAM_ID']
191
+ desired_capabilities[:xcodeSigningId] = ENV['TEAM_NAME'] if ENV['TEAM_NAME']
192
+ else
193
+ Environ.device = :simulator
191
194
  end
192
- desired_capabilities['safariInitialUrl'] = ENV['APP_INITIAL_URL'] if ENV['APP_INITIAL_URL']
193
- desired_capabilities['safariAllowPopups'] = ENV['APP_ALLOW_POPUPS'] if ENV['APP_ALLOW_POPUPS']
194
- desired_capabilities['safariIgnoreFraudWarning'] = ENV['APP_IGNORE_FRAUD_WARNING'] if ENV['APP_IGNORE_FRAUD_WARNING']
195
- desired_capabilities['noReset'] = ENV['APP_NO_RESET'] if ENV['APP_NO_RESET']
196
- desired_capabilities['language'] = ENV['LANGUAGE'] if ENV['LANGUAGE']
197
- desired_capabilities['locale'] = ENV['LOCALE'].gsub('-', '_') if ENV['LOCALE']
195
+ desired_capabilities[:safariInitialUrl] = ENV['APP_INITIAL_URL'] if ENV['APP_INITIAL_URL']
196
+ desired_capabilities[:safariAllowPopups] = ENV['APP_ALLOW_POPUPS'] if ENV['APP_ALLOW_POPUPS']
197
+ desired_capabilities[:safariIgnoreFraudWarning] = ENV['APP_IGNORE_FRAUD_WARNING'] if ENV['APP_IGNORE_FRAUD_WARNING']
198
+ desired_capabilities[:noReset] = ENV['APP_NO_RESET'] if ENV['APP_NO_RESET']
199
+ desired_capabilities[:language] = ENV['LANGUAGE'] if ENV['LANGUAGE']
200
+ desired_capabilities[:locale] = ENV['LOCALE'].gsub('-', '_') if ENV['LOCALE']
198
201
 
199
202
  Capybara.register_driver :appium do |app|
200
203
  appium_lib_options = { server_url: endpoint }
@@ -332,7 +335,6 @@ module TestCentricity
332
335
 
333
336
  if ENV['BS_REAL_MOBILE'] || ENV['BS_PLATFORM']
334
337
  Environ.platform = :mobile
335
- Environ.device = true
336
338
  Environ.device_name = ENV['BS_DEVICE']
337
339
  Environ.device_os = ENV['BS_OS']
338
340
  Environ.device_orientation = ENV['ORIENTATION'] if ENV['ORIENTATION']
@@ -345,11 +347,13 @@ module TestCentricity
345
347
  capabilities = Selenium::WebDriver::Remote::Capabilities.new
346
348
 
347
349
  if ENV['BS_REAL_MOBILE']
350
+ Environ.device = :device
348
351
  capabilities['device'] = ENV['BS_DEVICE']
349
352
  capabilities['realMobile'] = true
350
353
  capabilities['os_version'] = ENV['BS_OS_VERSION']
351
354
 
352
355
  elsif ENV['BS_PLATFORM']
356
+ Environ.device = :simulator
353
357
  capabilities[:platform] = ENV['BS_PLATFORM']
354
358
  capabilities[:browserName] = browser
355
359
  capabilities['device'] = ENV['BS_DEVICE'] if ENV['BS_DEVICE']
@@ -425,7 +429,7 @@ module TestCentricity
425
429
  Environ.platform = :desktop
426
430
  elsif ENV['CB_PLATFORM']
427
431
  Environ.device_name = ENV['CB_PLATFORM']
428
- Environ.device = true
432
+ Environ.device = :device
429
433
  Environ.platform = :mobile
430
434
  Environ.device_type = ENV['DEVICE_TYPE'] if ENV['DEVICE_TYPE']
431
435
  end
@@ -534,7 +538,7 @@ module TestCentricity
534
538
  end
535
539
  Environ.device_os = ENV['TB_PLATFORM']
536
540
  Environ.device_name = ENV['TB_DEVICE']
537
- Environ.device = true
541
+ Environ.device = :device
538
542
  Environ.platform = :mobile
539
543
  Environ.device_type = ENV['DEVICE_TYPE'] if ENV['DEVICE_TYPE']
540
544
  else
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
7
7
  spec.name = 'testcentricity_web'
8
8
  spec.version = TestCentricityWeb::VERSION
9
9
  spec.platform = Gem::Platform::RUBY
10
- spec.required_ruby_version = '>= 2.1.1'
10
+ spec.required_ruby_version = '>= 2.3.0'
11
11
  spec.authors = ['A.J. Mrozinski']
12
12
  spec.email = ['testcentricity@gmail.com']
13
13
  spec.summary = %q{A Page Object and Data Object Model Framework for desktop and mobile web testing}
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  OS X), mobile Chrome or Android browsers on Android Studio virtual device emulators (using Appium and Android Studio on OS X),
21
21
  or cloud hosted desktop or mobile web browsers (using the BrowserStack, Sauce Labs, CrossBrowserTesting, or TestingBot services).}
22
22
  spec.homepage = ''
23
- spec.license = 'BSD3'
23
+ spec.license = 'BSD-3-Clause-Clear'
24
24
 
25
25
  spec.files = `git ls-files -z`.split("\x0")
26
26
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
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: 2.3.11
4
+ version: 2.3.12
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: 2018-02-02 00:00:00.000000000 Z
11
+ date: 2018-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -222,41 +222,41 @@ files:
222
222
  - lib/testcentricity_web/browser_helper.rb
223
223
  - lib/testcentricity_web/data_objects_helper.rb
224
224
  - lib/testcentricity_web/drag_drop_helper.rb
225
- - lib/testcentricity_web/elements/button.rb
226
- - lib/testcentricity_web/elements/cell_button.rb
227
- - lib/testcentricity_web/elements/cell_checkbox.rb
228
- - lib/testcentricity_web/elements/cell_element.rb
229
- - lib/testcentricity_web/elements/cell_image.rb
230
- - lib/testcentricity_web/elements/cell_radio.rb
231
- - lib/testcentricity_web/elements/checkbox.rb
232
- - lib/testcentricity_web/elements/file_field.rb
233
- - lib/testcentricity_web/elements/image.rb
234
- - lib/testcentricity_web/elements/label.rb
235
- - lib/testcentricity_web/elements/link.rb
236
- - lib/testcentricity_web/elements/list.rb
237
- - lib/testcentricity_web/elements/list_button.rb
238
- - lib/testcentricity_web/elements/list_checkbox.rb
239
- - lib/testcentricity_web/elements/list_element.rb
240
- - lib/testcentricity_web/elements/list_radio.rb
241
- - lib/testcentricity_web/elements/radio.rb
242
- - lib/testcentricity_web/elements/select_list.rb
243
- - lib/testcentricity_web/elements/table.rb
244
- - lib/testcentricity_web/elements/textfield.rb
245
225
  - lib/testcentricity_web/environment.rb
246
226
  - lib/testcentricity_web/excel_helper.rb
247
227
  - lib/testcentricity_web/exception_queue_helper.rb
248
228
  - lib/testcentricity_web/page_objects_helper.rb
249
229
  - lib/testcentricity_web/page_sections_helper.rb
250
230
  - lib/testcentricity_web/siebel_open_ui_helper.rb
251
- - lib/testcentricity_web/ui_elements_helper.rb
252
231
  - lib/testcentricity_web/utility_helpers.rb
253
232
  - lib/testcentricity_web/version.rb
233
+ - lib/testcentricity_web/web_elements/button.rb
234
+ - lib/testcentricity_web/web_elements/cell_button.rb
235
+ - lib/testcentricity_web/web_elements/cell_checkbox.rb
236
+ - lib/testcentricity_web/web_elements/cell_element.rb
237
+ - lib/testcentricity_web/web_elements/cell_image.rb
238
+ - lib/testcentricity_web/web_elements/cell_radio.rb
239
+ - lib/testcentricity_web/web_elements/checkbox.rb
240
+ - lib/testcentricity_web/web_elements/file_field.rb
241
+ - lib/testcentricity_web/web_elements/image.rb
242
+ - lib/testcentricity_web/web_elements/label.rb
243
+ - lib/testcentricity_web/web_elements/link.rb
244
+ - lib/testcentricity_web/web_elements/list.rb
245
+ - lib/testcentricity_web/web_elements/list_button.rb
246
+ - lib/testcentricity_web/web_elements/list_checkbox.rb
247
+ - lib/testcentricity_web/web_elements/list_element.rb
248
+ - lib/testcentricity_web/web_elements/list_radio.rb
249
+ - lib/testcentricity_web/web_elements/radio.rb
250
+ - lib/testcentricity_web/web_elements/select_list.rb
251
+ - lib/testcentricity_web/web_elements/table.rb
252
+ - lib/testcentricity_web/web_elements/textfield.rb
253
+ - lib/testcentricity_web/web_elements/ui_elements_helper.rb
254
254
  - lib/testcentricity_web/webdriver_helper.rb
255
255
  - lib/testcentricity_web/world_extensions.rb
256
256
  - testcentricity_web.gemspec
257
257
  homepage: ''
258
258
  licenses:
259
- - BSD3
259
+ - BSD-3-Clause-Clear
260
260
  metadata: {}
261
261
  post_install_message:
262
262
  rdoc_options: []
@@ -266,7 +266,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
266
266
  requirements:
267
267
  - - ">="
268
268
  - !ruby/object:Gem::Version
269
- version: 2.1.1
269
+ version: 2.3.0
270
270
  required_rubygems_version: !ruby/object:Gem::Requirement
271
271
  requirements:
272
272
  - - ">="
@@ -275,7 +275,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
275
275
  requirements:
276
276
  - Capybara, Selenium-WebDriver
277
277
  rubyforge_project:
278
- rubygems_version: 2.5.1
278
+ rubygems_version: 2.6.14
279
279
  signing_key:
280
280
  specification_version: 4
281
281
  summary: A Page Object and Data Object Model Framework for desktop and mobile web