UNPKG

appium-xcuitest-driver

Version:

Appium driver for iOS using XCUITest for backend

33 lines 1.68 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.mobileSetIncreaseContrast = mobileSetIncreaseContrast; exports.mobileGetIncreaseContrast = mobileGetIncreaseContrast; const helpers_1 = require("./helpers"); const driver_1 = require("appium/driver"); const INCREASE_CONTRAST_CONFIG = ['enabled', 'disabled']; /** * Sets the increase contrast configuration for the given simulator. * * @since Xcode 15 (but lower xcode could have this command) * @param increaseContrast - Valid increase contrast configuration value. * Acceptable value is 'enabled' or 'disabled' with Xcode 16.2. * @throws If the current platform does not support content size appearance changes */ async function mobileSetIncreaseContrast(increaseContrast) { if (!INCREASE_CONTRAST_CONFIG.includes(String(increaseContrast).toLowerCase())) { throw new driver_1.errors.InvalidArgumentError(`The 'increaseContrast' value is expected to be one of ${INCREASE_CONTRAST_CONFIG.join(',')}`); } await (0, helpers_1.requireSimulator)(this, 'Setting increase contrast').setIncreaseContrast(increaseContrast); } /** * Retrieves the current increase contrast configuration value from the given simulator. * * @since Xcode 15 (but lower xcode could have this command) * @returns The contrast configuration value. * Possible return value is 'enabled', 'disabled', * 'unsupported' or 'unknown' with Xcode 16.2. */ async function mobileGetIncreaseContrast() { return (await (0, helpers_1.requireSimulator)(this, 'Getting increase contrast').getIncreaseContrast()); } //# sourceMappingURL=increase-contrast.js.map