我们目前有一个Android应用程序,我们正在使用Espresso进行测试.我们要测试的功能之一是从本地图库中选择图片/图片.我们可以一直调出图库视图,但无法在结果窗口中选择最近,下载,图库.下面列出了我们如何得到的摘要.
public void testShouldBeAbleToSelectPhotoFromGallery() {
getActivity();
// given
onView(withId(launch_gallery_button)).perform(click());
onView(withText("Gallery")).perform(click()); // this is a button in our app
// then we get stuck :(
}
Run Code Online (Sandbox Code Playgroud)
谢谢!