appium-xcuitest-driver
Version:
Appium driver for iOS using XCUITest for backend
37 lines • 1.87 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.mobileSetIncreaseContrast = mobileSetIncreaseContrast;
exports.mobileGetIncreaseContrast = mobileGetIncreaseContrast;
const lodash_1 = __importDefault(require("lodash"));
const utils_1 = require("../utils");
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(lodash_1.default.lowerCase(increaseContrast))) {
throw new driver_1.errors.InvalidArgumentError(`The 'increaseContrast' value is expected to be one of ${INCREASE_CONTRAST_CONFIG.join(',')}`);
}
await (0, utils_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, utils_1.requireSimulator)(this, 'Getting increase contrast').getIncreaseContrast());
}
//# sourceMappingURL=increase-contrast.js.map