草庐IT

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

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

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注解我可以

ic_sync_black_24dp.xml 的 android.content.res.Resources$NotFoundException

我已经为此苦苦挣扎了一个多星期,因为我认为它必须与我的环境有关,但我无法缩小范围。我开始一个空项目,添加一个“空白”Activity并接受所有默认设置。项目设置完成后,我添加一个“设置”Activity。在MainActivity.java中,我添加了两行代码来连接两个Activity,然后构建项目。publicbooleanonOptionsItemSelected(MenuItemitem){//Handleactionbaritemclickshere.Theactionbarwill//automaticallyhandleclicksontheHome/Upbutton,so

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 - 测试运行失败 : 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

android - 如何在 android 中从顶部到屏幕的 300dp 设置动 Canvas 局,反之亦然?

要求我可以根据toYDelta="100%或toYDelta="50%等转换布局但我只想在300dp高度中设置动Canvas局。slide_down.xmlslide_up.xmlJava代码(动画)Animationanimation=AnimationUtils.loadAnimation(getActivity().getApplicationContext(),R.anim.slide_down);animation.setAnimationListener(newAnimationListener(){@OverridepublicvoidonAnimationStart(A

android - 在 Android Studio 项目上找不到参数的方法 test()

在我的Android应用程序中,我想在包中排除一些测试用例,以便我在build.gradle文件中使用test任务。例如:applyplugin:'com.android.library'test{exclude'**/calltest/Summary.class'}如果同步项目我得到以下异常:*Whatwentwrong:Aproblemoccurredevaluatingproject':SdkModule'.>Couldnotfindmethodtest()forarguments[build_4g3vf7b615x3x1p7i9ty0pt1l$_run_closure1@73d

android - 多模块 Android 项目中的全局代码覆盖率 : merge code coverage reports (Unit & UI tests)

我有一个由2个模块组成的Android应用:应用-用户界面子模块-具有大部分业务逻辑对于它们中的每一个,我都有一个gradle任务来验证代码覆盖率:应用:UI代码覆盖率(Espresso)子模块:单元测试代码覆盖率作为客户的要求,我需要合并这两个报告以获得应用程序的整体/全局代码覆盖率。注意:我使用的是Gradle版本3.1.2。应用程序Gradle文件:applyplugin:'jacoco'android{testBuildType"uiTest"...buildTypes{debug{applicationIdSuffix".debug"versionNameSuffix"-de