diff --git a/docs/reference/execute-methods.md b/docs/reference/execute-methods.md index 1eae5f7be..b4abde47e 100644 --- a/docs/reference/execute-methods.md +++ b/docs/reference/execute-methods.md @@ -637,6 +637,32 @@ Name | Type | Required | Description | Example --- | --- | --- | --- | --- style | string | yes | Either `light` or `dark` | dark +### mobile: getClipboard + +Gets the content of the primary clipboard on the device under test. + +#### Arguments + +Name | Type | Required | Description | Example +--- | --- | --- | --- | --- +contentType | string | no | `plaintext` (default), `image` or `url` | image + +#### Returned Result + +The actual clipboard content encoded into base64 string. +An empty string is returned if the clipboard contains no data. + +### mobile: setClipboard + +Sets the primary clipboard's content on the device under test. + +#### Arguments + +Name | Type | Required | Description | Example +--- | --- | --- | --- | --- +content| string | yes | The content to be set as base64-encoded string. | QXBwaXVt +contentType | string | no | `plaintext` (default), `image` or `url` | image + ### mobile: siriCommand Presents the Siri UI, if it is not currently active, and accepts a string which is then processed as if it were recognized speech. Check the documentation on [activateWithVoiceRecognitionText](https://developer.apple.com/documentation/xctest/xcuisiriservice/2852140-activatewithvoicerecognitiontext?language=objc) XCTest method for more details. diff --git a/lib/execute-method-map.ts b/lib/execute-method-map.ts index 11c28bd7c..f40fcb39c 100644 --- a/lib/execute-method-map.ts +++ b/lib/execute-method-map.ts @@ -333,6 +333,19 @@ export const executeMethodMap = { required: ['style'], }, }, + 'mobile: getClipboard': { + command: 'getClipboard', + params: { + optional: ['contentType'], + }, + }, + 'mobile: setClipboard': { + command: 'setClipboard', + params: { + required: ['content'], + optional: ['contentType'], + }, + }, 'mobile: siriCommand': { command: 'mobileSiriCommand', params: {