class Playwright::AndroidDevice

`AndroidDevice` represents a connected device, either real hardware or emulated. Devices can be obtained using [`method: Android.devices`].

Public Instance Methods

close() click to toggle source

Disconnects from the device.

# File lib/playwright_api/android_device.rb, line 11
def close
  wrap_impl(@impl.close)
end
default_timeout=(timeout)
Alias for: set_default_timeout
drag(selector, dest, speed: nil) click to toggle source

Drags the widget defined by `selector` towards `dest` point.

# File lib/playwright_api/android_device.rb, line 16
def drag(selector, dest, speed: nil)
  raise NotImplementedError.new('drag is not implemented yet.')
end
fill(selector, text) click to toggle source

Fills the specific `selector` input box with `text`.

# File lib/playwright_api/android_device.rb, line 21
def fill(selector, text)
  raise NotImplementedError.new('fill is not implemented yet.')
end
fling(selector, direction, speed: nil) click to toggle source

Flings the widget defined by `selector` in the specified `direction`.

# File lib/playwright_api/android_device.rb, line 26
def fling(selector, direction, speed: nil)
  raise NotImplementedError.new('fling is not implemented yet.')
end
info(selector) click to toggle source

Returns information about a widget defined by `selector`.

# File lib/playwright_api/android_device.rb, line 31
def info(selector)
  wrap_impl(@impl.info(unwrap_impl(selector)))
end
input() click to toggle source
# File lib/playwright_api/android_device.rb, line 6
def input # property
  wrap_impl(@impl.input)
end
install_apk(file, args: nil) click to toggle source

Installs an apk on the device.

# File lib/playwright_api/android_device.rb, line 36
def install_apk(file, args: nil)
  raise NotImplementedError.new('install_apk is not implemented yet.')
end
launch_browser( acceptDownloads: nil, baseURL: nil, bypassCSP: nil, colorScheme: nil, command: nil, deviceScaleFactor: nil, extraHTTPHeaders: nil, geolocation: nil, hasTouch: nil, httpCredentials: nil, ignoreHTTPSErrors: nil, isMobile: nil, javaScriptEnabled: nil, locale: nil, noViewport: nil, offline: nil, permissions: nil, record_har_omit_content: nil, record_har_path: nil, record_video_dir: nil, record_video_size: nil, reducedMotion: nil, screen: nil, timezoneId: nil, userAgent: nil, viewport: nil, &block) click to toggle source

Launches Chrome browser on the device, and returns its persistent context.

# File lib/playwright_api/android_device.rb, line 41
def launch_browser(
      acceptDownloads: nil,
      baseURL: nil,
      bypassCSP: nil,
      colorScheme: nil,
      command: nil,
      deviceScaleFactor: nil,
      extraHTTPHeaders: nil,
      geolocation: nil,
      hasTouch: nil,
      httpCredentials: nil,
      ignoreHTTPSErrors: nil,
      isMobile: nil,
      javaScriptEnabled: nil,
      locale: nil,
      noViewport: nil,
      offline: nil,
      permissions: nil,
      record_har_omit_content: nil,
      record_har_path: nil,
      record_video_dir: nil,
      record_video_size: nil,
      reducedMotion: nil,
      screen: nil,
      timezoneId: nil,
      userAgent: nil,
      viewport: nil,
      &block)
  wrap_impl(@impl.launch_browser(acceptDownloads: unwrap_impl(acceptDownloads), baseURL: unwrap_impl(baseURL), bypassCSP: unwrap_impl(bypassCSP), colorScheme: unwrap_impl(colorScheme), command: unwrap_impl(command), deviceScaleFactor: unwrap_impl(deviceScaleFactor), extraHTTPHeaders: unwrap_impl(extraHTTPHeaders), geolocation: unwrap_impl(geolocation), hasTouch: unwrap_impl(hasTouch), httpCredentials: unwrap_impl(httpCredentials), ignoreHTTPSErrors: unwrap_impl(ignoreHTTPSErrors), isMobile: unwrap_impl(isMobile), javaScriptEnabled: unwrap_impl(javaScriptEnabled), locale: unwrap_impl(locale), noViewport: unwrap_impl(noViewport), offline: unwrap_impl(offline), permissions: unwrap_impl(permissions), record_har_omit_content: unwrap_impl(record_har_omit_content), record_har_path: unwrap_impl(record_har_path), record_video_dir: unwrap_impl(record_video_dir), record_video_size: unwrap_impl(record_video_size), reducedMotion: unwrap_impl(reducedMotion), screen: unwrap_impl(screen), timezoneId: unwrap_impl(timezoneId), userAgent: unwrap_impl(userAgent), viewport: unwrap_impl(viewport), &wrap_block_call(block)))
end
long_tap(selector) click to toggle source

Performs a long tap on the widget defined by `selector`.

# File lib/playwright_api/android_device.rb, line 73
def long_tap(selector)
  raise NotImplementedError.new('long_tap is not implemented yet.')
end
model() click to toggle source

Device model.

# File lib/playwright_api/android_device.rb, line 78
def model
  wrap_impl(@impl.model)
end
off(event, callback) click to toggle source

– inherited from EventEmitter – @nodoc

# File lib/playwright_api/android_device.rb, line 189
def off(event, callback)
  event_emitter_proxy.off(event, callback)
