appium-xcuitest-driver
Version:
Appium driver for iOS using XCUITest for backend
38 lines • 1.6 kB
TypeScript
import type { XCUITestDriver } from '../driver';
import type { Location } from '@appium/types';
import type { LocationWithAltitude } from './types';
/**
* Returns location of the device under test.
* The device under test must allow the location services for WDA
* as 'Always' to get the location data correctly.
*
* The 'latitude', 'longitude' and 'altitude' could be zero even
* if the Location Services are set to 'Always', because the device
* needs some time to update the location data.
*
* For iOS 17, the return value could be the result of
* "mobile:getSimulatedLocation" if the simulated location has been previously set
* "mobile:setSimulatedLocation" already.
*
* @returns Location with altitude
* @throws {Error} If the device under test returns an error message.
* i.e.: tvOS returns unsupported error
*/
export declare function getGeoLocation(this: XCUITestDriver): Promise<LocationWithAltitude>;
/**
* Set location of the device under test.
*
* iOS 17+ real device environment will be via "mobile:setSimulatedLocation" as
* setting simulated location for XCTest session.
*
* @param location - Location with latitude and longitude
*/
export declare function setGeoLocation(this: XCUITestDriver, location: Partial<Location>): Promise<Location>;
/**
* Reset the location service on real device.
*
* @throws {Error} If the device is simulator and iOS version is below 17,
* or 'resetLocation' raises an error.
*/
export declare function mobileResetLocationService(this: XCUITestDriver): Promise<void>;
//# sourceMappingURL=location.d.ts.map