我有Espresso測試並希望應用程序保持在測試完成時的確切活動。我需要繼續與應用程序進行交互。安卓意式濃縮咖啡讓應用程序在測試後運行
@SmallTest
public void testOpenNavigationDrawer()
{
Espresso.onView(ViewMatchers.withId(com.eleks.espresso.example.app.R.id.content_frame)).perform(ViewActions.swipeRight());
ListView lvDrawerMenu = (ListView) getActivity().findViewById(com.eleks.espresso.example.app.R.id.lvDrawerMenu);
Preconditions.checkNotNull(lvDrawerMenu, "lvDrawerMenu is null");
final int count = lvDrawerMenu.getAdapter().getCount();
Preconditions.checkPositionIndex(2, count, "No 1 index " + count + " size");
Object obj = lvDrawerMenu.getItemAtPosition(2);
Espresso.onView(Matchers.allOf(ViewMatchers.withId(com.eleks.espresso.example.app.R.id.tvItem), ViewMatchers.hasSibling(ViewMatchers.withText(obj.toString())))).perform(ViewActions.click());
}
我該怎麼做? 謝謝!