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: Add a possibility to retrieve the clipboard content on Android 10 #473

Merged
merged 2 commits into from
Nov 15, 2019

Conversation

mykola-mokhnach
Copy link
Contributor

The part of appium/appium#13466 implementation

@mykola-mokhnach mykola-mokhnach merged commit 7495f1d into appium:master Nov 15, 2019
@mykola-mokhnach mykola-mokhnach deleted the get_clip branch November 15, 2019 17:55
if (!match) {
throw new Error(`Cannot parse the actual cliboard content from the command output: ${output}`);
}
return Buffer.from(_.trim(match[1]), 'base64').toString('utf8');
Copy link
Member

@KazuCocoa KazuCocoa Nov 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed here should have been passed without decoding since the endpoint expected Base 64 encoded string.

# Current
[17] pry(#<AppiumLibCoreTest::Android::DeviceTest>)> c = @driver.get_clipboard
=> "\x85\xAAi\xCA\xD7\xAC\xB6)\xE0"

# Here returns `_.trim(match[1]`
[18] pry(#<AppiumLibCoreTest::Android::DeviceTest>)> @driver = @@core.start_driver
=> #<Appium::Core::Base::Driver:0x..fee76647dbb527b8e browser="unknown">
[19] pry(#<AppiumLibCoreTest::Android::DeviceTest>)> c = @driver.get_clipboard
=> "happy testing"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, will fix

thanks for checking it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants