testcentricity_web 3.2.21 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +24 -0
- data/Gemfile.lock +22 -22
- data/lib/testcentricity_web/data_objects/environment.rb +40 -3
- data/lib/testcentricity_web/exception_queue_helper.rb +40 -6
- data/lib/testcentricity_web/utility_helpers.rb +4 -0
- data/lib/testcentricity_web/version.rb +1 -1
- data/lib/testcentricity_web/web_core/webdriver_helper.rb +41 -24
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3d97b7e502a92925e73d36a13871155d113fa873cc6edc8832adf0036435d65
|
4
|
+
data.tar.gz: 98ae195b6766c2872d548d07b9b79f7b028132815afd2e84f947e0f3d4b22fa2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c01dcd0570c1af0b58f86c15dacc86cdd99caccc5f0f5bd750f9dbc1875447860cb30204939071468078426a3823ffc12a6ef9936d858509e2e471492be07b8a
|
7
|
+
data.tar.gz: ed1919d60dfef160d4e59a2b40a3405dfd08b0632930f69ea2a0e068fcc51210d01fd003a549ec377929feae3de03463ac4754b47df3fcda317cc02018f70569
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,30 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
4
|
|
5
|
+
## [3.3.0] - 14-MAR-2021
|
6
|
+
|
7
|
+
### Fixed
|
8
|
+
* `WebDriverConnect.initialize_web_driver` method now correctly sets local Chrome browser Download directory when running
|
9
|
+
with headless Chrome.
|
10
|
+
|
11
|
+
## [3.2.25] - 11-MAR-2021
|
12
|
+
|
13
|
+
### Added
|
14
|
+
* Added `String.titlecase` method.
|
15
|
+
|
16
|
+
## [3.2.23] - 11-FEB-2021
|
17
|
+
|
18
|
+
### Changed
|
19
|
+
* Updated `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods to allow `:translate_upcase`,
|
20
|
+
`:translate_downcase`, `:translate_capitalize`, and `:translate_titlecase` conversions to fall back to `:en` default
|
21
|
+
locale if translated strings are missing from the current locale specified in `I18n.locale`.
|
22
|
+
|
23
|
+
## [3.2.22] - 09-FEB-2021
|
24
|
+
|
25
|
+
### Fixed
|
26
|
+
* Updated `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods to correctly handle `:translate_upcase`,
|
27
|
+
`:translate_downcase`, `:translate_capitalize`, and `:translate_titlecase` conversions for Arrays of `String`.
|
28
|
+
|
5
29
|
## [3.2.21] - 04-FEB-2021
|
6
30
|
|
7
31
|
### Changed
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
testcentricity_web (3.
|
4
|
+
testcentricity_web (3.3.0)
|
5
5
|
appium_lib
|
6
6
|
browserstack-local
|
7
7
|
capybara (>= 3.1, < 4)
|
@@ -21,58 +21,58 @@ GEM
|
|
21
21
|
specs:
|
22
22
|
addressable (2.7.0)
|
23
23
|
public_suffix (>= 2.0.2, < 5.0)
|
24
|
-
appium_lib (
|
25
|
-
appium_lib_core (~>
|
24
|
+
appium_lib (11.2.0)
|
25
|
+
appium_lib_core (~> 4.1)
|
26
26
|
nokogiri (~> 1.8, >= 1.8.1)
|
27
27
|
tomlrb (~> 1.1)
|
28
|
-
appium_lib_core (
|
29
|
-
faye-websocket (~> 0.
|
28
|
+
appium_lib_core (4.4.1)
|
29
|
+
faye-websocket (~> 0.11.0)
|
30
30
|
selenium-webdriver (~> 3.14, >= 3.14.1)
|
31
31
|
axiom-types (0.1.1)
|
32
32
|
descendants_tracker (~> 0.0.4)
|
33
33
|
ice_nine (~> 0.11.0)
|
34
34
|
thread_safe (~> 0.3, >= 0.3.1)
|
35
35
|
browserstack-local (1.3.0)
|
36
|
-
capybara (3.
|
36
|
+
capybara (3.35.3)
|
37
37
|
addressable
|
38
38
|
mini_mime (>= 0.1.3)
|
39
39
|
nokogiri (~> 1.8)
|
40
40
|
rack (>= 1.6.0)
|
41
41
|
rack-test (>= 0.6.3)
|
42
|
-
regexp_parser (
|
42
|
+
regexp_parser (>= 1.5, < 3.0)
|
43
43
|
xpath (~> 3.2)
|
44
44
|
childprocess (0.9.0)
|
45
45
|
ffi (~> 1.0, >= 1.0.11)
|
46
46
|
chronic (0.10.2)
|
47
47
|
coercible (1.0.0)
|
48
48
|
descendants_tracker (~> 0.0.1)
|
49
|
-
concurrent-ruby (1.1.
|
49
|
+
concurrent-ruby (1.1.8)
|
50
50
|
descendants_tracker (0.0.4)
|
51
51
|
thread_safe (~> 0.3, >= 0.3.1)
|
52
52
|
equalizer (0.0.11)
|
53
53
|
eventmachine (1.2.7)
|
54
|
-
faker (2.
|
54
|
+
faker (2.16.0)
|
55
55
|
i18n (>= 1.6, < 2)
|
56
|
-
faye-websocket (0.
|
56
|
+
faye-websocket (0.11.0)
|
57
57
|
eventmachine (>= 0.12.0)
|
58
58
|
websocket-driver (>= 0.5.1)
|
59
|
-
ffi (1.
|
60
|
-
i18n (1.8.
|
59
|
+
ffi (1.15.0)
|
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
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
64
|
+
nokogiri (1.11.2-x86_64-darwin)
|
65
|
+
racc (~> 1.4)
|
66
|
+
os (1.1.1)
|
67
|
+
power_assert (2.0.0)
|
68
|
+
public_suffix (4.0.6)
|
69
|
+
racc (1.5.2)
|
70
70
|
rack (2.2.3)
|
71
71
|
rack-test (1.1.0)
|
72
72
|
rack (>= 1.0, < 3)
|
73
73
|
rake (13.0.1)
|
74
74
|
redcarpet (3.5.0)
|
75
|
-
regexp_parser (1.
|
75
|
+
regexp_parser (2.1.1)
|
76
76
|
ruby-ole (1.2.12.2)
|
77
77
|
rubyzip (2.3.0)
|
78
78
|
selenium-webdriver (3.142.7)
|
@@ -80,7 +80,7 @@ GEM
|
|
80
80
|
rubyzip (>= 1.2.2)
|
81
81
|
spreadsheet (1.1.7)
|
82
82
|
ruby-ole (>= 1.0)
|
83
|
-
test-unit (3.
|
83
|
+
test-unit (3.4.0)
|
84
84
|
power_assert
|
85
85
|
thread_safe (0.3.6)
|
86
86
|
tomlrb (1.3.0)
|
@@ -89,11 +89,11 @@ GEM
|
|
89
89
|
coercible (~> 1.0)
|
90
90
|
descendants_tracker (~> 0.0, >= 0.0.3)
|
91
91
|
equalizer (~> 0.0, >= 0.0.9)
|
92
|
-
webdrivers (4.
|
92
|
+
webdrivers (4.6.0)
|
93
93
|
nokogiri (~> 1.6)
|
94
94
|
rubyzip (>= 1.3.0)
|
95
95
|
selenium-webdriver (>= 3.0, < 4.0)
|
96
|
-
websocket-driver (0.7.
|
96
|
+
websocket-driver (0.7.3)
|
97
97
|
websocket-extensions (>= 0.1.0)
|
98
98
|
websocket-extensions (0.1.5)
|
99
99
|
xpath (3.2.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
|
@@ -58,8 +61,12 @@ module TestCentricity
|
|
58
61
|
attr_accessor :user_id
|
59
62
|
attr_accessor :password
|
60
63
|
attr_accessor :append
|
64
|
+
attr_accessor :app_id
|
65
|
+
attr_accessor :api_key
|
61
66
|
attr_accessor :option1
|
62
67
|
attr_accessor :option2
|
68
|
+
attr_accessor :option3
|
69
|
+
attr_accessor :option4
|
63
70
|
attr_accessor :dns
|
64
71
|
attr_accessor :db_username
|
65
72
|
attr_accessor :db_password
|
@@ -71,12 +78,18 @@ module TestCentricity
|
|
71
78
|
@user_id = data['USER_ID']
|
72
79
|
@password = data['PASSWORD']
|
73
80
|
@append = data['APPEND']
|
81
|
+
@app_id = data['APP_ID']
|
82
|
+
@api_key = data['API_KEY']
|
74
83
|
@option1 = data['OPTIONAL_1']
|
75
84
|
@option2 = data['OPTIONAL_2']
|
85
|
+
@option3 = data['OPTIONAL_3']
|
86
|
+
@option4 = data['OPTIONAL_4']
|
76
87
|
@dns = data['DNS']
|
77
88
|
@db_username = data['DB_USERNAME']
|
78
89
|
@db_password = data['DB_PASSWORD']
|
79
90
|
@a11y_standard = ENV['ACCESSIBILITY_STANDARD'] || 'best-practice'
|
91
|
+
@locale = ENV['LOCALE'] || 'en'
|
92
|
+
@language = ENV['LANGUAGE'] || 'English'
|
80
93
|
|
81
94
|
super
|
82
95
|
end
|
@@ -205,6 +218,14 @@ module TestCentricity
|
|
205
218
|
@device_os
|
206
219
|
end
|
207
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
|
+
|
208
229
|
def self.is_ios?
|
209
230
|
@device_os == :ios
|
210
231
|
end
|
@@ -245,6 +266,22 @@ module TestCentricity
|
|
245
266
|
@tunneling
|
246
267
|
end
|
247
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
|
+
|
248
285
|
def self.platform=(platform)
|
249
286
|
@platform = platform
|
250
287
|
end
|
@@ -305,13 +342,13 @@ module TestCentricity
|
|
305
342
|
report_header = "\n<b><u>TEST ENVIRONMENT</u>:</b> #{ENV['TEST_ENVIRONMENT']}\n"\
|
306
343
|
" <b>Browser:</b>\t #{Environ.browser.capitalize}\n"
|
307
344
|
report_header = "#{report_header} <b>Device:</b>\t\t #{Environ.device_name}\n" if Environ.device_name
|
308
|
-
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
|
309
346
|
report_header = "#{report_header} <b>Device type:</b>\t #{Environ.device_type}\n" if Environ.device_type
|
310
347
|
report_header = "#{report_header} <b>Driver:</b>\t\t #{Environ.driver}\n" if Environ.driver
|
311
348
|
report_header = "#{report_header} <b>Grid:</b>\t\t #{Environ.grid}\n" if Environ.grid
|
312
349
|
report_header = "#{report_header} <b>OS:</b>\t\t\t #{Environ.os}\n" if Environ.os
|
313
|
-
report_header = "#{report_header} <b>Locale:</b>\t\t #{
|
314
|
-
report_header = "#{report_header} <b>Language:</b>\t #{
|
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
|
315
352
|
report_header = "#{report_header} <b>Country:</b>\t #{ENV['COUNTRY']}\n" if ENV['COUNTRY']
|
316
353
|
report_header = "#{report_header} <b>WCAG Accessibility Standard:</b>\t #{ENV['ACCESSIBILITY_STANDARD']}\n" if ENV['ACCESSIBILITY_STANDARD']
|
317
354
|
"#{report_header}\n\n"
|
@@ -76,20 +76,31 @@ module TestCentricity
|
|
76
76
|
expected = expected.downcase
|
77
77
|
enqueue_exception("#{error_msg} be like '#{value}' but found '#{actual}'") unless actual_like.include?(expected)
|
78
78
|
when :translate
|
79
|
-
expected =
|
79
|
+
expected = translate(value)
|
80
80
|
enqueue_assert_equal(expected, actual, error_msg)
|
81
81
|
when :translate_upcase
|
82
|
-
expected =
|
82
|
+
expected = translate(value)
|
83
|
+
expected = expected.is_a?(Array) ? expected.map(&:upcase) : expected.upcase
|
83
84
|
enqueue_assert_equal(expected, actual, error_msg)
|
84
85
|
when :translate_downcase
|
85
|
-
expected =
|
86
|
+
expected = translate(value)
|
87
|
+
expected = expected.is_a?(Array) ? expected.map(&:downcase) : expected.downcase
|
86
88
|
enqueue_assert_equal(expected, actual, error_msg)
|
87
89
|
when :translate_capitalize
|
88
|
-
expected =
|
90
|
+
expected = translate(value)
|
91
|
+
expected = expected.is_a?(Array) ? expected.map(&:capitalize) : expected.capitalize
|
89
92
|
enqueue_assert_equal(expected, actual, error_msg)
|
90
93
|
when :translate_titlecase
|
91
|
-
expected =
|
92
|
-
expected =
|
94
|
+
expected = translate(value)
|
95
|
+
expected = if expected.is_a?(Array)
|
96
|
+
result = []
|
97
|
+
expected.each do |item|
|
98
|
+
result.push("#{item.split.each{ |item| item.capitalize! }.join(' ')}")
|
99
|
+
end
|
100
|
+
result
|
101
|
+
else
|
102
|
+
"#{expected.split.each{ |expected| expected.capitalize! }.join(' ')}"
|
103
|
+
end
|
93
104
|
enqueue_assert_equal(expected, actual, error_msg)
|
94
105
|
end
|
95
106
|
end
|
@@ -126,6 +137,29 @@ module TestCentricity
|
|
126
137
|
screen_shot = {path: path, filename: filename}
|
127
138
|
Environ.save_screen_shot(screen_shot)
|
128
139
|
end
|
140
|
+
|
141
|
+
def self.translate(*args, **opts)
|
142
|
+
opts[:locale] ||= I18n.locale
|
143
|
+
opts[:raise] = true
|
144
|
+
I18n.translate(*args, **opts)
|
145
|
+
rescue I18n::MissingTranslationData => err
|
146
|
+
puts err
|
147
|
+
opts[:locale] = :en
|
148
|
+
|
149
|
+
# fallback to en if the translation is missing. If the translation isn't
|
150
|
+
# in en, then raise again.
|
151
|
+
disable_enforce_available_locales do
|
152
|
+
I18n.translate(*args, **opts)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
def self.disable_enforce_available_locales
|
157
|
+
saved_enforce_available_locales = I18n.enforce_available_locales
|
158
|
+
I18n.enforce_available_locales = false
|
159
|
+
yield
|
160
|
+
ensure
|
161
|
+
I18n.enforce_available_locales = saved_enforce_available_locales
|
162
|
+
end
|
129
163
|
end
|
130
164
|
|
131
165
|
|
@@ -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:
|
137
|
-
platformVersion:
|
137
|
+
platformName: Environ.device_os,
|
138
|
+
platformVersion: Environ.device_os_version,
|
138
139
|
browserName: ENV['APP_BROWSER'],
|
139
|
-
deviceName:
|
140
|
+
deviceName: Environ.device_name
|
140
141
|
}
|
141
|
-
desired_capabilities[:avd] = ENV['APP_DEVICE'] if
|
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] =
|
152
|
+
desired_capabilities[:orientation] = Environ.device_orientation.upcase if Environ.device_orientation
|
152
153
|
if Environ.device_os == :ios
|
153
|
-
desired_capabilities[:language] =
|
154
|
-
desired_capabilities[: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
|
-
|
174
|
-
|
189
|
+
appium_lib: appium_lib_options,
|
190
|
+
caps: desired_capabilities
|
175
191
|
}
|
176
192
|
Appium::Capybara::Driver.new app, all_options
|
177
193
|
end
|
@@ -224,21 +240,22 @@ module TestCentricity
|
|
224
240
|
options.args << '--headless' if browser == :firefox_headless
|
225
241
|
Capybara::Selenium::Driver.new(app, browser: :firefox, options: options)
|
226
242
|
when :chrome, :chrome_headless
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
options.add_preference(:download, prefs)
|
235
|
-
else
|
236
|
-
options = Selenium::WebDriver::Chrome::Options.new(args: %w[headless disable-gpu no-sandbox])
|
237
|
-
end
|
243
|
+
options = Selenium::WebDriver::Chrome::Options.new
|
244
|
+
prefs = {
|
245
|
+
prompt_for_download: false,
|
246
|
+
directory_upgrade: true,
|
247
|
+
default_directory: @downloads_path
|
248
|
+
}
|
249
|
+
options.add_preference(:download, prefs)
|
238
250
|
options.add_argument('--disable-infobars')
|
239
251
|
options.add_argument("--lang=#{ENV['LOCALE']}") if ENV['LOCALE']
|
240
|
-
|
241
|
-
|
252
|
+
if browser == :chrome_headless
|
253
|
+
options.add_argument('--headless')
|
254
|
+
options.add_argument('--disable-gpu')
|
255
|
+
options.add_argument('--no-sandbox')
|
256
|
+
end
|
257
|
+
|
258
|
+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options) else
|
242
259
|
if ENV['HOST_BROWSER'] && ENV['HOST_BROWSER'].downcase.to_sym == :chrome
|
243
260
|
user_agent = Browsers.mobile_device_agent(ENV['WEB_BROWSER'])
|
244
261
|
options = Selenium::WebDriver::Chrome::Options.new
|
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.
|
4
|
+
version: 3.3.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: 2021-
|
11
|
+
date: 2021-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|