UNPKG

appium-xcuitest-driver

Version:

Appium driver for iOS using XCUITest for backend

39 lines 1.43 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.mobileSetPasteboard = mobileSetPasteboard; exports.mobileGetPasteboard = mobileGetPasteboard; const lodash_1 = __importDefault(require("lodash")); const utils_1 = require("../utils"); /** * Sets the Simulator's pasteboard content to the given value. * * Does not work for real devices. * * @param content - The content to set * @param encoding - The content's encoding * @group Simulator Only */ async function mobileSetPasteboard(content, encoding = 'utf8') { const simulator = (0, utils_1.requireSimulator)(this, 'Setting pasteboard content'); if (!lodash_1.default.isString(content)) { // can be empty string throw new Error('Pasteboard content is mandatory to set'); } await simulator.simctl.setPasteboard(content, encoding); } /** * Gets the Simulator's pasteboard content. * * Does not work for real devices. * * @param encoding - Expected encoding of returned string * @group Simulator Only * @returns The pasteboard content string */ async function mobileGetPasteboard(encoding = 'utf8') { return await (0, utils_1.requireSimulator)(this, 'Getting pasteboard content').simctl.getPasteboard(encoding); } //# sourceMappingURL=pasteboard.js.map