UNPKG

appium-xcuitest-driver

Version:

Appium driver for iOS using XCUITest for backend

26 lines 883 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.requireSimulator = requireSimulator; exports.requireRealDevice = requireRealDevice; const utils_1 = require("../../utils"); /** * Requires that the given driver is running on a Simulator and return * the simulator instance. */ function requireSimulator(driver, action) { if (!driver.isSimulator()) { throw new Error(`${(0, utils_1.upperFirst)(action)} can only be performed on Simulator`); } return driver.device; } /** * Requires that the given driver is running on a real device and return * the real device instance. */ function requireRealDevice(driver, action) { if (!driver.isRealDevice()) { throw new Error(`${(0, utils_1.upperFirst)(action)} can only be performed on a real device`); } return driver.device; } //# sourceMappingURL=guards.js.map