[Android][Jacoco] Jacoco test coverage when run with CucumberInstrumentation

99 views
Skip to first unread message

Grigore Dragan

unread,
Jun 25, 2015, 5:55:05 AM6/25/15
to cu...@googlegroups.com
Hi,

Is it possible to get the test coverage with jacoco when I test with Android's JUnit extension.

So my configurations are:

build.gradle

android {
    jacoco {
        version = '0.7.0.201403182114'
    }

   ...............

   defaultConfig {

   ..........
        testInstrumentationRunner "cucumber.api.android.CucumberInstrumentation"
    }

   ...............

   buildTypes {
        ..........
        debug {
            testCoverageEnabled true
        }
    }
    ...............

java test case

@RunWith(Cucumber.class)
@CucumberOptions(
        features = "features",
        glue = "com.package.name"
)
public class ApplicationTest extends ApplicationTestCase<Application> {

    public ApplicationTest() {
        super(Application.class);
    }
}

When I run this command "gradlew :library:connectedCheck" jacoco generates an empty file build/outputs/reports/coverage/debug/index.html

Thank you.

Tim Baverstock

unread,
Jul 25, 2015, 7:53:59 AM7/25/15
to Cukes
Hi.

I'm not entirely sure what you're doing, but I wrote this blog about getting Jacoco coverage from Ruby Cucumber runs. It might be relevant.

https://techblog.badoo.com/blog/2015/07/22/jacoco-coverage-in-cucumber-on-android/
Reply all
Reply to author
Forward
0 new messages