Issue
I want to select a text inside edittext so that I can check copy and paste option using Espresso. What I have tried is ,
onView(withText("text")).perform(longClick());
This will perform a long click in Edittext. But text is not selected.
Solution
for simple "catching" part of text you would use Hamcrest
matchers like containsString()
, startsWith()
, endsWith()
.
Although,as you said, you need to match a specific text to copy
it and paste
it in another place.
I think it might be pretty impossible to test it with Espresso. You may need to take this action another UI testing tool called uiatomator
.
uiatomator
, another great tools made by Google allows you to test your Android system functions like notifications, screen lock or copy and paste operations. It's working pretty well with Espresso
test framework.
For finding more info, please read this article:
http://qathread.blogspot.com/2015/05/espresso-uiautomator-perfect-tandem.html
and uiautomator documentation, which you would find here.
Hope it help.
Answered By - piotrek1543
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.