Reputation: 2715
I've been playing around with the espresso test recorder and reading the documentation
The documentation states:
Interact with your device to start logging events such as “tap” and “type” actions.
Is it possible to record swipe events like swiping on a view pager? I've been unable to find any examples of this being done, though I know it's still in beta.
Thanks
Upvotes: 1
Views: 1197
Reputation: 56
The only solution I know at the moment is to manually add that gesture to the generated test code.
onView(withId(R.id.xyz)).perform(swipeLeft());
Upvotes: 1
Reputation: 389
Recycler view particular item swap
ViewInteraction recyclerView = onView(allOf(withId(R.id.rc_vehicle_list),
withParent(withId(R.id.ll_vehicle)),
isDisplayed()));
recyclerView.perform(actionOnItemAtPosition(3,swipeUp()));
public static ViewAction swipeUp() {
return new GeneralSwipeAction(Swipe.FAST, GeneralLocation.CENTER_LEFT,
GeneralLocation.CENTER_RIGHT, Press.FINGER);
}
Upvotes: 0
Reputation: 19351
Nowadays, Espresso Test Recorder lacks in features like swipe events or starting from actual activity. Maybe that would be fixed in the nearest feature.
Nowadays, still more simple and less flaky way is to write Espresso tests.
This might be useful:https://google.github.io/android-testing-support-library/downloads/espresso-cheat-sheet-2.1.0.pdf
Hope it will help.
Upvotes: 1