How to generate html report using gradle 1.12?

Does anyone know how to create a test report for gradle 1.12?

I am using gradle 1.12. My test extends ActivityInstrumentationTestCase2. using the Espresso test medium. My test run, but does not generate an html report.

Here is my build.gradle:

apply plugin: 'com.android.application' apply plugin: 'crashlytics' repositories { maven { url 'http://download.crashlytics.com/maven' } maven { url 'http://JRAF.org/static/maven/2' } jcenter() } dependencies { compile fileTree(dir: 'libs', include: '*.jar') ... } android { compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion def Properties versionProps = new Properties() versionProps.load(new FileInputStream(file('version.properties'))) defaultConfig { applicationId 'com.android.apps' minSdkVersion 9 targetSdkVersion 20 versionName versionProps['name'] versionCode versionProps['code'].toInteger() testApplicationId 'my.test' testInstrumentationRunner 'com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner' } android { useOldManifestMerger true } packagingOptions { exclude 'META-INF/services/javax.annotation.processing.Processor' } compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } lintOptions { abortOnError false } productFlavors { } } 

I run my test using a shell script. Here is my shell script:

 # Clean and Build the project gradle clean build # Install apk to device gradle installDebug installDebugTest # Run specific test /Applications/Android\ Studio.app/sdk/platform-tools/adb shell am instrument -e class my.test.RunTestSuite -w my.test/com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner 

Result on the command line:

 ... BUILD SUCCESSFUL Total time: 55.003 secs my.test.TestActionBar:. Test results for GoogleInstrumentationTestRunner$BridgeTestRunner=. Time: 32.519 OK (1 test) 

If a failure

 Test results for GoogleInstrumentationTestRunner$BridgeTestRunner=.E Time: 29.595 FAILURES!!! Tests run: 1, Failures: 0, Errors: 1 
+6
source share
1 answer

See Gradle userguide by going to example 23.14. Creating a unit test report for subprojects

Also see this post.

+3
source

Source: https://habr.com/ru/post/973361/


All Articles