【发布时间】:2016-01-07 00:45:22
【问题描述】:
我的 Espresso 测试一直在运行,直到我不得不支持 multidex。
我的 build.gradle,我有
minSdkVersion 14
targetSdkVersion 23
multiDexEnabled = true
testInstrumentationRunner "com.android.test.runner.MultiDexTestRunner"
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.2.1'
androidTestCompile 'com.android.support.test:runner:0.4.1'
androidTestCompile 'com.android.support.test:rules:0.4.1'
dexOptions {
jumboMode true
javaMaxHeapSize "4g"
incremental true
}
Test1AuthenticationEspressoTest
@RunWith(AndroidJUnit4.class)
@SmallTest
public class Test1AuthenticationEspressoTest {
@Rule
public ActivityTestRule<WelcomeActivity> mActivityRule = new ActivityTestRule(WelcomeActivity.class);
}
这是我得到的错误
junit.framework.AssertionFailedError: 未找到测试 com.livestrong.tracker.test.Test1AuthenticationEspressoTest
任何帮助将不胜感激。任何人都使用 multidex 的 espresso 吗?
【问题讨论】:
-
所以如果你删除'multiDexEnabled = true'你就可以测试了,对吧?用自己的 Gradle 文件考虑项目中的新模块
-
当我将测试运行器更改为 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 时它开始工作了
-
我遇到了完全相同的问题,但您所做的更改似乎都没有解决它。这吹。
标签: android android-espresso android-multidex