UNPKG

appium-xcuitest-driver

Version:

Appium driver for iOS using XCUITest for backend

53 lines 2.33 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const lodash_1 = __importDefault(require("lodash")); const utils_1 = require("../utils"); const assertSimulator = lodash_1.default.partial(utils_1.assertSimulator, 'Biometric enrollment'); exports.default = { /** * Enrolls biometric authentication on a simulated device. * * @param {boolean} isEnabled - Whether to enable/disable biometric enrollment. * @throws {Error} If enrollment fails or the device is not a Simulator. * @group Simulator Only * @this {XCUITestDriver} */ async mobileEnrollBiometric(isEnabled = true) { assertSimulator(this); await /** @type {import('../driver').Simulator} */ (this.device).enrollBiometric(isEnabled); }, /** * Emulates biometric match or non-match event on a simulated device. * * The biometric feature is expected to be already enrolled via {@linkcode mobileEnrollBiometric|mobile: enrollBiometric} before executing this. * * @param {import('./types').BiometricFeature} type - The biometric feature name. * @param {boolean} match - If `true`, simulate biometic match. If `false`, simulate biometric non-match. * @throws {Error} If matching fails or the device is not a Simulator. * @group Simulator Only * @this {XCUITestDriver} */ async mobileSendBiometricMatch(type = 'touchId', match = true) { assertSimulator(this); await /** @type {import('../driver').Simulator} */ (this.device).sendBiometricMatch(match, type); }, /** * Checks whether the biometric feature is currently enrolled on a simulated device. * * @returns {Promise<boolean>} `true` if biometric is enrolled. * @throws {Error} If the detection fails or the device is not a Simulator. * @group Simulator Only * @this {XCUITestDriver} */ async mobileIsBiometricEnrolled() { assertSimulator(this); return await /** @type {import('../driver').Simulator} */ (this.device).isBiometricEnrolled(); }, }; /** * @typedef {import('../driver').XCUITestDriver} XCUITestDriver */ //# sourceMappingURL=biometric.js.map