UNPKG

appium-xcuitest-driver

Version:

Appium driver for iOS using XCUITest for backend

35 lines 1.23 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.mobileSetPasteboard = mobileSetPasteboard; exports.mobileGetPasteboard = mobileGetPasteboard; const helpers_1 = require("./helpers"); /** * 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, helpers_1.requireSimulator)(this, 'Setting pasteboard content'); if (typeof content !== 'string') { // 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, helpers_1.requireSimulator)(this, 'Getting pasteboard content').simctl.getPasteboard(encoding); } //# sourceMappingURL=pasteboard.js.map