UNPKG

io.appium.settings

Version:
31 lines 1.5 kB
import type { SettingsApp } from '../client'; import type { Location } from './types'; /** * Emulate geolocation coordinates on the device under test. * The `altitude` value is ignored while mocking the position. * * @param location - Location object containing coordinates and optional metadata * @param isEmulator - Set it to true if the device under test is an emulator rather than a real device * @throws {Error} If required location values are missing or invalid */ export declare function setGeoLocation(this: SettingsApp, location: Location, isEmulator?: boolean): Promise<void>; /** * Get the current cached GPS location from the device under test. * * @returns The current location * @throws {Error} If the current location cannot be retrieved */ export declare function getGeoLocation(this: SettingsApp): Promise<Location>; /** * Sends an async request to refresh the GPS cache. * This feature only works if the device under test has * Google Play Services installed. In case the vanilla * LocationManager is used the device API level must be at * version 30 (Android R) or higher. * * @param timeoutMs The maximum number of milliseconds to block until GPS cache is refreshed. * Providing zero or a negative value to it skips waiting completely. * @throws {Error} If the GPS cache cannot be refreshed. */ export declare function refreshGeoLocationCache(this: SettingsApp, timeoutMs?: number): Promise<void>; //# sourceMappingURL=geolocation.d.ts.map