UNPKG

appium-ios-simulator

Version:
52 lines 1.74 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.shake = shake; exports.addCertificate = addCertificate; exports.pushNotification = pushNotification; /** * Perform Shake gesture on Simulator window. */ async function shake() { this.log.info(`Performing shake gesture on ${this.udid} Simulator`); await this.simctl.spawnProcess([ 'notifyutil', '-p', 'com.apple.UIKit.SimulatorShake' ]); } /** * Adds the given certificate to the booted simulator. * The simulator could be in both running and shutdown states * in order for this method to run as expected. * * @since Xcode 11.4 * @param payload the content of the PEM certificate * @param opts Certificate options * @returns True if the certificate was added successfully. */ async function addCertificate(payload, opts = {}) { const { isRoot = true, } = opts; const methodName = isRoot ? 'addRootCertificate' : 'addCertificate'; await this.simctl[methodName](payload, { raw: true }); return true; } /** * Simulates push notification delivery to the booted simulator * * @since Xcode SDK 11.4 * @param payload The object that describes Apple push notification content. * It must contain a top-level "Simulator Target Bundle" key with a string value matching * the target application's bundle identifier and "aps" key with valid Apple Push Notification values. * For example: * { * "Simulator Target Bundle": "com.apple.Preferences", * "aps": { * "alert": "This is a simulated notification!", * "badge": 3, * "sound": "default" * } * } */ async function pushNotification(payload) { await this.simctl.pushNotification(payload); } //# sourceMappingURL=misc.js.map