如何使用浓咖啡

时间:2016-10-13 10:13:24

标签: android android-espresso

我是espresso的新手,我正在尝试为我的Android应用程序编写测试用例。我在谷歌上搜索了导航抽屉菜单的测试用例。但是因为我无法导入

 import static android.support.test.espresso.contrib.DrawerActions.closeDrawer;
import static android.support.test.espresso.contrib.DrawerActions.openDrawer;
import static android.support.test.espresso.contrib.DrawerMatchers.isClosed;
import static android.support.test.espresso.contrib.DrawerMatchers.isOpen;

所以请帮助我。提前谢谢

1 个答案:

答案 0 :(得分:1)

将这些依赖项添加到app/build.gradle文件中:

androidTestCompile("com.android.support.test.espresso:espresso-contrib:2.2.2") {
    exclude group: 'com.android.support', module: 'appcompat'
    exclude group: 'com.android.support', module: 'support-v4'
    exclude group: 'com.android.support', module: 'support-v7'
    exclude group: 'com.android.support', module: 'design'
    exclude module: 'support-annotations'
    exclude module: 'recyclerview-v7'
}

希望它会有所帮助