草庐IT

test_tasks

全部标签

android - 错误 :Execution failed for task ':app:prepareDebugAndroidTestDependencies' . > 依赖性错误。详情见控制台

错误:任务':app:prepareDebugAndroidTestDependencies'执行失败。DependencyError.Seeconsolefordetails.在app.gradle文件中添加如下依赖后-androidTestCompile'com.android.support.test:runner:0.5'androidTestCompile'com.android.support.test:rules:0.5'androidTestCompile'com.android.support.test.espresso:espresso-core:2.2.2'//a

android - 如果 gradle-android-test-plugin 测试失败,不要让 gradle 构建失败

我将我的项目设置为使用Robolectric和gradle-android-test-plugin运行.这一切工作正常,第一个测试正在运行但失败了。如果测试失败,这也将导致gradle构建失败。有没有办法让构建继续进行,并记下失败的测试以供后续步骤评估?计划是将测试集成到持续集成服务器中,只有在测试失败时构建才会不稳定。 最佳答案 嗯。好吧,我认为你有两个选择。一种是使用testTask.ignoreFailures=true当测试失败时不让任务失败。另一种方法是使用“--continue”运行gradle命令。这将执行尽可能多的任

安卓工作室 : Error:Execution failed for task ':app:dexDebug'

我是第一次使用AndroidStudio,导入项目后出现以下错误(之前是eclipse项目,我也有问题。)这里是给出的信息:Error:Executionfailedfortask':app:dexDebug'.>com.android.ide.common.internal.LoggedErrorException:Failedtoruncommand:/home/crash-id/Development/SDK/adt-bundle-linux-x86_64-20140702/sdk/build-tools/21.1.2/dx--dex--no-optimize--output/h

android - 没有找到类 "android.support.test.runner.AndroidJUnitRunner"

我正在尝试使用插桩测试,并将我的项目更新为AndroidX。但是在尝试运行时出现以下错误:2018-10-0914:22:29.46813263-13263/xxx.yyyE/AndroidRuntime:FATALEXCEPTION:mainProcess:xxx.yyy,PID:13263java.lang.RuntimeException:UnabletoinstantiateinstrumentationComponentInfo{xxx.yyy.test/android.support.test.runner.AndroidJUnitRunner}:java.lang.Cla

android - "No tests found"用于 Lollipop 及更高版本的仪器测试

我基于仪器的(espresso)测试无法在Lollipop+设备和模拟器上运行。它们可以在任何其他平台上正确运行。我和这个线程中的人有相同的症状-https://groups.google.com/forum/?fromgroups#!topic/adt-dev/QW5SuzQizNk我的测试在src/androidTest/java/我已经设置了testInstrumentationRunner'android.support.test.runner.AndroidJUnitRunner'测试类是@RunWith(AndroidJUnit4.class)个别测试用@Test注解我可以

android - 为什么我不能在构建脚本中使用 gradle task connectedDebugAndroidTest?

我可以从我的构建脚本中引用connectedCheck任务(来自android插件):connectedCheck.finalizedByAndroidShowTestResults但尝试使用connectedDebugAndroidTest(它也来自android插件)connectedDebugAndroidTest.finalizedByAndroidShowTestResults给我Error:(48,0)Couldnotfindproperty'connectedDebugAndroidTest'onproject':app'.如果我尝试taskconnectedDebugA

android - java.lang.SecurityException : Permission Denial: getIntentSender() when using UiAutomation in a test 错误

每当我尝试使用UiAutomation在通过getInstrumentation().getUiAutomation()进行的任何测试中,进程崩溃并出现以下异常:java.lang.SecurityException:PermissionDenial:getIntentSender()frompid=30334,uid=2000,(needuid=1000)isnotallowedtosendaspackageandroidatandroid.os.Parcel.readException(Parcel.java:1540)atandroid.os.Parcel.readExcepti

android - 清除旧 SDK 上的完整 Android Activity 堆栈(缺少 FLAG_ACTIVITY_CLEAR_TASK)

我已经对SO进行了一些阅读和搜索,但找不到清除当前Activity堆栈的方法。我的应用程序的上下文是由后台服务/通知启动的Activity。想象一下,我的应用程序允许您组织人员列表。几个小时前,您正在“查看”Activity中查看人X,现在它位于堆栈的顶部。在未来的某个时间点,服务会触发,我会为Y弹出一个新的“通知”Activity。从那里您可以编辑Y的详细信息。当您完成此Activity时,弹出堆栈并最终查看人员X将是一种令人困惑的用户体验。理想情况下,我想回到用户正在做的事情(电子邮件等...),或者至少到我的应用主页。我尝试使用FLAG_ACTIVTY_NEW_TASK启动“通知

android - 测试运行失败 : Test run failed to complete. 预期 1 次测试,收到 0

我尝试为我的应用启动JUnit测试(robotium):publicclassMainTestextendsActivityInstrumentationTestCase2{privateSolosolo;publicMainTest(){super("nix.android.contact",MainActivity.class);//TODOAuto-generatedconstructorstub}protectedvoidsetUp()throwsException{super.setUp();solo=newSolo(getInstrumentation(),getActiv

android - 找不到错误 :resource style/TextAppearance. Compat.Notification.Info(又名 {packageId}.test :style/TextAppearance. Compat.Notification.Info)

我刚刚将build.gradle编译SDK更新为27API。compileSdkVersion27buildToolsVersion'27.0.3'targetSdkVersion27但是一旦我点击同步按钮它就​​会抛出error:resourcestyle/TextAppearance.Compat.Notification.Info(aka{packageId}.test:style/TextAppearance.Compat.Notification.Info)notfound.error:resourcestyle/TextAppearance.Compat.Notificat