@LargeTest public class FirstActivityTest { @Rule public ActivityTestRule<FirstActivity> firstActivityTestRule = new ActivityTestRule<>( FirstActivity.class);@Testpublic voID testVIEwPagerSwipeFunctionality() throws InterruptedException{ onVIEw(withID(R.ID.tv_commu)).check(matches(withText(R.string.first_screen_text))); onVIEw(withID(R.ID.tv_skip)).check(matches(withText(R.string.skip))) ; onVIEw(withID(R.ID.radio_button_first)).check(matches(isChecked())); onVIEw(withID(R.ID.vIEw_pager)).perform(swipleft()); onVIEw(withID(R.ID.radio_button_second)) .check(matches(isChecked())); onVIEw(withID(R.ID.tv_comp)).check(matches(withText(R.string.second_screen_text))); onVIEw(withID(R.ID.tv_skip)).check(matches(withText(R.string.skip))) ; onVIEw(withID(R.ID.vIEw_pager)).perform(swipeleft()); onVIEw(withID(R.ID.radio_button_third)) .check(matches(isChecked())); onVIEw(withID(R.ID.tv_skip)).check(matches(withText(R.string.skip))) ; onVIEw(withID(R.ID.tv_person)).check(matches(withText(R.string.third_screen_text)));}}@H_502_2@但是swipeleft()方法没有得到解决.请告诉我我在哪里做错了?我们将非常感谢您的帮助.解决方法 你必须导入swipeleft(),如:
import static androID.support.test.espresso.action.VIEwActions.swipeleft;@H_502_2@边注:示例代码具有swipleft()而不是swipeleft(). 总结
以上是内存溢出为你收集整理的如何使用Espresso 2.2在Android中测试查看寻呼机滑动手势全部内容,希望文章能够帮你解决如何使用Espresso 2.2在Android中测试查看寻呼机滑动手势所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)