Sha256: 7d258b9217dfcce3475d85f76b98e2935f45eedfe3f64f20db118e8ae7db168f
Contents?: true
Size: 1.03 KB
Versions: 28
Compression:
Stored size: 1.03 KB
Contents
module Appium module Core module Android module Uiautomator2 module Device module Battery def self.add_methods ::Appium::Core::Device.add_endpoint_method(:battery_info) do def battery_info response = execute_script 'mobile: batteryInfo', {} state = case response['state'] when 2, 3, 4, 5 ::Appium::Core::Base::Device::BatteryStatus::ANDROID[response['state']] else ::Appium::Logger.warn("The state is unknown or undefined: #{response['state']}") ::Appium::Core::Base::Device::BatteryStatus::ANDROID[1] # :unknown end { state: state, level: response['level'] } end end end end # module Battery end # module Device end # module Uiautomator2 end # module Android end # module Core end # module Appium
Version data entries
28 entries across 28 versions & 1 rubygems