Gradle Test Report for Android

Can I have a gradle test report for tests on Android? I want to get the report directly in the terminal. Every time a test is passed, failed or skipped, I want the report to be printed in the terminal with the test name and status.

For unit tests, I can add this to the gradle file to have reports:

tasks.withType(Test) {
    testLogging {
        exceptionFormat "full"
        events "passed", "skipped", "failed"
    }
}

I did not find a solution for tests on Android.

+4
source share
4 answers

There is an error sent to the platform tools command, which is not yet resolved:

https://code.google.com/p/android/issues/detail?id=182307

. , Gradle Plugin >= 1.5.0, , :

./gradlew cC --info

, .

, !

+1

app/build/reports/tests/debug/index.html app/build/test-results/?

.

0

( / build.gradle)

tasks.withType(com.android.build.gradle.internal.tasks.AndroidTestTask) { task ->
    task.doFirst {
        logging.level = LogLevel.INFO
    }
    task.doLast {
        logging.level = LogLevel.LIFECYCLE
    }
}
0

- , , unitTests AndroidTests , "--debug" gradle.

:

./gradlew cleanTestDebugUnitTest testDebugUnitTest cleanConnectedDebugAndroidTest connectedDebugAndroidTest --debug

0
source

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


All Articles