Reputation: 139
Im trying to use the paste function when I longclick on a text input and the "paste" option appears. I have tried to click with
onView(withText("Paste"))
.perform(click(), pressImeActionButton());
using espresso but it does not work. How can i click the little paste prompt that appears?
Upvotes: 2
Views: 287
Reputation: 18012
It's not exactly what you were asking for but given that I don't think it's possible to do this with Espresso you might consider doing (ctrl + v) to perform paste in UIAutomator in your tests:
UiDevice
.getInstance(InstrumentationRegistry.getInstrumentation())
.pressKeyCode(KeyEvent.KEYCODE_V, KeyEvent.META_CTRL_MASK)
You might want to have a look at the Espresso & UIAutomator - the perfect tandem article.
Upvotes: 2