testcentricity_web 2.0.20.1 → 2.0.21
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d6eccc43050082ad81dac5bdb466833535bbe31
|
4
|
+
data.tar.gz: 8ec8306a7e9ccd943d43b651a3d59b74932d7dff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4daea27dff027cc4c0d88483154f3b27383c5543ea296e968eb67d8f6fcffcd31cb8dc45761312eb0f8e06f9bebb5bb74cfa43586d1fa3e71260906503e22da2
|
7
|
+
data.tar.gz: d27fb8722800bb8cdc6a2db98a4e142274e2f6a4b4006586d06fff031c7d26f0b8e992ffc62dd179d3f3a1f0ba84d6986223720e1f0217f0839a7e8b9336c68a
|
data/README.md
CHANGED
@@ -681,6 +681,7 @@ To use these **PageManager** methods, include the step definitions and code belo
|
|
681
681
|
end
|
682
682
|
|
683
683
|
|
684
|
+
|
684
685
|
## Connecting to a Web Browser
|
685
686
|
|
686
687
|
The `TestCentricity::WebDriverConnect.initialize_web_driver` method configures the appropriate selenium-webdriver capabilities required to establish a
|
@@ -15,6 +15,7 @@ module TestCentricity
|
|
15
15
|
resolution = resolution.split(',') if resolution.is_a?(String)
|
16
16
|
window = Capybara.current_session.driver.browser.manage.window
|
17
17
|
window.resize_to(resolution[0], resolution[1])
|
18
|
+
Environ.browser_size = [resolution[0].to_i, resolution[1].to_i]
|
18
19
|
end
|
19
20
|
|
20
21
|
# Maximizes the selenium browser window.
|
@@ -126,6 +127,7 @@ module TestCentricity
|
|
126
127
|
device = get_devices[device_name]
|
127
128
|
name = device[:name]
|
128
129
|
raise "Device '#{device}' is not defined" unless name
|
130
|
+
Environ.device_os = device[:os]
|
129
131
|
name
|
130
132
|
end
|
131
133
|
|
@@ -137,10 +139,12 @@ module TestCentricity
|
|
137
139
|
height = device[:css_height]
|
138
140
|
default_orientation = device[:default_orientation].to_sym
|
139
141
|
if orientation
|
142
|
+
Environ.device_orientation = orientation
|
140
143
|
orientation.downcase.to_sym == default_orientation ?
|
141
144
|
size = [width, height] :
|
142
145
|
size = [height, width]
|
143
146
|
else
|
147
|
+
Environ.device_orientation = device[:default_orientation]
|
144
148
|
size = [width, height]
|
145
149
|
end
|
146
150
|
else
|
@@ -28,9 +28,12 @@ module TestCentricity
|
|
28
28
|
|
29
29
|
attr_accessor :test_environment
|
30
30
|
attr_accessor :browser
|
31
|
+
attr_accessor :browser_size
|
31
32
|
attr_accessor :os
|
32
33
|
attr_accessor :device
|
33
34
|
attr_accessor :device_type
|
35
|
+
attr_accessor :device_os
|
36
|
+
attr_accessor :device_orientation
|
34
37
|
attr_accessor :platform
|
35
38
|
|
36
39
|
attr_accessor :signed_in
|
@@ -103,6 +106,14 @@ module TestCentricity
|
|
103
106
|
@browser
|
104
107
|
end
|
105
108
|
|
109
|
+
def self.browser_size=(size)
|
110
|
+
@browser_size = size
|
111
|
+
end
|
112
|
+
|
113
|
+
def self.browser_size
|
114
|
+
@browser_size
|
115
|
+
end
|
116
|
+
|
106
117
|
# @deprecated Please use {#Environ.os =} instead
|
107
118
|
def self.set_os(os)
|
108
119
|
warn "[DEPRECATION] 'TestCentricity::Environ.set_os' is deprecated. Please use 'Environ.os =' instead."
|
@@ -145,6 +156,22 @@ module TestCentricity
|
|
145
156
|
@device_type
|
146
157
|
end
|
147
158
|
|
159
|
+
def self.device_os=(os)
|
160
|
+
@device_os = os.downcase.to_sym
|
161
|
+
end
|
162
|
+
|
163
|
+
def self.device_os
|
164
|
+
@device_os
|
165
|
+
end
|
166
|
+
|
167
|
+
def self.device_orientation=(orientation)
|
168
|
+
@device_orientation = orientation.downcase.to_sym
|
169
|
+
end
|
170
|
+
|
171
|
+
def self.device_orientation
|
172
|
+
@device_orientation
|
173
|
+
end
|
174
|
+
|
148
175
|
# @deprecated Please use {#Environ.platform =} instead
|
149
176
|
def self.set_platform(platform)
|
150
177
|
warn "[DEPRECATION] 'TestCentricity::Environ.set_platform' is deprecated. Please use 'Environ.platform =' instead."
|
@@ -93,6 +93,8 @@ module TestCentricity
|
|
93
93
|
Environ.device = true
|
94
94
|
Environ.platform = :mobile
|
95
95
|
Environ.device_type = ENV['APP_DEVICE']
|
96
|
+
Environ.device_os = ENV['APP_PLATFORM_NAME']
|
97
|
+
Environ.device_orientation = ENV['ORIENTATION'] if ENV['ORIENTATION']
|
96
98
|
Capybara.default_driver = :appium
|
97
99
|
endpoint = 'http://localhost:4723/wd/hub'
|
98
100
|
desired_capabilities = {
|
@@ -121,13 +123,6 @@ module TestCentricity
|
|
121
123
|
end
|
122
124
|
|
123
125
|
def self.initialize_local_browser
|
124
|
-
Environ.os = OS.report
|
125
|
-
|
126
|
-
puts "Environ.os = #{Environ.os}"
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
126
|
browser = ENV['WEB_BROWSER']
|
132
127
|
Capybara.default_driver = :selenium
|
133
128
|
Capybara.register_driver :selenium do |app|
|
@@ -174,6 +169,7 @@ module TestCentricity
|
|
174
169
|
Environ.platform = :mobile
|
175
170
|
Environ.device = true
|
176
171
|
Environ.device_type = ENV['BS_DEVICE']
|
172
|
+
Environ.device_orientation = ENV['ORIENTATION'] if ENV['ORIENTATION']
|
177
173
|
capabilities['deviceOrientation'] = ENV['ORIENTATION'] if ENV['ORIENTATION']
|
178
174
|
elsif ENV['BS_REAL_MOBILE']
|
179
175
|
capabilities['device'] = ENV['BS_DEVICE']
|
@@ -335,6 +331,7 @@ module TestCentricity
|
|
335
331
|
capabilities['platform'] = ENV['TB_OS']
|
336
332
|
capabilities['record_video'] = ENV['RECORD_VIDEO'] if ENV['RECORD_VIDEO']
|
337
333
|
if ENV['TB_PLATFORM']
|
334
|
+
Environ.device_orientation = ENV['ORIENTATION'] if ENV['ORIENTATION']
|
338
335
|
capabilities['orientation'] = ENV['ORIENTATION'] if ENV['ORIENTATION']
|
339
336
|
capabilities['platformName'] = ENV['TB_PLATFORM']
|
340
337
|
capabilities['deviceName'] = ENV['TB_DEVICE']
|