testcentricity_web 2.0.23 → 2.1.0

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
  SHA1:
3
- metadata.gz: 63ec2f6b0773bbe8e2225961565c2aa8dd7de8aa
4
- data.tar.gz: ba2ce39763b20736b2a25bae7896a4674003360d
3
+ metadata.gz: 449c4f5fd5eb44182009f95be69073a738d2580f
4
+ data.tar.gz: 8fdaf6943f6778d4c396f790281dd26bcf5962a7
5
5
  SHA512:
6
- metadata.gz: 615b6576addedd45fa21d8441e355285e25e0ae9ea31a27a442955015986374b30c91045e71cbce09e631fcd0a004db4175f082d49d6049ab0949981a8fbc278
7
- data.tar.gz: a083ae6997c6abb5b9572594581fbf5b31a92892a11531de55e1b63222402c79186c7538e140e17142688dd3535f2d6cee52dfadced9471efaae09b85a5fc7b9
6
+ metadata.gz: ae73029e5f1ee59f658851678dd0505ce3d6f2c9443fcfc0d8a49269155846b0d326a803e1286a60823fdc4c9ac3a800f20be2e9e7921c5e72d3989904c9bc61
7
+ data.tar.gz: 81fb0a83391716e45795a4b8e0e4dce570d9df7a0a6d2fc10811385e2d5487c540ca32b20f482d5626f7f8d2d8465861898c0ec40a755b199a5162c761fbb52a
data/README.md CHANGED
@@ -22,6 +22,25 @@ locally hosted instances of Firefox 48 or greater requires Marionette (aka gecko
22
22
  feature incomplete and potentially unstable. More information can be found [here](https://github.com/teamcapybara/capybara/issues/1710).
23
23
 
24
24
 
25
+ ## What's New
26
+
27
+ * Added device profiles for iPhone 8, iPhone 8 Plus, iPhone X devices running iOS 11
28
+ * Added device profile for iPad Pro 10.5" with iOS 11
29
+ * Updated iPhone 7 and iPhone 7 Plus profiles to iOS 10
30
+ * Updated Google Pixel and Google Pixel XL profiles to Android 8
31
+ * Added device profiles for iPhone 7 (iOS 10) with Mobile Chrome browser and iPad (iOS 10) with Mobile Chrome browser
32
+
33
+
34
+ ## What's Fixed
35
+
36
+ * The `TestCentricity::WebDriverConnect.initialize_web_driver` method now sets the `Environ` object to the correct device connection states for local and
37
+ cloud hosted browsers.
38
+ * The `TestCentricity::WebDriverConnect.initialize_web_driver` method no longer calls `initialize_browser_size` when running tests against cloud hosted
39
+ mobile web browser, which was resulting in Appium throwing exceptions for unsupported method calls.
40
+ * The `TestCentricity::WebDriverConnect.set_webdriver_path` method now correctly sets the path for Chrome webDrivers when the `HOST_BROWSER` Environment
41
+ Variable is set to `chrome`. Tests against locally hosted emulated mobile web browser running on a local instance of Chrome will now work correctly.
42
+
43
+
25
44
  ## Installation
26
45
 
27
46
  Add this line to your automation project's Gemfile:
@@ -198,14 +217,6 @@ Web pages are made up of UI elements like text fields, check boxes, combo boxes,
198
217
  button :sign_up_button, 'button#registrationSignUp'
199
218
  end
200
219
 
201
-
202
- Once your **Page Objects** have been instantiated, you can interact with the **UI Elements** in your **Page Objects**. An example is shown
203
- below:
204
-
205
- login_page.user_id_field.set('snicklefritz')
206
- login_page.password_field.set('Pa55w0rd')
207
- login_page.login_button.click
208
-
209
220
 
210
221
  ### Adding Methods to your Page Object
211
222
 
@@ -723,8 +734,10 @@ mobile web browsers, the `WEB_BROWSER` Environment Variable must be set to one o
723
734
 
724
735
  `WEB_BROWSER` | `HOST_BROWSER` | **CSS Screen Dimensions** | **Default Orientation** | **OS Version**
725
736
  ----------------------|----------------------|-----------|----------|---------
726
- `ipad` |`firefox` or `chrome` |1024 x 768 |landscape |iOS 9.1
727
- `ipad_pro` |`firefox` or `chrome` |1366 x 1024|landscape |iOS 9.1
737
+ `ipad` |`firefox` or `chrome` |1024 x 768 |landscape |iOS 10
738
+ `ipad_pro` |`firefox` or `chrome` |1366 x 1024|landscape |iOS 11
739
+ `ipad_pro_10_5` |`firefox` or `chrome` |1112 x 834 |landscape |iOS 11
740
+ `ipad_chrome` |`firefox` or `chrome` |1024 x 768 |landscape |iOS 10 - Mobile Chrome browser for iOS
728
741
  `android_tablet` |`firefox` or `chrome` |1024 x 768 |landscape |Android 3.0
729
742
  `kindle_fire` |`firefox` or `chrome` |1024 x 600 |landscape |
730
743
  `kindle_firehd7` |`firefox` or `chrome` |800 x 480 |landscape |Fire OS 3
@@ -742,10 +755,14 @@ mobile web browsers, the `WEB_BROWSER` Environment Variable must be set to one o
742
755
  `iphone6_plus` |`firefox` or `chrome` |414 x 736 |portrait |iOS 9.1
743
756
  `iphone7` |`firefox` or `chrome` |375 x 667 |portrait |iOS 10
744
757
  `iphone7_plus` |`firefox` or `chrome` |414 x 736 |portrait |iOS 10
745
- `android_phone` |`firefox` or `chrome` |320 x 480 |portrait |Android 4.0.1
746
- `nexus6` |`firefox` or `chrome` |411 x 731 |portrait |Android 6.0.1
747
- `pixel` |`firefox` or `chrome` |411 x 731 |portrait |Android 7.1
748
- `pixel_xl` |`firefox` or `chrome` |411 x 731 |portrait |Android 7.1
758
+ `iphone7_chrome` |`firefox` or `chrome` |375 x 667 |portrait |iOS 10 - Mobile Chrome browser for iOS
759
+ `iphone8` |`firefox` or `chrome` |375 x 667 |portrait |iOS 11
760
+ `iphone9_plus` |`firefox` or `chrome` |414 x 736 |portrait |iOS 11
761
+ `iphonex` |`firefox` or `chrome` |375 x 812 |portrait |iOS 11
762
+ `android_phone` |`firefox` or `chrome` |320 x 480 |portrait |Android 4
763
+ `nexus6` |`firefox` or `chrome` |411 x 731 |portrait |Android 6
764
+ `pixel` |`firefox` or `chrome` |411 x 731 |portrait |Android 8
765
+ `pixel_xl` |`firefox` or `chrome` |411 x 731 |portrait |Android 8
749
766
  `samsung_galaxy_s4` |`firefox` or `chrome` |360 x 640 |portrait |Android 5.0.1
750
767
  `samsung_galaxy_s5` |`firefox` or `chrome` |360 x 640 |portrait |Android 6.0.1
751
768
  `samsung_galaxy_s6` |`firefox` or `chrome` |360 x 640 |portrait |Android 6.0.1
@@ -826,6 +843,7 @@ for information regarding the specific capabilities.
826
843
  `WEB_BROWSER` | Must be set to `browserstack`
827
844
  `BS_USERNAME` | Must be set to your BrowserStack account user name
828
845
  `BS_AUTHKEY` | Must be set to your BrowserStack account access key
846
+ `BS_OS` | Must be set to `ios` or `android`
829
847
  `BS_BROWSER` | Must be set to `iPhone`, `iPad`, or `android`
830
848
  `BS_PLATFORM` | Must be set to `MAC` (for iOS) or `ANDROID`
831
849
  `BS_DEVICE` | Refer to `device` capability in chart
@@ -963,6 +981,8 @@ service(s) that you intend to connect with.
963
981
 
964
982
  ipad: WEB_BROWSER=ipad HOST_BROWSER=firefox <%= mobile %>
965
983
  ipad_pro: WEB_BROWSER=ipad_pro HOST_BROWSER=firefox <%= mobile %>
984
+ ipad_pro_10_5: WEB_BROWSER=ipad_pro_10_5 HOST_BROWSER=firefox <%= mobile %>
985
+ ipad_chrome: WEB_BROWSER=ipad_chrome HOST_BROWSER=firefox <%= mobile %>
966
986
  iphone: WEB_BROWSER=iphone HOST_BROWSER=firefox <%= mobile %>
967
987
  iphone4: WEB_BROWSER=iphone4 HOST_BROWSER=firefox <%= mobile %>
968
988
  iphone5: WEB_BROWSER=iphone5 HOST_BROWSER=firefox <%= mobile %>
@@ -970,6 +990,10 @@ service(s) that you intend to connect with.
970
990
  iphone6_plus: WEB_BROWSER=iphone6_plus HOST_BROWSER=firefox <%= mobile %>
971
991
  iphone7: WEB_BROWSER=iphone7 HOST_BROWSER=firefox <%= mobile %>
972
992
  iphone7_plus: WEB_BROWSER=iphone7_plus HOST_BROWSER=firefox <%= mobile %>
993
+ iphone7_chrome: WEB_BROWSER=iphone7_chrome HOST_BROWSER=firefox <%= mobile %>
994
+ iphone8: WEB_BROWSER=iphone8 HOST_BROWSER=firefox <%= mobile %>
995
+ iphone8_plus: WEB_BROWSER=iphone8_plus HOST_BROWSER=firefox <%= mobile %>
996
+ iphoneX: WEB_BROWSER=iphonex HOST_BROWSER=firefox <%= mobile %>
973
997
  android_phone: WEB_BROWSER=android_phone HOST_BROWSER=firefox <%= mobile %>
974
998
  nexus6: WEB_BROWSER=nexus6 HOST_BROWSER=firefox <%= mobile %>
975
999
  android_tablet: WEB_BROWSER=android_tablet HOST_BROWSER=firefox <%= mobile %>
@@ -1070,7 +1094,7 @@ service(s) that you intend to connect with.
1070
1094
  bs_edge_win10: --profile bs_win10 BS_BROWSER="Edge" BS_VERSION="13.0"
1071
1095
 
1072
1096
  # BrowserStack iOS mobile browser profiles
1073
- bs_iphone: --profile bs_mobile BS_PLATFORM=MAC BS_BROWSER=iPhone
1097
+ bs_iphone: --profile bs_mobile BS_PLATFORM=MAC BS_OS=ios BS_BROWSER=iPhone
1074
1098
  bs_iphone6s_plus: --profile bs_iphone BS_DEVICE="iPhone 6S Plus"
1075
1099
  bs_iphone6s: --profile bs_iphone BS_DEVICE="iPhone 6S"
1076
1100
  bs_iphone6_plus: --profile bs_iphone BS_DEVICE="iPhone 6 Plus"
@@ -1084,12 +1108,12 @@ service(s) that you intend to connect with.
1084
1108
  bs_ipad_mini: --profile bs_ipad BS_DEVICE="iPad Mini 4"
1085
1109
 
1086
1110
  # BrowserStack iOS real device mobile browser profiles
1087
- bs_iphone_device: --profile bs_mobile BS_BROWSER=iPhone BS_REAL_MOBILE="true"
1111
+ bs_iphone_device: --profile bs_mobile BS_BROWSER=iPhone BS_OS=ios BS_REAL_MOBILE="true"
1088
1112
  bs_iphone7_plus: --profile bs_iphone_device BS_DEVICE="iPhone 7 Plus"
1089
1113
  bs_iphone7: --profile bs_iphone_device BS_DEVICE="iPhone 7"
1090
1114
 
1091
1115
  # BrowserStack Android mobile browser profiles
1092
- bs_android: --profile bs_mobile BS_PLATFORM=ANDROID BS_BROWSER=android
1116
+ bs_android: --profile bs_mobile BS_PLATFORM=ANDROID BS_BROWSER=android BS_OS=android
1093
1117
  bs_galaxy_s5: --profile bs_android BS_DEVICE="Samsung Galaxy S5"
1094
1118
  bs_kindle_fire_hd89: --profile bs_android BS_DEVICE="Amazon Kindle Fire HD 8.9"
1095
1119
  bs_kindle_fire_hdx7: --profile bs_android BS_DEVICE="Amazon Kindle Fire HDX 7"
@@ -1100,8 +1124,9 @@ service(s) that you intend to connect with.
1100
1124
  bs_sony_xperia: --profile bs_android BS_DEVICE="Sony Xperia Tipo"
1101
1125
 
1102
1126
  # BrowserStack Android real device mobile browser profiles
1103
- bs_android_device: --profile bs_mobile BS_BROWSER=android BS_REAL_MOBILE="true"
1104
- bs_google_pixel: --profile bs_android_device BS_DEVICE="Google Pixel"
1127
+ bs_android_device: --profile bs_mobile BS_BROWSER=android BS_OS=android BS_REAL_MOBILE="true"
1128
+ bs_google_pixel8: --profile bs_android_device BS_DEVICE="Google Pixel" BS_OS_VERSION="8.0"
1129
+ bs_google_pixel71: --profile bs_android_device BS_DEVICE="Google Pixel" BS_OS_VERSION="7.1"
1105
1130
  bs_nexus9: --profile bs_android_device BS_DEVICE="Google Nexus 9"
1106
1131
  bs_nexus6: --profile bs_android_device BS_DEVICE="Google Nexus 6"
1107
1132
  bs_galaxy_s7: --profile bs_android_device BS_DEVICE="Samsung Galaxy S7"
@@ -39,14 +39,42 @@
39
39
  :css_width: 375
40
40
  :css_height: 667
41
41
  :default_orientation: portrait
42
- :user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Mobile/14A345 Safari/602.1"
42
+ :user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/603.1.23 (KHTML, like Gecko) Version/10.0 Mobile/14E5239e Safari/602.1"
43
43
  :iphone7_plus:
44
44
  :name: "iPhone 7 Plus"
45
45
  :os: "ios"
46
46
  :css_width: 414
47
47
  :css_height: 736
48
48
  :default_orientation: portrait
49
- :user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Mobile/14A345 Safari/602.1"
49
+ :user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/603.1.23 (KHTML, like Gecko) Version/10.0 Mobile/14E5239e Safari/602.1"
50
+ :iphone7_chrome:
51
+ :name: "iPhone 7 - Chrome"
52
+ :os: "ios"
53
+ :css_width: 375
54
+ :css_height: 667
55
+ :default_orientation: portrait
56
+ :user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/56.0.2924.75 Mobile/14E5239e Safari/602.1"
57
+ :iphone8:
58
+ :name: "iPhone 8"
59
+ :os: "ios"
60
+ :css_width: 375
61
+ :css_height: 667
62
+ :default_orientation: portrait
63
+ :user_agent: "Mozilla/5.0 (iPhone; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.25 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1"
64
+ :iphone8_plus:
65
+ :name: "iPhone 8 Plus"
66
+ :os: "ios"
67
+ :css_width: 414
68
+ :css_height: 736
69
+ :default_orientation: portrait
70
+ :user_agent: "Mozilla/5.0 (iPhone; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.25 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1"
71
+ :iphonex:
72
+ :name: "iPhone X"
73
+ :os: "ios"
74
+ :css_width: 375
75
+ :css_height: 812
76
+ :default_orientation: portrait
77
+ :user_agent: "Mozilla/5.0 (iPhone; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.25 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1"
50
78
  :android_phone:
51
79
  :name: "Generic Android phone"
52
80
  :os: "android"
@@ -88,14 +116,14 @@ nexus6:
88
116
  :css_width: 411
89
117
  :css_height: 731
90
118
  :default_orientation: portrait
91
- :user_agent: "Mozilla/5.0 (Linux; Android 7.1; Pixel Build/NAE63H; xx-xx) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/53.0.2785.134 Mobile Safari/537.36"
119
+ :user_agent: "Mozilla/5.0 (Linux; Android 8.0.0; Pixel Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.66 Mobile Safari/537.36"
92
120
  :pixel_xl:
93
121
  :name: "Google Pixel XL phone"
94
122
  :os: "android"
95
123
  :css_width: 411
96
124
  :css_height: 731
97
125
  :default_orientation: portrait
98
- :user_agent: "Mozilla/5.0 (Linux; Android 7.1; Pixel XL Build/NDE63N; xx-xx) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/54.0.2840.34 Mobile Safari/537.36"
126
+ :user_agent: "Mozilla/5.0 (Linux; Android 8.0.0; Pixel XL Build/OPR6.170623.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.116 Mobile Safari/537.36"
99
127
  :windows_phone8:
100
128
  :name: "Generic Windows 8 phone"
101
129
  :os: "windows"
@@ -130,14 +158,28 @@ nexus6:
130
158
  :css_width: 1024
131
159
  :css_height: 768
132
160
  :default_orientation: landscape
133
- :user_agent: "Mozilla/5.0 (iPad; CPU OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/3B143 Safari/601.1"
161
+ :user_agent: "Mozilla/5.0 (iPad; CPU OS 10_3 like Mac OS X) AppleWebKit/603.1.23 (KHTML, like Gecko) Version/10.0 Mobile/14E5239e Safari/602.1"
134
162
  :ipad_pro:
135
163
  :name: "iPad Pro"
136
164
  :os: "ios"
137
165
  :css_width: 1366
138
166
  :css_height: 1024
139
167
  :default_orientation: landscape
140
- :user_agent: "Mozilla/5.0 (iPad; CPU OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B137 Safari/601.1"
168
+ :user_agent: "Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.25 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1"
169
+ :ipad_pro_10_5:
170
+ :name: "iPad Pro 10.5 in."
171
+ :os: "ios"
172
+ :css_width: 1112
173
+ :css_height: 834
174
+ :default_orientation: landscape
175
+ :user_agent: "Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.25 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1"
176
+ :ipad_chrome:
177
+ :name: "iPad - Chrome"
178
+ :os: "ios"
179
+ :css_width: 1024
180
+ :css_height: 768
181
+ :default_orientation: landscape
182
+ :user_agent: "Mozilla/5.0 (iPad; CPU OS 10_3 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/56.0.2924.75 Mobile/14E5239e Safari/602.1"
141
183
  :android_tablet:
142
184
  :name: "Generic Android tablet"
143
185
  :os: "android"
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '2.0.23'
2
+ VERSION = '2.1.0'
3
3
  end
@@ -83,6 +83,15 @@ module TestCentricity
83
83
  when :edge
84
84
  path_to_driver = 'windows/MicrosoftWebDriver.exe'
85
85
  Selenium::WebDriver::Edge.driver_path = File.join(project_path, base_path, path_to_driver)
86
+ else
87
+ if ENV['HOST_BROWSER'] && ENV['HOST_BROWSER'].downcase.to_sym == :chrome
88
+ if OS.osx?
89
+ path_to_driver = 'mac/chromedriver'
90
+ elsif OS.windows?
91
+ path_to_driver = 'windows/chromedriver.exe'
92
+ end
93
+ Selenium::WebDriver::Chrome.driver_path = File.join(project_path, base_path, path_to_driver)
94
+ end
86
95
  end
87
96
  puts "The webdriver path is: #{File.join(project_path, base_path, path_to_driver)}" unless path_to_driver.nil?
88
97
  end
@@ -123,7 +132,22 @@ module TestCentricity
123
132
  end
124
133
 
125
134
  def self.initialize_local_browser
135
+ if OS.osx?
136
+ Environ.os = 'OS X'
137
+ elsif OS.windows?
138
+ Environ.os = 'Windows'
139
+ end
140
+
126
141
  browser = ENV['WEB_BROWSER']
142
+
143
+ case browser.downcase.to_sym
144
+ when :firefox, :chrome, :ie, :safari, :edge
145
+ Environ.platform = :desktop
146
+ else
147
+ Environ.platform = :mobile
148
+ Environ.device_type = Browsers.mobile_device_name(browser)
149
+ end
150
+
127
151
  Capybara.default_driver = :selenium
128
152
  Capybara.register_driver :selenium do |app|
129
153
  case browser.downcase.to_sym
@@ -131,8 +155,6 @@ module TestCentricity
131
155
  Capybara::Selenium::Driver.new(app, :browser => browser.to_sym)
132
156
  else
133
157
  user_agent = Browsers.mobile_device_agent(browser)
134
- Environ.platform = :mobile
135
- Environ.device_type = Browsers.mobile_device_name(browser)
136
158
  ENV['HOST_BROWSER'] ? host_browser = ENV['HOST_BROWSER'].downcase.to_sym : host_browser = :firefox
137
159
  case host_browser
138
160
  when :firefox
@@ -151,32 +173,38 @@ module TestCentricity
151
173
  def self.initialize_browserstack
152
174
  browser = ENV['BS_BROWSER']
153
175
 
176
+ if ENV['BS_REAL_MOBILE'] || ENV['BS_PLATFORM']
177
+ Environ.platform = :mobile
178
+ Environ.device = true
179
+ Environ.device_type = ENV['BS_DEVICE']
180
+ Environ.device_os = ENV['BS_OS']
181
+ Environ.device_orientation = ENV['ORIENTATION'] if ENV['ORIENTATION']
182
+
183
+ elsif ENV['BS_OS']
184
+ Environ.os = "#{ENV['BS_OS']} #{ENV['BS_OS_VERSION']}"
185
+ end
186
+
154
187
  endpoint = "http://#{ENV['BS_USERNAME']}:#{ENV['BS_AUTHKEY']}@hub-cloud.browserstack.com/wd/hub"
155
188
  Capybara.register_driver :browserstack do |app|
156
189
  capabilities = Selenium::WebDriver::Remote::Capabilities.new
157
190
 
158
- if ENV['BS_OS']
159
- capabilities['os'] = ENV['BS_OS']
191
+ if ENV['BS_REAL_MOBILE']
192
+ capabilities['device'] = ENV['BS_DEVICE']
193
+ capabilities['realMobile'] = true
160
194
  capabilities['os_version'] = ENV['BS_OS_VERSION']
161
- Environ.os = "#{ENV['BS_OS']} #{ENV['BS_OS_VERSION']}"
162
- capabilities['browser'] = browser || 'chrome'
163
- capabilities['browser_version'] = ENV['BS_VERSION'] if ENV['BS_VERSION']
164
- capabilities['resolution'] = ENV['RESOLUTION'] if ENV['RESOLUTION']
195
+
165
196
  elsif ENV['BS_PLATFORM']
166
197
  capabilities[:platform] = ENV['BS_PLATFORM']
167
198
  capabilities[:browserName] = browser
168
199
  capabilities['device'] = ENV['BS_DEVICE'] if ENV['BS_DEVICE']
169
- Environ.platform = :mobile
170
- Environ.device = true
171
- Environ.device_type = ENV['BS_DEVICE']
172
- Environ.device_orientation = ENV['ORIENTATION'] if ENV['ORIENTATION']
173
200
  capabilities['deviceOrientation'] = ENV['ORIENTATION'] if ENV['ORIENTATION']
174
- elsif ENV['BS_REAL_MOBILE']
175
- capabilities['device'] = ENV['BS_DEVICE']
176
- capabilities['realMobile'] = true
177
- Environ.platform = :mobile
178
- Environ.device = true
179
- Environ.device_type = ENV['BS_DEVICE']
201
+
202
+ elsif ENV['BS_OS']
203
+ capabilities['os'] = ENV['BS_OS']
204
+ capabilities['os_version'] = ENV['BS_OS_VERSION']
205
+ capabilities['browser'] = browser || 'chrome'
206
+ capabilities['browser_version'] = ENV['BS_VERSION'] if ENV['BS_VERSION']
207
+ capabilities['resolution'] = ENV['RESOLUTION'] if ENV['RESOLUTION']
180
208
  end
181
209
 
182
210
  capabilities['browserstack.timezone'] = ENV['TIME_ZONE'] if ENV['TIME_ZONE']
@@ -222,6 +250,15 @@ module TestCentricity
222
250
  def self.initialize_crossbrowser
223
251
  browser = ENV['CB_BROWSER']
224
252
 
253
+ if ENV['CB_OS']
254
+ Environ.os = ENV['CB_OS']
255
+ Environ.platform = :desktop
256
+ elsif ENV['CB_PLATFORM']
257
+ Environ.device_type = ENV['CB_PLATFORM']
258
+ Environ.device = true
259
+ Environ.platform = :mobile
260
+ end
261
+
225
262
  endpoint = "http://#{ENV['CB_USERNAME']}:#{ENV['CB_AUTHKEY']}@hub.crossbrowsertesting.com:80/wd/hub"
226
263
  Capybara.register_driver :crossbrowser do |app|
227
264
  capabilities = Selenium::WebDriver::Remote::Capabilities.new
@@ -234,9 +271,6 @@ module TestCentricity
234
271
  Environ.platform = :desktop
235
272
  elsif ENV['CB_PLATFORM']
236
273
  capabilities['os_api_name'] = ENV['CB_PLATFORM']
237
- Environ.device_type = ENV['CB_PLATFORM']
238
- Environ.device = true
239
- Environ.platform = :mobile
240
274
  end
241
275
  Capybara::Selenium::Driver.new(app, :browser => :remote, :url => endpoint, :desired_capabilities => capabilities)
242
276
  end
@@ -284,6 +318,14 @@ module TestCentricity
284
318
  def self.initialize_saucelabs
285
319
  browser = ENV['SL_BROWSER']
286
320
 
321
+ if ENV['SL_OS']
322
+ Environ.platform = :desktop
323
+ Environ.os = ENV['SL_OS']
324
+ elsif ENV['SL_PLATFORM']
325
+ Environ.device_type = ENV['SL_DEVICE']
326
+ Environ.platform = :mobile
327
+ end
328
+
287
329
  endpoint = "http://#{ENV['SL_USERNAME']}:#{ENV['SL_AUTHKEY']}@ondemand.saucelabs.com:80/wd/hub"
288
330
  Capybara.register_driver :saucelabs do |app|
289
331
  capabilities = Selenium::WebDriver::Remote::Capabilities.new
@@ -295,14 +337,11 @@ module TestCentricity
295
337
  capabilities['recordVideo'] = ENV['RECORD_VIDEO'] if ENV['RECORD_VIDEO']
296
338
  if ENV['SL_OS']
297
339
  capabilities['platform'] = ENV['SL_OS']
298
- Environ.platform = :desktop
299
340
  elsif ENV['SL_PLATFORM']
300
341
  capabilities['platform'] = ENV['SL_PLATFORM']
301
342
  capabilities['deviceName'] = ENV['SL_DEVICE']
302
343
  capabilities['deviceType'] = ENV['SL_DEVICE_TYPE'] if ENV['SL_DEVICE_TYPE']
303
344
  capabilities['deviceOrientation'] = ENV['ORIENTATION'] if ENV['ORIENTATION']
304
- Environ.device_type = ENV['SL_DEVICE']
305
- Environ.platform = :mobile
306
345
  end
307
346
 
308
347
  Capybara::Selenium::Driver.new(app, :browser => :remote, :url => endpoint, :desired_capabilities => capabilities)
@@ -317,6 +356,19 @@ module TestCentricity
317
356
  def self.initialize_testingbot
318
357
  browser = ENV['TB_BROWSER']
319
358
 
359
+ Environ.os = ENV['TB_OS']
360
+ if ENV['TB_PLATFORM']
361
+ if ENV['ORIENTATION']
362
+ Environ.device_orientation = ENV['ORIENTATION']
363
+ end
364
+ Environ.device_os = ENV['TB_PLATFORM']
365
+ Environ.device_type = ENV['TB_DEVICE']
366
+ Environ.device = true
367
+ Environ.platform = :mobile
368
+ else
369
+ Environ.platform = :desktop
370
+ end
371
+
320
372
  ENV['TUNNELING'] ?
321
373
  endpoint = '@localhost:4445/wd/hub' :
322
374
  endpoint = '@hub.testingbot.com:4444/wd/hub'
@@ -331,15 +383,11 @@ module TestCentricity
331
383
  capabilities['platform'] = ENV['TB_OS']
332
384
  capabilities['record_video'] = ENV['RECORD_VIDEO'] if ENV['RECORD_VIDEO']
333
385
  if ENV['TB_PLATFORM']
334
- Environ.device_orientation = ENV['ORIENTATION'] if ENV['ORIENTATION']
335
- capabilities['orientation'] = ENV['ORIENTATION'] if ENV['ORIENTATION']
386
+ if ENV['ORIENTATION']
387
+ capabilities['orientation'] = ENV['ORIENTATION']
388
+ end
336
389
  capabilities['platformName'] = ENV['TB_PLATFORM']
337
390
  capabilities['deviceName'] = ENV['TB_DEVICE']
338
- Environ.device_type = ENV['TB_DEVICE']
339
- Environ.device = true
340
- Environ.platform = :mobile
341
- else
342
- Environ.platform = :desktop
343
391
  end
344
392
 
345
393
  Capybara::Selenium::Driver.new(app, :browser => :remote, :url => endpoint, :desired_capabilities => capabilities)
@@ -15,9 +15,9 @@ Gem::Specification.new do |spec|
15
15
  The TestCentricity™ Web core generic framework for desktop and mobile web site testing implements a Page Object Model DSL
16
16
  for use with Cucumber, Capybara, and Selenium-Webdriver. The TestCentricity™ Web gem supports running automated tests
17
17
  against locally hosted desktop browsers (Firefox, Chrome, Safari, or IE), locally hosted emulated mobile browsers (iOS,
18
- Android, Windows Phone, Blackberry) running within Firefox or Chrome, a "headless" browser (using Poltergeist and PhantomJS),
19
- mobile Safari browsers on iOS device simulators (using Appium and XCode on OS X), or cloud hosted desktop or mobile
20
- web browsers (using the BrowserStack, Sauce Labs, CrossBrowserTesting, or TestingBot services).}
18
+ Android, Windows Phone, Blackberry, Kindle Fire) running within an instance of Firefox or Chrome, a "headless" browser (using
19
+ Poltergeist and PhantomJS), mobile Safari browsers on iOS device simulators (using Appium and XCode on OS X), or cloud hosted
20
+ desktop or mobile web browsers (using the BrowserStack, Sauce Labs, CrossBrowserTesting, or TestingBot services).}
21
21
  spec.homepage = ''
