Issue
Try to click on FloatingActionButton in espresso tests.
onView(withId(R.id.actionButton)).perform(customClick())
My method customClick:
fun customClick(): ViewAction {
return actionWithAssertions(
CustomGeneralClickAction(Tap.SINGLE, GeneralLocation.VISIBLE_CENTER, Press.FINGER))
}
Also create class CustomGeneralClickAction with some changes:
Matcher<View> standardConstraint = isDisplayingAtLeast(60);
This example i take it from this answer. But have next error:
android.support.test.espresso.PerformException: Error performing 'single click' on view 'with id: com.fentury.android:id/actionButton'.
Caused by: android.support.test.espresso.PerformException: Error performing 'click (after 3 attempts)' on view 'unknown'.
And also here:
at com.fentury.android.acceptanceTests.utils.CustomGeneralClickAction.perform(CustomGeneralClickAction.java:79)
status = tapper.sendTap(uiController, coordinates, precision);
Solution
It should be onView(withId(R.id.floating_action_button)).perform(click());
Answered By - denys
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.