Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update clipboard retrieval for Android 10+ #512

Merged
merged 2 commits into from
Nov 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/commands/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ commands.reset = async function reset () {
throw new errors.UnsupportedOperationError('Please quit the session and create a new session in order to close and launch the application under test');
};

commands.getClipboard = async function getClipboard () {
return (await this.adb.getApiLevel() < 29)
? (await this.espresso.jwproxy.command('/appium/device/get_clipboard', 'POST', {}))
: (await this.adb.getClipboard());
};

commands.mobilePerformEditorAction = async function mobilePerformEditorAction (opts = {}) {
const {action} = assertRequiredOptions(opts, ['action']);
return await this.espresso.jwproxy.command('/appium/device/perform_editor_action', 'POST', {action});
Expand Down
1 change: 1 addition & 0 deletions lib/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const NO_PROXY = [
['POST', new RegExp('^/session/[^/]+/appium/device/activate_app')],
['POST', new RegExp('^/session/[^/]+/appium/device/app_installed')],
['POST', new RegExp('^/session/[^/]+/appium/device/app_state')],
['POST', new RegExp('^/session/[^/]+/appium/device/get_clipboard')],
['POST', new RegExp('^/session/[^/]+/appium/device/install_app')],
['POST', new RegExp('^/session/[^/]+/appium/device/is_locked')],
['POST', new RegExp('^/session/[^/]+/appium/device/lock')],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
],
"dependencies": {
"@babel/runtime": "^7.4.3",
"appium-adb": "^7.0.0",
"appium-adb": "^7.15.1",
"appium-android-driver": "^4.12.0",
"appium-base-driver": "^4.0.0",
"appium-support": "^2.20.0",
Expand Down