eyes_selenium 6.10.1 → 6.11.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 +4 -4
- data/CHANGELOG.md +36 -0
- data/eyes_selenium.gemspec +1 -1
- data/lib/applitools/eyes_selenium/version.rb +1 -1
- data/lib/applitools/selenium/configuration.rb +248 -13
- data/lib/applitools/selenium/visual_grid/android_device_info.rb +91 -0
- data/lib/applitools/selenium/visual_grid/android_device_target.rb +25 -0
- data/lib/applitools/selenium/visual_grid/android_multi_device_target.rb +16 -0
- data/lib/applitools/selenium/visual_grid/ios_multi_device_target.rb +56 -0
- metadata +8 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68b8bdfa4db83133a0a620088cf46f761ff472fb052a6efe0a7d4d0383973600
|
4
|
+
data.tar.gz: e30ef6229d5009cd3983fc10cc75036c8e65170ba2a73722ca8a1d9d681b2119
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ecbe3d936bb5efc11b77b1b9e71fec189c823966ad06cf9890b497e70d025209edda67b72d11dd8860ab402b8c133ab653c26c1fef8d550c3bfe2ca0c5224550
|
7
|
+
data.tar.gz: a76959c54283e5a1c46331a40ef852ac29a3ef834918c1e2d39abdbb65541f0390794cfb8101bd19c98a58c2fa308c6ba854dc721272f752e7b2cda72213b18c
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,41 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [6.11.0](https://github.com/Applitools-Dev/sdk/compare/ruby/eyes_selenium@6.10.1...ruby/eyes_selenium@6.11.0) (2025-07-23)
|
4
|
+
|
5
|
+
|
6
|
+
### Features
|
7
|
+
|
8
|
+
* android multi target | AD-9868 ([#2943](https://github.com/Applitools-Dev/sdk/issues/2943)) ([808aa21](https://github.com/Applitools-Dev/sdk/commit/808aa21e489c3562b93006e2e26ff7ffbb743dd6))
|
9
|
+
|
10
|
+
|
11
|
+
### Dependencies
|
12
|
+
|
13
|
+
* @applitools/nml-client bumped to 1.10.0
|
14
|
+
#### Features
|
15
|
+
|
16
|
+
* android multi target | AD-9868 ([#2943](https://github.com/Applitools-Dev/sdk/issues/2943)) ([808aa21](https://github.com/Applitools-Dev/sdk/commit/808aa21e489c3562b93006e2e26ff7ffbb743dd6))
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
* @applitools/core-base bumped to 1.26.0
|
21
|
+
#### Features
|
22
|
+
|
23
|
+
* batch properties limit | FLD-3174 ([#3080](https://github.com/Applitools-Dev/sdk/issues/3080)) ([feb9e79](https://github.com/Applitools-Dev/sdk/commit/feb9e79d79f5eab3c58eac2b4ef3c15a562f079c))
|
24
|
+
* @applitools/ec-client bumped to 1.11.1
|
25
|
+
|
26
|
+
* @applitools/core bumped to 4.43.0
|
27
|
+
#### Features
|
28
|
+
|
29
|
+
* android multi target | AD-9868 ([#2943](https://github.com/Applitools-Dev/sdk/issues/2943)) ([808aa21](https://github.com/Applitools-Dev/sdk/commit/808aa21e489c3562b93006e2e26ff7ffbb743dd6))
|
30
|
+
* batch properties limit | FLD-3174 ([#3080](https://github.com/Applitools-Dev/sdk/issues/3080)) ([feb9e79](https://github.com/Applitools-Dev/sdk/commit/feb9e79d79f5eab3c58eac2b4ef3c15a562f079c))
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
* eyes_universal bumped to 4.43.0
|
35
|
+
|
36
|
+
* eyes_core bumped to 6.8.2
|
37
|
+
|
38
|
+
|
3
39
|
## [6.10.1](https://github.com/Applitools-Dev/sdk/compare/ruby/eyes_selenium@6.10.0...ruby/eyes_selenium@6.10.1) (2025-07-15)
|
4
40
|
|
5
41
|
|
data/eyes_selenium.gemspec
CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
28
28
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
29
29
|
spec.require_paths = %w(lib)
|
30
|
-
spec.add_dependency 'eyes_core', "= 6.8.
|
30
|
+
spec.add_dependency 'eyes_core', "= 6.8.2"
|
31
31
|
spec.add_dependency 'selenium-webdriver', '>= 3'
|
32
32
|
spec.add_dependency 'css_parser'
|
33
33
|
spec.add_dependency 'crass'
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
require 'applitools/selenium/stitch_modes'
|
4
4
|
require 'applitools/selenium/browsers_info'
|
5
|
+
require 'applitools/selenium/visual_grid/ios_multi_device_target'
|
6
|
+
require 'applitools/selenium/visual_grid/android_multi_device_target'
|
5
7
|
|
6
8
|
module Applitools
|
7
9
|
module Selenium
|
@@ -42,29 +44,107 @@ module Applitools
|
|
42
44
|
value
|
43
45
|
end
|
44
46
|
|
47
|
+
# Adds multiple mobile device targets to the configuration.
|
48
|
+
#
|
49
|
+
# This method supports several ways to specify device information:
|
50
|
+
# - A hash with device configuration (e.g., { device_name: 'iPhone 13', screen_orientation: 'portrait' })
|
51
|
+
# - A single device name as a string or symbol (e.g., 'iPhone 13' or :iPhone_13)
|
52
|
+
# - Multiple device names as separate arguments
|
53
|
+
# - A platform flag to explicitly specify Android or iOS (e.g., { device_name: 'Pixel 5', platform: :android })
|
54
|
+
#
|
55
|
+
# Device names must be one of the valid device names from the respective platform:
|
56
|
+
# - iOS device names from IosMultiDeviceTargetGenerated ('iPhone 13', 'iPhone 14 Pro', etc.)
|
57
|
+
# - Android device names from AndroidMultiDeviceTargetGenerated ('Pixel 5', 'Galaxy S22', etc.)
|
58
|
+
#
|
59
|
+
# If no platform is specified, the method will attempt to determine the platform based on the device name.
|
60
|
+
#
|
61
|
+
# @param [Array] args device names or configuration hashes
|
62
|
+
# @option args [String, Symbol] :device_name The name of the mobile device
|
63
|
+
# @option args [String, Symbol] :screen_orientation The screen orientation ('portrait' or 'landscape')
|
64
|
+
# @option args [String] :ios_version The iOS version to use (for iOS devices)
|
65
|
+
# @option args [String] :android_version The Android version to use (for Android devices)
|
66
|
+
# @option args [Symbol] :platform The platform (:ios or :android)
|
67
|
+
#
|
68
|
+
# @example Add a single iOS device using a hash
|
69
|
+
# config.add_multi_device_target(device_name: 'iPhone 13', screen_orientation: 'portrait')
|
70
|
+
#
|
71
|
+
# @example Add a single Android device using a hash
|
72
|
+
# config.add_multi_device_target(device_name: 'Pixel 5', platform: :android, screen_orientation: 'portrait')
|
73
|
+
#
|
74
|
+
# @example Add a single device using a string (platform detected automatically)
|
75
|
+
# config.add_multi_device_target('iPhone 13') # iOS detected
|
76
|
+
# config.add_multi_device_target('Pixel 5') # Android detected
|
77
|
+
#
|
78
|
+
# @example Add multiple devices
|
79
|
+
# config.add_multi_device_target('iPhone 13', 'Pixel 5', 'Galaxy S22')
|
80
|
+
#
|
81
|
+
# @return [Configuration] self for method chaining
|
45
82
|
def add_multi_device_target(*args)
|
46
|
-
|
83
|
+
mobile_devices = []
|
47
84
|
|
48
85
|
if args.length == 1 && args[0].is_a?(Hash)
|
49
86
|
# Single hash passed directly
|
50
|
-
|
87
|
+
mobile_devices << create_mobile_device_info(args[0])
|
51
88
|
elsif args.any? { |arg| arg.is_a?(Hash) }
|
52
89
|
# One of the arguments is a hash with device configuration
|
53
90
|
hash_arg = args.find { |arg| arg.is_a?(Hash) }
|
54
|
-
|
91
|
+
mobile_devices << create_mobile_device_info(hash_arg)
|
55
92
|
else
|
56
93
|
# Multiple device names as symbols or strings
|
57
94
|
args.each do |device_name|
|
58
|
-
|
95
|
+
mobile_devices << create_mobile_device_info(device_name: device_name)
|
59
96
|
end
|
60
97
|
end
|
61
98
|
|
62
|
-
# Add each
|
63
|
-
add_browsers(*
|
99
|
+
# Add each mobile device to the configuration
|
100
|
+
add_browsers(*mobile_devices)
|
64
101
|
# Return the configuration object for method chaining
|
65
102
|
self
|
66
103
|
end
|
67
104
|
|
105
|
+
# Adds a browser configuration to be used for visual grid testing.
|
106
|
+
#
|
107
|
+
# This method can be called in several ways:
|
108
|
+
#
|
109
|
+
# 1. No arguments: Creates a default desktop browser configuration
|
110
|
+
# 2. One argument: Must be an IRenderBrowserInfo instance (like DesktopBrowserInfo or IosDeviceInfo)
|
111
|
+
# 3. Three arguments: width, height, and browser type to create a desktop browser config
|
112
|
+
# 4. With a block: Allows further configuration of the browser using fluent interface
|
113
|
+
#
|
114
|
+
# @overload add_browser()
|
115
|
+
# Creates a default desktop browser configuration
|
116
|
+
#
|
117
|
+
# @overload add_browser(browser_info)
|
118
|
+
# @param [IRenderBrowserInfo] browser_info A browser information instance
|
119
|
+
# @raise [Applitools::EyesIllegalArgument] if browser_info is not an IRenderBrowserInfo instance
|
120
|
+
#
|
121
|
+
# @overload add_browser(width, height, browser_type)
|
122
|
+
# @param [Integer] width The viewport width
|
123
|
+
# @param [Integer] height The viewport height
|
124
|
+
# @param [Symbol] browser_type The browser type (e.g., :chrome, :firefox)
|
125
|
+
#
|
126
|
+
# @yield [browser_config] Yields a RenderBrowserInfoFluent for further configuration
|
127
|
+
# @yieldparam [RenderBrowserInfoFluent] browser_config The browser configuration for fluent interface
|
128
|
+
#
|
129
|
+
# @example Add a default browser
|
130
|
+
# config.add_browser
|
131
|
+
#
|
132
|
+
# @example Add a specific browser with viewport size
|
133
|
+
# config.add_browser(1200, 800, :chrome)
|
134
|
+
#
|
135
|
+
# @example Add a browser with fluent interface
|
136
|
+
# config.add_browser do |browser|
|
137
|
+
# browser.viewport_size(1200, 800)
|
138
|
+
# .browser_type(:chrome)
|
139
|
+
# end
|
140
|
+
#
|
141
|
+
# @example Add a pre-configured browser info
|
142
|
+
# desktop_browser = Applitools::Selenium::DesktopBrowserInfo.new
|
143
|
+
# desktop_browser.viewport_size = Applitools::RectangleSize.new(1200, 800)
|
144
|
+
# desktop_browser.browser_type = :chrome
|
145
|
+
# config.add_browser(desktop_browser)
|
146
|
+
#
|
147
|
+
# @return [Configuration] self for method chaining
|
68
148
|
def add_browser(*args)
|
69
149
|
case args.size
|
70
150
|
when 0
|
@@ -88,6 +168,27 @@ module Applitools
|
|
88
168
|
self
|
89
169
|
end
|
90
170
|
|
171
|
+
# Adds multiple browser configurations to be used for visual grid testing.
|
172
|
+
#
|
173
|
+
# This method takes an array of browser configurations and adds them all to the
|
174
|
+
# current Eyes configuration. It's useful for configuring multiple browsers at once,
|
175
|
+
# such as when testing across different browsers and devices.
|
176
|
+
#
|
177
|
+
# @param [Array<IRenderBrowserInfo>, Array<Array<IRenderBrowserInfo>>] browsers
|
178
|
+
# An array of browser information objects or an array containing an array of browser information objects
|
179
|
+
#
|
180
|
+
# @example Add multiple browser configurations
|
181
|
+
# config.add_browsers(
|
182
|
+
# desktop_browser_info,
|
183
|
+
# ios_device_info,
|
184
|
+
# chrome_emulation_info
|
185
|
+
# )
|
186
|
+
#
|
187
|
+
# @example Add an array of browser configurations
|
188
|
+
# browsers = [desktop_browser_info, ios_device_info]
|
189
|
+
# config.add_browsers(browsers)
|
190
|
+
#
|
191
|
+
# @return [Configuration] self for method chaining
|
91
192
|
def add_browsers(*browsers)
|
92
193
|
browsers = case browsers.first
|
93
194
|
when Applitools::Selenium::IRenderBrowserInfo
|
@@ -101,6 +202,23 @@ module Applitools
|
|
101
202
|
self
|
102
203
|
end
|
103
204
|
|
205
|
+
# Adds a Chrome device emulation configuration for visual grid testing.
|
206
|
+
#
|
207
|
+
# This method configures the visual grid to render using Chrome's device emulation mode,
|
208
|
+
# which simulates various mobile devices in desktop Chrome. This is useful for testing
|
209
|
+
# responsive designs across different device profiles.
|
210
|
+
#
|
211
|
+
# @param [Symbol] device_name The device to emulate, must be one of the values in Devices.enum_values
|
212
|
+
# @param [Symbol] orientation The screen orientation, defaults to portrait
|
213
|
+
#
|
214
|
+
# @example Add iPhone X emulation
|
215
|
+
# config.add_device_emulation(Devices::iPhone_X)
|
216
|
+
#
|
217
|
+
# @example Add iPad emulation in landscape mode
|
218
|
+
# config.add_device_emulation(Devices::iPad, Orientations::LANDSCAPE)
|
219
|
+
#
|
220
|
+
# @raise [Applitools::EyesIllegalArgument] if device_name is not in the list of supported devices
|
221
|
+
# @return [Configuration] self for method chaining
|
104
222
|
def add_device_emulation(device_name, orientation = Orientations::PORTRAIT)
|
105
223
|
Applitools::ArgumentGuard.not_nil device_name, 'device_name'
|
106
224
|
raise Applitools::EyesIllegalArgument, 'Wrong device name!' unless Devices.enum_values.include? device_name
|
@@ -108,10 +226,25 @@ module Applitools
|
|
108
226
|
add_browser emu
|
109
227
|
end
|
110
228
|
|
229
|
+
# Adds a single mobile device configuration for visual grid testing.
|
230
|
+
#
|
231
|
+
# This is a convenience method that delegates to add_mobile_devices.
|
232
|
+
#
|
233
|
+
# @param [IRenderBrowserInfo] mobile_device_info The mobile device configuration
|
234
|
+
# @return [Configuration] self for method chaining
|
235
|
+
# @see #add_mobile_devices
|
111
236
|
def add_mobile_device(mobile_device_info)
|
112
237
|
add_mobile_devices(mobile_device_info)
|
113
238
|
end
|
114
239
|
|
240
|
+
# Adds multiple mobile device configurations for visual grid testing.
|
241
|
+
#
|
242
|
+
# This method is a semantic alias for add_browsers that makes code more readable
|
243
|
+
# when specifically adding mobile device configurations.
|
244
|
+
#
|
245
|
+
# @param [Array<IRenderBrowserInfo>] mobile_device_infos An array of mobile device configurations
|
246
|
+
# @return [Configuration] self for method chaining
|
247
|
+
# @see #add_browsers
|
115
248
|
def add_mobile_devices(mobile_device_infos)
|
116
249
|
add_browsers(mobile_device_infos)
|
117
250
|
end
|
@@ -128,16 +261,111 @@ module Applitools
|
|
128
261
|
|
129
262
|
private
|
130
263
|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
264
|
+
# Validates that a device name is a valid mobile device target name for the specified platform.
|
265
|
+
#
|
266
|
+
# @param [String, Symbol] device_name the name of the mobile device to validate
|
267
|
+
# @param [Symbol] platform the platform to validate against (:ios or :android)
|
268
|
+
# @raise [Applitools::EyesIllegalArgument] if the device name is not included in the list of valid device names
|
269
|
+
# @return [void]
|
270
|
+
def validate_mobile_device_target_name(device_name, platform)
|
271
|
+
return unless device_name
|
272
|
+
device_name = device_name.to_s
|
273
|
+
|
274
|
+
# If platform is nil or not recognized, raise an error
|
275
|
+
unless [:ios, :android].include?(platform)
|
276
|
+
raise Applitools::EyesIllegalArgument, "Invalid platform: #{platform}, must be :ios or :android"
|
277
|
+
end
|
278
|
+
|
279
|
+
case platform
|
280
|
+
when :ios
|
281
|
+
unless ::IosMultiDeviceTargetGenerated.enum_values.include?(device_name)
|
282
|
+
available_devices = ::IosMultiDeviceTargetGenerated.enum_values.join(", ")
|
283
|
+
raise Applitools::EyesIllegalArgument,
|
284
|
+
"Invalid iOS multi device target name: '#{device_name}'. " +
|
285
|
+
"Available iOS devices: #{available_devices}"
|
286
|
+
end
|
287
|
+
when :android
|
288
|
+
unless ::AndroidMultiDeviceTargetGenerated.enum_values.include?(device_name)
|
289
|
+
available_devices = ::AndroidMultiDeviceTargetGenerated.enum_values.join(", ")
|
290
|
+
raise Applitools::EyesIllegalArgument,
|
291
|
+
"Invalid Android multi device target name: '#{device_name}'. " +
|
292
|
+
"Available Android devices: #{available_devices}"
|
293
|
+
end
|
294
|
+
end
|
295
|
+
end
|
296
|
+
|
297
|
+
# Determines the platform (iOS or Android) based on the device name.
|
298
|
+
#
|
299
|
+
# @param [String, Symbol] device_name the name of the mobile device
|
300
|
+
# @return [Symbol] :ios or :android based on the device name pattern
|
301
|
+
# @raise [Applitools::EyesIllegalArgument] If device name is not officially supported
|
302
|
+
# @api private
|
303
|
+
def detect_platform(device_name)
|
304
|
+
return nil unless device_name
|
305
|
+
device_name = device_name.to_s
|
306
|
+
|
307
|
+
# Check if it's an officially supported iOS or Android devices
|
308
|
+
return :ios if ::IosMultiDeviceTargetGenerated.enum_values.include?(device_name)
|
309
|
+
return :android if ::AndroidMultiDeviceTargetGenerated.enum_values.include?(device_name)
|
310
|
+
|
311
|
+
# If not officially supported, raise an error
|
312
|
+
raise Applitools::EyesIllegalArgument,
|
313
|
+
"Device '#{device_name}' is not supported. Please use a device from " +
|
314
|
+
"IosMultiDeviceTargetGenerated or AndroidMultiDeviceTargetGenerated"
|
315
|
+
end
|
316
|
+
|
317
|
+
# Creates a mobile device info object based on the options.
|
318
|
+
#
|
319
|
+
# @param [Symbol, String, Hash] options Device name as Symbol/String or configuration hash
|
320
|
+
# @return [Applitools::Selenium::IosDeviceInfo, Applitools::Selenium::AndroidDeviceInfo]
|
321
|
+
# The appropriate device info object
|
322
|
+
# @api private
|
323
|
+
def create_mobile_device_info(options)
|
324
|
+
if options.is_a?(Symbol) || options.is_a?(String)
|
325
|
+
# If a symbol or string is passed, treat it as a device name
|
326
|
+
device_name = options.to_s
|
327
|
+
platform = detect_platform(device_name)
|
328
|
+
validate_mobile_device_target_name(device_name, platform)
|
329
|
+
|
330
|
+
if platform == :android
|
331
|
+
Applitools::Selenium::AndroidDeviceInfo.new(device_name: device_name)
|
332
|
+
else
|
333
|
+
Applitools::Selenium::IosDeviceInfo.new(device_name: device_name)
|
334
|
+
end
|
135
335
|
else
|
136
|
-
#
|
137
|
-
|
336
|
+
# For a hash, check if we have both device name and platform
|
337
|
+
device_name = options[:device_name]
|
338
|
+
platform = options[:platform]
|
339
|
+
|
340
|
+
# Handle case where platform is specified but device name is not
|
341
|
+
if !device_name && platform
|
342
|
+
raise Applitools::EyesIllegalArgument,
|
343
|
+
"When specifying a platform (:ios or :android), a device_name must also be provided"
|
344
|
+
end
|
345
|
+
|
346
|
+
# Either use the explicit platform or detect from device name
|
347
|
+
platform ||= detect_platform(device_name)
|
348
|
+
|
349
|
+
validate_mobile_device_target_name(device_name, platform)
|
350
|
+
|
351
|
+
if platform == :android
|
352
|
+
Applitools::Selenium::AndroidDeviceInfo.new(options)
|
353
|
+
else
|
354
|
+
Applitools::Selenium::IosDeviceInfo.new(options)
|
355
|
+
end
|
138
356
|
end
|
139
357
|
end
|
140
358
|
|
359
|
+
# Processes a device target and adds it to the configuration.
|
360
|
+
#
|
361
|
+
# This method handles iOS device targets, Android device targets, and regular device targets (emulated),
|
362
|
+
# converting them to the appropriate browser information objects.
|
363
|
+
#
|
364
|
+
# @param [Applitools::Selenium::IosDeviceTarget, Applitools::Selenium::AndroidDeviceTarget, Applitools::Selenium::DeviceTarget] target
|
365
|
+
# The device target to process
|
366
|
+
#
|
367
|
+
# @raise [Applitools::EyesIllegalArgument] If the target is not a valid device target
|
368
|
+
# @api private
|
141
369
|
def handle_device_target(target)
|
142
370
|
if target.is_a?(Applitools::Selenium::IosDeviceTarget)
|
143
371
|
ios_device_info = Applitools::Selenium::IosDeviceInfo.new(
|
@@ -146,6 +374,13 @@ module Applitools
|
|
146
374
|
ios_version: target.version
|
147
375
|
)
|
148
376
|
add_browser(ios_device_info)
|
377
|
+
elsif target.is_a?(Applitools::Selenium::AndroidDeviceTarget)
|
378
|
+
android_device_info = Applitools::Selenium::AndroidDeviceInfo.new(
|
379
|
+
device_name: target.device_name,
|
380
|
+
screen_orientation: target.screen_orientation,
|
381
|
+
android_version: target.version
|
382
|
+
)
|
383
|
+
add_browser(android_device_info)
|
149
384
|
elsif target.is_a?(Applitools::Selenium::DeviceTarget)
|
150
385
|
device_name = target.device_name
|
151
386
|
orientation = target.screen_orientation || Orientations::PORTRAIT
|
@@ -158,4 +393,4 @@ module Applitools
|
|
158
393
|
|
159
394
|
end
|
160
395
|
end
|
161
|
-
end
|
396
|
+
end
|
@@ -0,0 +1,91 @@
|
|
1
|
+
require_relative 'android_multi_device_target'
|
2
|
+
require_relative 'i_render_browser_info'
|
3
|
+
require_relative 'emulation_base_info'
|
4
|
+
require_relative '../orientations'
|
5
|
+
require_relative '../browser_types'
|
6
|
+
|
7
|
+
module Applitools
|
8
|
+
module Selenium
|
9
|
+
# AndroidDeviceInfo represents configuration for Android devices in mobile app testing
|
10
|
+
class AndroidDeviceInfo < Applitools::Selenium::IRenderBrowserInfo
|
11
|
+
# Default configuration for Android devices
|
12
|
+
DEFAULT_CONFIG = proc do
|
13
|
+
{
|
14
|
+
platform: 'android',
|
15
|
+
# Note: Browser type is less relevant for mobile app testing but kept for API consistency
|
16
|
+
browser_type: BrowserType::CHROME,
|
17
|
+
viewport_size: Applitools::RectangleSize.from_any_argument(width: 0, height: 0)
|
18
|
+
}
|
19
|
+
end
|
20
|
+
|
21
|
+
object_field :android_device_info, Applitools::Selenium::EmulationBaseInfo
|
22
|
+
|
23
|
+
class << self
|
24
|
+
def default_config
|
25
|
+
DEFAULT_CONFIG.call
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
# Initialize with device name, orientation, and version
|
30
|
+
# @param [Hash] options
|
31
|
+
# @option options [String] :device_name The Android device name
|
32
|
+
# @option options [String] :screen_orientation ('portrait' or 'landscape')
|
33
|
+
# @option options [String] :android_version The Android OS version
|
34
|
+
def initialize(options = {})
|
35
|
+
super
|
36
|
+
self.android_device_info = EmulationInfo.new.tap do |ei|
|
37
|
+
ei.device_name = options[:device_name]
|
38
|
+
ei.screen_orientation = options[:screen_orientation] || options[:orientation] || Orientation::PORTRAIT
|
39
|
+
ei.version = options[:android_version] || options[:version] || 'latest'
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
# String representation of the Android device
|
44
|
+
# @return [String]
|
45
|
+
def to_s
|
46
|
+
"#{android_device_info.device_name} - #{android_device_info.screen_orientation}"
|
47
|
+
end
|
48
|
+
|
49
|
+
# Get the device name
|
50
|
+
# @return [String]
|
51
|
+
def device_name
|
52
|
+
android_device_info.device_name
|
53
|
+
end
|
54
|
+
|
55
|
+
# Convert to hash for API requests
|
56
|
+
# @return [Hash]
|
57
|
+
def to_hash
|
58
|
+
{androidDeviceInfo: android_device_info.to_hash}
|
59
|
+
end
|
60
|
+
|
61
|
+
private
|
62
|
+
|
63
|
+
# Inner class for Android device information
|
64
|
+
class EmulationInfo < EmulationBaseInfo
|
65
|
+
enum_field :device_name, AndroidMultiDeviceTargetGenerated.enum_values
|
66
|
+
enum_field :screen_orientation, Orientation.enum_values
|
67
|
+
string_field :version
|
68
|
+
|
69
|
+
# Create JSON data for API requests
|
70
|
+
# @return [Hash]
|
71
|
+
def json_data
|
72
|
+
{
|
73
|
+
name: device_name,
|
74
|
+
screenOrientation: screen_orientation,
|
75
|
+
version: version || 'latest'
|
76
|
+
}
|
77
|
+
end
|
78
|
+
|
79
|
+
# Convert to hash for API requests
|
80
|
+
# @return [Hash]
|
81
|
+
def to_hash
|
82
|
+
{
|
83
|
+
deviceName: device_name,
|
84
|
+
screenOrientation: screen_orientation,
|
85
|
+
androidVersion: version || 'latest'
|
86
|
+
}
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Applitools
|
4
|
+
module Selenium
|
5
|
+
# Represents an Android device target for mobile app testing
|
6
|
+
# Used in conjunction with the Visual Grid to render mobile app screenshots
|
7
|
+
# on specific Android device configurations
|
8
|
+
class AndroidDeviceTarget
|
9
|
+
attr_reader :device_name, :screen_orientation, :version
|
10
|
+
|
11
|
+
# Initialize a new Android device target
|
12
|
+
# @param [String] device_name The name of the Android device from AndroidMultiDeviceTargetGenerated
|
13
|
+
# @param [Hash] options Additional configuration options
|
14
|
+
# @option options [String] :screen_orientation ('portrait' or 'landscape')
|
15
|
+
# @option options [String] :orientation Alias for screen_orientation
|
16
|
+
# @option options [String] :android_version The Android OS version to use
|
17
|
+
# @option options [String] :version Alias for android_version
|
18
|
+
def initialize(device_name, options = {})
|
19
|
+
@device_name = device_name
|
20
|
+
@screen_orientation = options[:screen_orientation] || options[:orientation]
|
21
|
+
@version = options[:android_version] || options[:version]
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# GENERATED FILE #
|
2
|
+
|
3
|
+
module AndroidMultiDeviceTargetGenerated
|
4
|
+
extend self
|
5
|
+
Galaxy_S25 = 'Galaxy S25'.freeze
|
6
|
+
Galaxy_S25_Ultra = 'Galaxy S25 Ultra'.freeze
|
7
|
+
Pixel_9 = 'Pixel 9'.freeze
|
8
|
+
|
9
|
+
def enum_values
|
10
|
+
[
|
11
|
+
Galaxy_S25,
|
12
|
+
Galaxy_S25_Ultra,
|
13
|
+
Pixel_9,
|
14
|
+
]
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# GENERATED FILE #
|
2
|
+
|
3
|
+
module IosMultiDeviceTargetGenerated
|
4
|
+
extend self
|
5
|
+
IPhone_SE_3 = 'iPhone SE (3rd generation)'.freeze
|
6
|
+
IPhone_SE_2 = 'iPhone SE (2nd generation)'.freeze
|
7
|
+
IPhone_8 = 'iPhone 8'.freeze
|
8
|
+
IPhone_8_Plus = 'iPhone 8 Plus'.freeze
|
9
|
+
IPhone_13_mini = 'iPhone 13 mini'.freeze
|
10
|
+
IPhone_12_mini = 'iPhone 12 mini'.freeze
|
11
|
+
IPhone_11_Pro = 'iPhone 11 Pro'.freeze
|
12
|
+
IPhone_X = 'iPhone X'.freeze
|
13
|
+
IPhone_XR = 'iPhone XR'.freeze
|
14
|
+
IPhone_Xs = 'iPhone Xs'.freeze
|
15
|
+
IPhone_Xs_Max = 'iPhone Xs Max'.freeze
|
16
|
+
IPhone_11 = 'iPhone 11'.freeze
|
17
|
+
IPhone_11_Pro_Max = 'iPhone 11 Pro Max'.freeze
|
18
|
+
IPhone_12 = 'iPhone 12'.freeze
|
19
|
+
IPhone_12_Pro = 'iPhone 12 Pro'.freeze
|
20
|
+
IPhone_12_Pro_Max = 'iPhone 12 Pro Max'.freeze
|
21
|
+
IPhone_13 = 'iPhone 13'.freeze
|
22
|
+
IPhone_13_Pro = 'iPhone 13 Pro'.freeze
|
23
|
+
IPhone_13_Pro_Max = 'iPhone 13 Pro Max'.freeze
|
24
|
+
IPhone_14 = 'iPhone 14'.freeze
|
25
|
+
IPhone_14_Pro = 'iPhone 14 Pro'.freeze
|
26
|
+
IPhone_14_Plus = 'iPhone 14 Plus'.freeze
|
27
|
+
IPhone_14_Pro_Max = 'iPhone 14 Pro Max'.freeze
|
28
|
+
|
29
|
+
def enum_values
|
30
|
+
[
|
31
|
+
IPhone_SE_3,
|
32
|
+
IPhone_SE_2,
|
33
|
+
IPhone_8,
|
34
|
+
IPhone_8_Plus,
|
35
|
+
IPhone_13_mini,
|
36
|
+
IPhone_12_mini,
|
37
|
+
IPhone_11_Pro,
|
38
|
+
IPhone_X,
|
39
|
+
IPhone_XR,
|
40
|
+
IPhone_Xs,
|
41
|
+
IPhone_Xs_Max,
|
42
|
+
IPhone_11,
|
43
|
+
IPhone_11_Pro_Max,
|
44
|
+
IPhone_12,
|
45
|
+
IPhone_12_Pro,
|
46
|
+
IPhone_12_Pro_Max,
|
47
|
+
IPhone_13,
|
48
|
+
IPhone_13_Pro,
|
49
|
+
IPhone_13_Pro_Max,
|
50
|
+
IPhone_14,
|
51
|
+
IPhone_14_Pro,
|
52
|
+
IPhone_14_Plus,
|
53
|
+
IPhone_14_Pro_Max,
|
54
|
+
]
|
55
|
+
end
|
56
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eyes_selenium
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Applitools Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-07-
|
11
|
+
date: 2025-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eyes_core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 6.8.
|
19
|
+
version: 6.8.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 6.8.
|
26
|
+
version: 6.8.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: selenium-webdriver
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,6 +142,9 @@ files:
|
|
142
142
|
- lib/applitools/selenium/test_list.rb
|
143
143
|
- lib/applitools/selenium/viewport_screenshot.rb
|
144
144
|
- lib/applitools/selenium/viewport_size.rb
|
145
|
+
- lib/applitools/selenium/visual_grid/android_device_info.rb
|
146
|
+
- lib/applitools/selenium/visual_grid/android_device_target.rb
|
147
|
+
- lib/applitools/selenium/visual_grid/android_multi_device_target.rb
|
145
148
|
- lib/applitools/selenium/visual_grid/chrome_emulation_info.rb
|
146
149
|
- lib/applitools/selenium/visual_grid/desktop_browser_info.rb
|
147
150
|
- lib/applitools/selenium/visual_grid/dom_snapshot_script.rb
|
@@ -151,6 +154,7 @@ files:
|
|
151
154
|
- lib/applitools/selenium/visual_grid/ios_device_info.rb
|
152
155
|
- lib/applitools/selenium/visual_grid/ios_device_name.rb
|
153
156
|
- lib/applitools/selenium/visual_grid/ios_device_name_generated.rb
|
157
|
+
- lib/applitools/selenium/visual_grid/ios_multi_device_target.rb
|
154
158
|
- lib/applitools/selenium/visual_grid/render_browser_info.rb
|
155
159
|
- lib/applitools/selenium/visual_grid/render_info.rb
|
156
160
|
- lib/applitools/selenium/visual_grid/render_request.rb
|