UNPKG

appium-xcuitest-driver

Version:

Appium driver for iOS using XCUITest for backend

41 lines 1.58 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.mobileGetSimulatedLocation = mobileGetSimulatedLocation; exports.mobileSetSimulatedLocation = mobileSetSimulatedLocation; exports.mobileResetSimulatedLocation = mobileResetSimulatedLocation; /** * Retrieves the simulated geolocation value. * Only works since Xcode 14.3/iOS 16.4 * * @returns The current simulated geolocation * @throws If the device under test does not support geolocation simulation. * @since 4.18 */ async function mobileGetSimulatedLocation() { return await this.proxyCommand('/wda/simulatedLocation', 'GET'); } /** * Sets simulated geolocation value. * Only works since Xcode 14.3/iOS 16.4 * * @param latitude - Latitude value * @param longitude - Longitude value * @throws If the device under test does not support geolocation simulation. * @since 4.18 */ async function mobileSetSimulatedLocation(latitude, longitude) { await this.proxyCommand('/wda/simulatedLocation', 'POST', { latitude, longitude }); } /** * Resets simulated geolocation value. * Only works since Xcode 14.3/iOS 16.4. * ! Do not forget to reset the simulated geolocation value after your automated test is finished. * ! If the value is not reset explicitly then the simulated one will remain until the next device restart. * * @throws If the device under test does not support geolocation simulation. * @since 4.18 */ async function mobileResetSimulatedLocation() { await this.proxyCommand('/wda/simulatedLocation', 'DELETE'); } //# sourceMappingURL=geolocation.js.map