草庐IT

test_event

全部标签

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

dart - PageView : Disable the default scrolling and replace it with Tap event

如果我有PageView,如何禁用默认滚动行为(滑动)并通过点击按钮将下一个项目滚动到View中? 最佳答案 要禁用滑动,您可以设置:PageView(physics:NeverScrollableScrollPhysics()) 关于dart-PageView:DisablethedefaultscrollingandreplaceitwithTapevent,我们在StackOverflow上找到一个类似的问题: https://stackoverflow

dart - PageView : Disable the default scrolling and replace it with Tap event

如果我有PageView,如何禁用默认滚动行为(滑动)并通过点击按钮将下一个项目滚动到View中? 最佳答案 要禁用滑动,您可以设置:PageView(physics:NeverScrollableScrollPhysics()) 关于dart-PageView:DisablethedefaultscrollingandreplaceitwithTapevent,我们在StackOverflow上找到一个类似的问题: https://stackoverflow

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 - 在 Fragment 中实现 onKeyPreIme(int keyCode, KeyEvent event)

我不知道如何在Fragment中实现onKeyPreIme(intkeyCode,KeyEventevent)。@OverridepublicbooleanonKeyPreIme(intkeyCode,KeyEventevent){if(keyCode==KeyEvent.KEYCODE_BACK&&event.getAction()==KeyEvent.ACTION_UP){//doyourstuffreturnfalse;}returnsuper.dispatchKeyEvent(event);}我尝试了很多,但没有任何效果。此外,我在Google或StackOverflow上找不

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

android - MultiDexTestRunner 的哪个包? android.support.multidex 或 com.android.test.runner

页面http://developer.android.com/tools/building/multidex.html#testing建议dependencies{compile'com.android.support:multidex:1.0.1'androidTestCompile'com.android.support:multidex-instrumentation:1.0.1'}android{defaultConfig{multiDexEnabledtruetestInstrumentationRunner"android.support.multidex.MultiDex

Android Gradle 应用程序 :connectedCheck runs tests from dependencies

我有一些图书馆项目有自己的测试。我不负责这个库项目,也不关心它的测试,但是,当我运行gradle:app:connectedCheck时,它会运行我的测试,但它也会运行依赖项的测试。有什么办法可以防止这种情况发生吗?我应该提一下,我的依赖项不在我所说的app模块中。编辑:更具体地说,我所依赖的库项目有非常长的测试,因为它们打算在凌晨2点在构建服务器上运行,所以我坐在这里等待油漆干燥只是为了运行我的测试很短。EDIT2:我也尝试过使用Spoon。我现在已经设置好并且可以运行单独的类,但我想在一个包中运行所有内容。这可能吗?EDIT3:文件夹结构无关紧要,但这里有一个非常非常不详细的外观: