UNPKG

appium-android-driver

Version:

Android UiAutomator and Chrome support for Appium

90 lines 4.03 kB
import type { AndroidDriver } from '../driver'; import type { ServiceType, GetConnectivityResult } from './types'; /** * Gets the current network connection state. * * @returns Promise that resolves to a number representing the network connection state. * The value is a bitmask where: * - Bit 0 (0b001) = Airplane mode * - Bit 1 (0b010) = Wi-Fi * - Bit 2 (0b100) = Data connection */ export declare function getNetworkConnection(this: AndroidDriver): Promise<number>; /** * Checks if Wi-Fi is enabled. * * @returns Promise that resolves to `true` if Wi-Fi is enabled, `false` otherwise. */ export declare function isWifiOn(this: AndroidDriver): Promise<boolean>; /** * Sets the connectivity state for Wi-Fi, data, and/or airplane mode. * * @since Android 12 (only real devices, emulators work in all APIs) * @param wifi Either to enable or disable Wi-Fi. * An unset value means to not change the state for the given service. * @param data Either to enable or disable mobile data connection. * An unset value means to not change the state for the given service. * @param airplaneMode Either to enable to disable the Airplane Mode. * An unset value means to not change the state for the given service. * @returns Promise that resolves when the connectivity state is set. * @throws {errors.InvalidArgumentError} If none of the options are provided. */ export declare function mobileSetConnectivity(this: AndroidDriver, wifi?: boolean, data?: boolean, airplaneMode?: boolean): Promise<void>; /** * Gets the connectivity state for one or more services. * * @param services One or more services to get the connectivity for. * @returns Promise that resolves to an object containing the connectivity state for the requested services. * @throws {errors.InvalidArgumentError} If any of the provided service names are not supported. */ export declare function mobileGetConnectivity(this: AndroidDriver, services?: ServiceType[] | ServiceType): Promise<GetConnectivityResult>; /** * Sets the network connection state using a bitmask. * * @since Android 12 (only real devices, emulators work in all APIs) * @param type A number representing the desired network connection state. * The value is a bitmask where: * - Bit 0 (0b001) = Airplane mode * - Bit 1 (0b010) = Wi-Fi * - Bit 2 (0b100) = Data connection * @returns Promise that resolves to the current network connection state after the change. */ export declare function setNetworkConnection(this: AndroidDriver, type: number): Promise<number>; /** * Sets the Wi-Fi state. * * @since Android 12 (only real devices, emulators work in all APIs) * @param isOn `true` to enable Wi-Fi, `false` to disable it. * @returns Promise that resolves when the Wi-Fi state is set. */ export declare function setWifiState(this: AndroidDriver, isOn: boolean): Promise<void>; /** * Sets the mobile data connection state. * * @since Android 12 (only real devices, emulators work in all APIs) * @param isOn `true` to enable mobile data, `false` to disable it. * @returns Promise that resolves when the data connection state is set. */ export declare function setDataState(this: AndroidDriver, isOn: boolean): Promise<void>; /** * Toggles the mobile data connection state. * * @since Android 12 (only real devices, emulators work in all APIs) * @returns Promise that resolves when the data connection state is toggled. */ export declare function toggleData(this: AndroidDriver): Promise<void>; /** * Toggles the Wi-Fi state. * * @since Android 12 (only real devices, emulators work in all APIs) * @returns Promise that resolves when the Wi-Fi state is toggled. */ export declare function toggleWiFi(this: AndroidDriver): Promise<void>; /** * Toggles the airplane mode state. * * @since Android 12 (only real devices, emulators work in all APIs) * @returns Promise that resolves when the airplane mode state is toggled. */ export declare function toggleFlightMode(this: AndroidDriver): Promise<void>; //# sourceMappingURL=network.d.ts.map