testcentricity_web 3.2.20 → 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 +4 -4
- data/CHANGELOG.md +31 -0
- data/Gemfile.lock +24 -22
- data/LICENSE.md +1 -1
- data/README.md +1 -1
- 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 +27 -11
- data/lib/testcentricity_web/web_elements/ui_elements_helper.rb +16 -4
- 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: 49868a5ac9a36308a250e4682750a7450c94f0bd297d8103d25170fbd067491e
|
|
4
|
+
data.tar.gz: bd80b70984d2646cf6d510be7517d9a2e5d353df69c30f367c89bfba7d29e011
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bb6029661e87b7528125a06dce284b149f09f538c31c24a2835c55f36b7f38a2699c7cd8c9b4768205496b409a2d7b7210ce5e99bdb5a7173c2677343af3def7
|
|
7
|
+
data.tar.gz: 384e430102526d15a43c35e2bcab9ff11df24497cb342767aacd4527694e06c1053d20ceb69d298841499932aefbca3945d528dfb10871a6b7e70e3268cf415b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,37 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
|
|
4
|
+
|
|
5
|
+
## [3.2.25] - 11-MAR-2021
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
* Added `String.titlecase` method.
|
|
9
|
+
|
|
10
|
+
## [3.2.23] - 11-FEB-2021
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
* Updated `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods to allow `:translate_upcase`,
|
|
14
|
+
`:translate_downcase`, `:translate_capitalize`, and `:translate_titlecase` conversions to fall back to `:en` default
|
|
15
|
+
locale if translated strings are missing from the current locale specified in `I18n.locale`.
|
|
16
|
+
|
|
17
|
+
## [3.2.22] - 09-FEB-2021
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
* Updated `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods to correctly handle `:translate_upcase`,
|
|
21
|
+
`:translate_downcase`, `:translate_capitalize`, and `:translate_titlecase` conversions for Arrays of `String`.
|
|
22
|
+
|
|
23
|
+
## [3.2.21] - 04-FEB-2021
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
* `UIElement.hover_at` method now accepts an optional `visible` parameter to allow hovering over UI elements that are not
|
|
27
|
+
visible.
|
|
28
|
+
|
|
29
|
+
## [3.2.20] - 21-JAN-2021
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
* `UIElement.hover` method now accepts an optional `visible` parameter to allow hovering over UI elements that are not
|
|
33
|
+
visible.
|
|
34
|
+
|
|
4
35
|
## [3.2.19] - 05-JAN-2021
|
|
5
36
|
|
|
6
37
|
### Fixed
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
testcentricity_web (3.2.
|
|
4
|
+
testcentricity_web (3.2.25)
|
|
5
5
|
appium_lib
|
|
6
6
|
browserstack-local
|
|
7
7
|
capybara (>= 3.1, < 4)
|
|
@@ -21,58 +21,60 @@ 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
|
-
mini_portile2 (2.
|
|
65
|
-
nokogiri (1.
|
|
66
|
-
mini_portile2 (~> 2.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
mini_portile2 (2.5.0)
|
|
65
|
+
nokogiri (1.11.2)
|
|
66
|
+
mini_portile2 (~> 2.5.0)
|
|
67
|
+
racc (~> 1.4)
|
|
68
|
+
os (1.1.1)
|
|
69
|
+
power_assert (2.0.0)
|
|
70
|
+
public_suffix (4.0.6)
|
|
71
|
+
racc (1.5.2)
|
|
70
72
|
rack (2.2.3)
|
|
71
73
|
rack-test (1.1.0)
|
|
72
74
|
rack (>= 1.0, < 3)
|
|
73
75
|
rake (13.0.1)
|
|
74
76
|
redcarpet (3.5.0)
|
|
75
|
-
regexp_parser (1.
|
|
77
|
+
regexp_parser (2.1.1)
|
|
76
78
|
ruby-ole (1.2.12.2)
|
|
77
79
|
rubyzip (2.3.0)
|
|
78
80
|
selenium-webdriver (3.142.7)
|
|
@@ -80,7 +82,7 @@ GEM
|
|
|
80
82
|
rubyzip (>= 1.2.2)
|
|
81
83
|
spreadsheet (1.1.7)
|
|
82
84
|
ruby-ole (>= 1.0)
|
|
83
|
-
test-unit (3.
|
|
85
|
+
test-unit (3.4.0)
|
|
84
86
|
power_assert
|
|
85
87
|
thread_safe (0.3.6)
|
|
86
88
|
tomlrb (1.3.0)
|
|
@@ -89,11 +91,11 @@ GEM
|
|
|
89
91
|
coercible (~> 1.0)
|
|
90
92
|
descendants_tracker (~> 0.0, >= 0.0.3)
|
|
91
93
|
equalizer (~> 0.0, >= 0.0.9)
|
|
92
|
-
webdrivers (4.
|
|
94
|
+
webdrivers (4.6.0)
|
|
93
95
|
nokogiri (~> 1.6)
|
|
94
96
|
rubyzip (>= 1.3.0)
|
|
95
97
|
selenium-webdriver (>= 3.0, < 4.0)
|
|
96
|
-
websocket-driver (0.7.
|
|
98
|
+
websocket-driver (0.7.3)
|
|
97
99
|
websocket-extensions (>= 0.1.0)
|
|
98
100
|
websocket-extensions (0.1.5)
|
|
99
101
|
xpath (3.2.0)
|
data/LICENSE.md
CHANGED
data/README.md
CHANGED
|
@@ -1673,7 +1673,7 @@ landscape orientation running on the BrowserStack service:
|
|
|
1673
1673
|
|
|
1674
1674
|
## Copyright and License
|
|
1675
1675
|
|
|
1676
|
-
TestCentricity™ Framework is Copyright (c) 2014-
|
|
1676
|
+
TestCentricity™ Framework is Copyright (c) 2014-2021, Tony Mrozinski.
|
|
1677
1677
|
All rights reserved.
|
|
1678
1678
|
|
|
1679
1679
|
Redistribution and use in source and binary forms, with or without
|
|
@@ -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
|
|
@@ -528,11 +528,17 @@ module TestCentricity
|
|
|
528
528
|
|
|
529
529
|
# Hover the cursor over an object
|
|
530
530
|
#
|
|
531
|
+
# @param visible [Boolean, Symbol] Only find elements with the specified visibility:
|
|
532
|
+
# * true - only finds visible elements.
|
|
533
|
+
# * false - finds invisible _and_ visible elements.
|
|
534
|
+
# * :all - same as false; finds visible and invisible elements.
|
|
535
|
+
# * :hidden - only finds invisible elements.
|
|
536
|
+
# * :visible - same as true; only finds visible elements.
|
|
531
537
|
# @example
|
|
532
538
|
# basket_link.hover
|
|
533
539
|
#
|
|
534
|
-
def hover
|
|
535
|
-
obj, type = find_element
|
|
540
|
+
def hover(visible = true)
|
|
541
|
+
obj, type = find_element(visible)
|
|
536
542
|
object_not_found_exception(obj, type)
|
|
537
543
|
obj.hover
|
|
538
544
|
end
|
|
@@ -541,11 +547,17 @@ module TestCentricity
|
|
|
541
547
|
#
|
|
542
548
|
# @param x [Integer] X offset
|
|
543
549
|
# @param y [Integer] Y offset
|
|
550
|
+
# @param visible [Boolean, Symbol] Only find elements with the specified visibility:
|
|
551
|
+
# * true - only finds visible elements.
|
|
552
|
+
# * false - finds invisible _and_ visible elements.
|
|
553
|
+
# * :all - same as false; finds visible and invisible elements.
|
|
554
|
+
# * :hidden - only finds invisible elements.
|
|
555
|
+
# * :visible - same as true; only finds visible elements.
|
|
544
556
|
# @example
|
|
545
557
|
# timeline_bar.hover_at(100, 5)
|
|
546
558
|
#
|
|
547
|
-
def hover_at(x, y)
|
|
548
|
-
obj, = find_element
|
|
559
|
+
def hover_at(x, y, visible = true)
|
|
560
|
+
obj, = find_element(visible)
|
|
549
561
|
raise "UI #{object_ref_message} not found" unless obj
|
|
550
562
|
obj.hover_at(x, y)
|
|
551
563
|
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.
|
|
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-
|
|
11
|
+
date: 2021-03-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|