class Playwright::Android
An example of the Android automation script would be:
*How to run*
- We didn’t run all the tests against the device, so not everything works.
- Device needs to be awake to produce screenshots. Enabling “Stay awake” developer mode will help.
- Raw USB operation is not yet supported, so you need ADB.
*Known limitations*
- “Enable command line on non-rooted devices” enabled in ‘chrome://flags`.
- [`Chrome 87`](play.google.com/store/apps/details?id=com.android.chrome) or newer installed on the device
- [ADB daemon](developer.android.com/studio/command-line/adb) running and authenticated with your device. Typically running `adb devices` is all you need to do.
- Android device or AVD Emulator.
Requirements
Playwright has experimental support for Android automation. This includes Chrome for Android and Android WebView.
def connect(wsEndpoint, headers: nil, slowMo: nil, timeout: nil)
This methods attaches Playwright to an existing Android device.
def connect(wsEndpoint, headers: nil, slowMo: nil, timeout: nil) raise NotImplementedError.new('connect is not implemented yet.') end
def devices(host: nil, omitDriverInstall: nil, port: nil)
def devices(host: nil, omitDriverInstall: nil, port: nil) wrap_impl(@impl.devices(host: unwrap_impl(host), omitDriverInstall: unwrap_impl(omitDriverInstall), port: unwrap_impl(port))) end
def event_emitter_proxy
def event_emitter_proxy _emitter_proxy ||= EventEmitterProxy.new(self, @impl)
def off(event, callback)
-- inherited from EventEmitter --
def off(event, callback) event_emitter_proxy.off(event, callback) end
def on(event, callback)
-- inherited from EventEmitter --
def on(event, callback) event_emitter_proxy.on(event, callback) end
def once(event, callback)
-- inherited from EventEmitter --
def once(event, callback) event_emitter_proxy.once(event, callback) end
def set_default_timeout(timeout)
def set_default_timeout(timeout) raise NotImplementedError.new('set_default_timeout is not implemented yet.') end