22
22
  spec.license = 'BSD3'
23
23
 
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.0.23
4
+ version: 2.1.0
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: 2017-08-12 00:00:00.000000000 Z
11
+ date: 2017-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -181,9 +181,9 @@ description: |2-
181
181
  The TestCentricity™ Web core generic framework for desktop and mobile web site testing implements a Page Object Model DSL
182
182
  for use with Cucumber, Capybara, and Selenium-Webdriver. The TestCentricity™ Web gem supports running automated tests
183
183
  against locally hosted desktop browsers (Firefox, Chrome, Safari, or IE), locally hosted emulated mobile browsers (iOS,
184
- Android, Windows Phone, Blackberry) running within Firefox or Chrome, a "headless" browser (using Poltergeist and PhantomJS),
185
- mobile Safari browsers on iOS device simulators (using Appium and XCode on OS X), or cloud hosted desktop or mobile
186
- web browsers (using the BrowserStack, Sauce Labs, CrossBrowserTesting, or TestingBot services).
184
+ Android, Windows Phone, Blackberry, Kindle Fire) running within an instance of Firefox or Chrome, a "headless" browser (using
185
+ Poltergeist and PhantomJS), mobile Safari browsers on iOS device simulators (using Appium and XCode on OS X), or cloud hosted
186
+ desktop or mobile web browsers (using the BrowserStack, Sauce Labs, CrossBrowserTesting, or TestingBot services).
187
187
  email:
188
188
  - testcentricity@gmail.com
189
189
  executables: []