Class: Applitools::Selenium::AndroidDeviceInfo
- Inherits:
-
IRenderBrowserInfo
- Object
- AbstractConfiguration
- IRenderBrowserInfo
- Applitools::Selenium::AndroidDeviceInfo
- Defined in:
- lib/applitools/selenium/visual_grid/android_device_info.rb
Overview
AndroidDeviceInfo represents configuration for Android devices in mobile app testing
Defined Under Namespace
Classes: EmulationInfo
Constant Summary collapse
- DEFAULT_CONFIG =
Default configuration for Android devices
proc do { platform: 'android', # Note: Browser type is less relevant for mobile app testing but kept for API consistency browser_type: BrowserType::CHROME, viewport_size: Applitools::RectangleSize.from_any_argument(width: 0, height: 0) } end
Class Method Summary collapse
Instance Method Summary collapse
-
#device_name ⇒ String
Get the device name.
-
#initialize(options = {}) ⇒ AndroidDeviceInfo
constructor
Initialize with device name, orientation, and version.
-
#to_hash ⇒ Hash
Convert to hash for API requests.
-
#to_s ⇒ String
String representation of the Android device.
Constructor Details
#initialize(options = {}) ⇒ AndroidDeviceInfo
Initialize with device name, orientation, and version
34 35 36 37 38 39 40 41 |
# File 'lib/applitools/selenium/visual_grid/android_device_info.rb', line 34 def initialize( = {}) super self.android_device_info = EmulationInfo.new.tap do |ei| ei.device_name = [:device_name] ei.screen_orientation = [:screen_orientation] || [:orientation] || Orientation::PORTRAIT ei.version = [:android_version] || [:version] || 'latest' end end |
Class Method Details
.default_config ⇒ Object
24 25 26 |
# File 'lib/applitools/selenium/visual_grid/android_device_info.rb', line 24 def default_config DEFAULT_CONFIG.call end |
Instance Method Details
#device_name ⇒ String
Get the device name
51 52 53 |
# File 'lib/applitools/selenium/visual_grid/android_device_info.rb', line 51 def device_name android_device_info.device_name end |
#to_hash ⇒ Hash
Convert to hash for API requests
57 58 59 |
# File 'lib/applitools/selenium/visual_grid/android_device_info.rb', line 57 def to_hash {androidDeviceInfo: android_device_info.to_hash} end |
#to_s ⇒ String
String representation of the Android device
45 46 47 |
# File 'lib/applitools/selenium/visual_grid/android_device_info.rb', line 45 def to_s "#{android_device_info.device_name} - #{android_device_info.screen_orientation}" end |