jjzjj

androidTestCompile

全部标签

Android 测试 java.lang.NoClassDefFoundError 错误由于 Fest-Android

我目前正在将FestforAndroid实现到我的项目中,但我似乎遇到了依赖性问题。如果我在不包含Fest库的情况下运行我的测试,测试将正常运行。一旦我添加了Fest库,测试就不再运行。而是抛出异常。我的项目使用了以下依赖项:compilefiles('libs/robotium-solo-5.1.jar')androidTestCompile'com.squareup:fest-android:1.0.8'androidTestCompile'com.google.code.gson:gson:2.2.4'androidTestCompile'com.jayway.android.r

Android Gradle 单元测试从 JAR 迁移 - 从 junit 和 mockito 复制 hamcrest 文件

我终于将使用JAR文件运行的旧单元测试迁移到使用gradle,但我在获得正确的组合时遇到了很多麻烦,并且不确定我在做什么是对还是错。首先,这些是我正在使用的所有jar文件。dexmaker-1.0.jardexmaker-mockito-1.0.jarfest-android-1.0.7.jarfest-assert-core-2.0M10.jarfest-util-1.2.5.jarjunit-4.11.jarmockito-all-1.9.5.jarthe-missing-android-xml-junit-test-runner-release-1.3_2.jar当我像下面这样的

Android 版本 24.0.0 和 Espresso 2.0 gradle 异常

我正在尝试在我的应用程序中使用Espresso2.0,以测试UI元素。但是gradle不允许这样做。它给了我这条信息Error:Conflictwithdependency'com.android.support:support-annotations'.Resolvedversionsforapp(24.0.0)andtestapp(23.1.1)differ.Seehttp://g.co/androidstudio/app-test-app-conflictfordetails.这是我的gradle文件applyplugin:'com.android.application'and

android - Mockito 的 IllegalArgumentException

我正在尝试测试当我执行我的HomePresenter类的方法“onCreate(IHomeViewiHomeView)”时调用“setTabs()”。“SetTabs()”是IHomeView中的一个接口(interface)方法。为了测试它,我使用了mockito,但是当我调用homeView.setTabs()时出现了illegalArgumentException我把我的代码放在这里,很简单:我的简单测试:importjunit.framework.Assert;importorg.junit.Before;importorg.junit.Test;importorg.junit

Android 测试 - 如何添加 Espresso 日志

我在用androidTestCompile'com.android.support.test:runner:0.3'androidTestCompile'com.android.support.test:rules:0.3'androidTestCompile'com.android.support:support-annotations:23.0.1'androidTestCompile'com.android.support.test.espresso:espresso-core:2.2'androidTestCompile('com.android.support.test.es

android - 在不一致的位置观察到包 id 'build-tools;20.0.0'

./gradlew--parallel:app:assembleDebugTest当我在androidstudio终端中运行上面的命令时,出现了这个错误。错误并行执行是一项孵化功能。在不一致的位置“sdk/build-tools/android-4.4W”中观察到包ID“build-tools;20.0.0”(应为“sdk/build-tools/20.0.0”)Gradle文件应用插件:'com.android.application'android{compileSdkVersion22buildToolsVersion'23.0.2'packagingOptions{exclud

android - 如何管理运行时权限 android marshmallow espresso 测试

我正在使用espresso进行测试,但有时我尝试从外部存储中获取图像,并且使用marshmallow我需要运行时权限,否则会出现异常崩溃并且测试将失败。androidTestCompile'com.android.support.test:runner:0.4'androidTestCompile'com.android.support.test:rules:0.4'androidTestCompile'com.android.support.test.espresso:espresso-core:2.2.1'androidTestCompile'com.android.support

android - 如何管理运行时权限 android marshmallow espresso 测试

我正在使用espresso进行测试,但有时我尝试从外部存储中获取图像,并且使用marshmallow我需要运行时权限,否则会出现异常崩溃并且测试将失败。androidTestCompile'com.android.support.test:runner:0.4'androidTestCompile'com.android.support.test:rules:0.4'androidTestCompile'com.android.support.test.espresso:espresso-core:2.2.1'androidTestCompile'com.android.support

android - 当包含在 androidTestCompile 中时,Espresso 将找不到 View

这太奇怪了。我有一个Activity和一个ViewPager,它承载几个Fragment,第一个有一个RadioButton使用IDandroid:id="@+id/backjudgeRadionButton"。我有一个Espresso测试,如下所示:importandroid.test.ActivityInstrumentationTestCase2;importmodel.GameSetup;importui.SetupActivity;importweigl.fm.refwatch.R;importstaticandroid.support.test.espresso.Espre

java - 导入中无法识别 AndroidTestCompile 依赖项

实际上,我的项目有单元测试。都配置在/src/test/java/最近需要在/src/androidTest/java添加插桩测试。为此,我在build.gradle中添加了espresso依赖项。dependencies{compilefiles('libs/pixlui-1-0-5.jar')//YoumustinstallorupdatetheSupportRepositorythroughtheSDKmanagertousethisdependency.compile('com.fortysevendeg.swipelistview:swipelistview:1.0-SNAP
12