end
on(event, callback) click to toggle source

– inherited from EventEmitter – @nodoc

# File lib/playwright_api/android_device.rb, line 183
def on(event, callback)
  event_emitter_proxy.on(event, callback)
end
once(event, callback) click to toggle source

– inherited from EventEmitter – @nodoc

# File lib/playwright_api/android_device.rb, line 177
def once(event, callback)
  event_emitter_proxy.once(event, callback)
end
open(command) click to toggle source

Launches a process in the shell on the device and returns a socket to communicate with the launched process.

# File lib/playwright_api/android_device.rb, line 83
def open(command)
  raise NotImplementedError.new('open is not implemented yet.')
end
pinch_close(selector, percent, speed: nil) click to toggle source

Pinches the widget defined by `selector` in the closing direction.

# File lib/playwright_api/android_device.rb, line 88
def pinch_close(selector, percent, speed: nil)
  raise NotImplementedError.new('pinch_close is not implemented yet.')
end
pinch_open(selector, percent, speed: nil) click to toggle source

Pinches the widget defined by `selector` in the open direction.

# File lib/playwright_api/android_device.rb, line 93
def pinch_open(selector, percent, speed: nil)
  raise NotImplementedError.new('pinch_open is not implemented yet.')
end
press(selector, key) click to toggle source

Presses the specific `key` in the widget defined by `selector`.

# File lib/playwright_api/android_device.rb, line 98
def press(selector, key)
  raise NotImplementedError.new('press is not implemented yet.')
end
push(file, path, mode: nil) click to toggle source

Copies a file to the device.

# File lib/playwright_api/android_device.rb, line 103
def push(file, path, mode: nil)
  raise NotImplementedError.new('push is not implemented yet.')
end
screenshot(path: nil) click to toggle source

Returns the buffer with the captured screenshot of the device.

# File lib/playwright_api/android_device.rb, line 108
def screenshot(path: nil)
  wrap_impl(@impl.screenshot(path: unwrap_impl(path)))
end
scroll(selector, direction, percent, speed: nil) click to toggle source

Scrolls the widget defined by `selector` in the specified `direction`.

# File lib/playwright_api/android_device.rb, line 113
def scroll(selector, direction, percent, speed: nil)
  raise NotImplementedError.new('scroll is not implemented yet.')
end
serial() click to toggle source

Device serial number.

# File lib/playwright_api/android_device.rb, line 118
def serial
  wrap_impl(@impl.serial)
end
set_default_timeout(timeout) click to toggle source

This setting will change the default maximum time for all the methods accepting `timeout` option.

# File lib/playwright_api/android_device.rb, line 123
def set_default_timeout(timeout)
  raise NotImplementedError.new('set_default_timeout is not implemented yet.')
end
Also aliased as: default_timeout=
shell(command) click to toggle source

Executes a shell command on the device and returns its output.

# File lib/playwright_api/android_device.rb, line 129
def shell(command)
  wrap_impl(@impl.shell(unwrap_impl(command)))
end
swipe(selector, direction, percent, speed: nil) click to toggle source

Swipes the widget defined by `selector` in the specified `direction`.

# File lib/playwright_api/android_device.rb, line 134
def swipe(selector, direction, percent, speed: nil)
  raise NotImplementedError.new('swipe is not implemented yet.')
end
tap_on(selector, duration: nil, timeout: nil) click to toggle source

@nodoc

# File lib/playwright_api/android_device.rb, line 166
def tap_on(selector, duration: nil, timeout: nil)
  wrap_impl(@impl.tap_on(unwrap_impl(selector), duration: unwrap_impl(duration), timeout: unwrap_impl(timeout)))
end
tap_point(selector, duration: nil) click to toggle source

Taps on the widget defined by `selector`.

# File lib/playwright_api/android_device.rb, line 139
def tap_point(selector, duration: nil)
  raise NotImplementedError.new('tap_point is not implemented yet.')
end
tree() click to toggle source

@nodoc

# File lib/playwright_api/android_device.rb, line 171
def tree
  wrap_impl(@impl.tree)
end
wait(selector, state: nil) click to toggle source

Waits for the specific `selector` to either appear or disappear, depending on the `state`.

# File lib/playwright_api/android_device.rb, line 144
def wait(selector, state: nil)
  raise NotImplementedError.new('wait is not implemented yet.')
end
wait_for_event(event, optionsOrPredicate: nil) click to toggle source

Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy value.

# File lib/playwright_api/android_device.rb, line 150
def wait_for_event(event, optionsOrPredicate: nil)
  raise NotImplementedError.new('wait_for_event is not implemented yet.')
end
web_view(selector) click to toggle source

This method waits until `AndroidWebView` matching the `selector` is opened and returns it. If there is already an open `AndroidWebView` matching the `selector`, returns immediately.

# File lib/playwright_api/android_device.rb, line 156
def web_view(selector)
  raise NotImplementedError.new('web_view is not implemented yet.')
end
web_views() click to toggle source

Currently open WebViews.

# File lib/playwright_api/android_device.rb, line 161
def web_views
  raise NotImplementedError.new('web_views is not implemented yet.')
end

Private Instance Methods

event_emitter_proxy() click to toggle source
# File lib/playwright_api/android_device.rb, line 193
        def event_emitter_proxy
  @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
end