Closed GoogleCodeExporter closed 9 years ago
I attached the output for the call
typeText("~!@#$%^&*()_+`=-[]{};:\";',.<>/?")
if that is of any help
Original comment by maik.vl...@vuzz.com
on 23 Oct 2013 at 7:37
Attachments:
This seems to be an IME specific issue. This IME has a different interpretation
of these special characters then what is expected (we get from
http://developer.android.com/reference/android/view/KeyCharacterMap.html)
As a workaround, you can setText directly on the EditText by using your own
ViewAction... something like this:
final class SetTextAction implements ViewAction {
private final String text;
SetTextAction(String text) {
this.text = checkNotNull(text);
}
@SuppressWarnings("unchecked")
@Override
public Matcher<View> getConstraints() {
return allOf(isDisplayed(), isAssignableFrom(EditText.class));
}
@Override
public void perform(UiController uiController, View view) {
((EditText) view).setText(text);
}
@Override
public String getDescription() {
return "set text";
}
}
We should probably add this to Espresso's ViewActions collection.
Original comment by vale...@google.com
on 23 Oct 2013 at 7:07
Thanks for the fast reply. I incorporated the suggested code and it works.
Thanks again
Original comment by maik.vl...@vuzz.com
on 24 Oct 2013 at 1:11
Original issue reported on code.google.com by
maik.vl...@vuzz.com
on 23 Oct 2013 at 7:16Attachments: