【发布时间】:2015-06-23 06:53:04
【问题描述】:
我将此依赖项添加到gradle:
// 单元测试依赖项
testCompile 'junit:junit:4.12'
// 如果要使用 Hamcrest 匹配器库,请设置此依赖项
testCompile 'org.hamcrest:hamcrest-library:1.3'
// 更多的东西,例如,Mockito
androidTestCompile 'org.mockito:mockito-core:1.+'
androidTestCompile "com.google.dexmaker:dexmaker:1.2"
androidTestCompile "com.google.dexmaker:dexmaker-mockito:1.2"
androidTestCompile 'com.android.support.test:runner:0.3'
androidTestCompile 'com.android.support.test:rules:0.3'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2'
// 添加这个以支持意图模拟
androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2'
// 添加这个以支持 webview 测试
androidTestCompile 'com.android.support.test.espresso:espresso-web:2.2'
并成功同步 build.gradle 但是当我想导入这些类时:
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
IDE (Android Studio 1.2) 给我一个无法解析符号测试的错误,我搜索太多但没有找到任何答案
【问题讨论】:
标签: java android android-espresso